#RubyOnRails - 18 March 2017
« Back 1 day Forward 1 day »
[00:01:37] amperry: Hi folks, I've got a WorkOrder model, the table for which I created manually. In `work_orders_controller.rb#create`, I couldn't get an id even after calling `.save` manually. I see the new order in the db, with an id of 4, but when I visit `localhost:3000/work_orders/4`, I get: "Unknown primary key for table work_orders in model WorkOrder."
[00:04:15] amperry: did not write a migration for it, just wrote the create table statement in the psql client;
[00:08:17] amperry: _3dwardsharp: it always seemed easier for me to run db:schema:dump rather than bother with them. They also seemed to be a fertile source of subtle bugs when I did.
[00:16:02] amperry: This seems to help, but I don't know why I had to add self.primary_key = "id" for this one table: http://stackoverflow.com/a/18058207/1255874
[01:24:33] havenwood: Darmani: At our local Ruby group I setup a Windows 10 user last week with Windows Subsystem for Linux, ruby-install and chruby and it went off without a hitch.
[01:25:10] Darmani: havenwood: That's awesome! That's what I'm in the process of doing. I already have the subsystem installed.
[01:26:00] Darmani: havenwood: I'm having trouble with the Linux Shell though. None of the files I'm creating from the Shell can be seen from the Windows File Explorer...
[03:11:30] machty: i am attempting a tricky refactor that involves splitting an ActiveRecord model/table into two
[03:12:19] machty: for the purpose of minimizing code changes i've attempted an approach where legacy code that i dont' want to change can still interface with a facade class that pretends to be that old style class
[03:13:17] machty: and basically the attribute being updated might live on one new class or the other
[03:38:27] raul782: Hello guys, is there a gem that can audit correctly many to many relationships or habtm w/MySQL, papertrail and audited are giving us erros, it looks like there is a limitation
[11:55:02] echosystm: i've used rbenv and rvm in the past, but all the shell hacks didn't sit right with me
[12:46:06] jennye: Hello. I'm trying to setup backups with the 'backup' gem, and store these on Amazon S3. Now in the generated backup.rb I need to fill this in: store_with SCP do |server| server.username = "my_username" server.password = "my_password" server.ip = "123.45.678.90" server.port = 22 server.path = "~/backups/" server.keep = 5 end. Where can I find these credentials? (Sorry for the
[13:40:32] megan_: I'm using Whenever and Backup to schedule backups each 24 hours. I've tested this on my local machine and works perfect. But my question is; how can it be that when I quit my server I still get succes emails? Shouldn't this be not possible due I dont have my server running?
[13:45:44] megan_: daed: can i check for those processors? And don't you think it's odd, that it still makes backup even tho the rails server is off?
[13:46:04] daed: megan_: not really, for example sidekiq and other background things run as their own process, not the web server itself
[13:55:56] daed: we usually just do a pgdump or mysqldump or whatever database-level backups and scp the files off-site
[13:58:46] daed: 'domain specific language', ruby's meta-programming, activerecord, rails, is all kinda built around that
[14:03:39] daed: instead of declaring a bunch of other code like "Routes.create(:blah, 'xyz')" etc etc
[14:08:15] daed: to be fair though, rolling your own blog system is pretty dead simple in rails as-is
[14:09:07] daed: yeah there's basically a BlogEntry model right? rails already has created_at updated_at etc
[14:13:07] roflmyeggo: daed: are these personal apps you are talking about? Or client apps? Or part of your job
[14:14:43] roflmyeggo: it becomes less clear if the investment of not using a pre-made gem is worth it
[16:14:10] Dysp: Hey people. I was wondering if someone could help me understand a concept. I am retrieving an activerecord_relation via .where(foo: "bar") and passing it on to the view. How do I access attributes on the record and print it on the view? If I simply call .foo in the view, I get unknown method
[16:17:39] Peter_SS1: I'm using the Whenever gem for scheduled cronjobs, works perfect. But when I quit my server the cronjob still 'succeeds'. So it basically runs on OS level instead of listening to the rails server itself. I'm looking for some more information on this aspect, does anyone know some resources that can support me on this?
[16:24:22] Papierkorb: whenever creates, as you mentioned, cronjobs, which are run by your cron daemon
[16:29:09] Papierkorb: peter____: There are many different implementations, though you should find information on that in the docs/wiki of your distribution. most ship with one
[19:12:42] rikkipitt: hey folks, i'm looking to add oauth to my rails app to authenticate against an external service to allow the user to import data easily from the third party. say I want to add another third party that does the same thing (but has a slightly different API) how should I go about normalising and importing data per third party?
[22:52:33] Gargron: how can i get the index of the worker process from inside the worker process when using puma?
[23:31:07] mwlang: I am working on a gem for Rails and want to test that I’ve correctly implemented a singleton pattern…that is, that only one instance of a class is instantiated per request. How can I set up a test to check this?