« Back to channel list

#RubyOnRails - 27 April 2018

« Back 1 day Forward 1 day »
[00:00:12] alfiemax: has joined #RubyOnRails
[00:00:33] uks: has joined #RubyOnRails
[00:01:46] Technodrome: has joined #RubyOnRails
[00:12:38] w0rd-driven: has joined #RubyOnRails
[00:15:51] workmad3: has joined #RubyOnRails
[00:19:09] Linuus: has joined #RubyOnRails
[00:23:43] apeiros: has joined #RubyOnRails
[00:30:48] jane_booty_doe: has joined #RubyOnRails
[00:46:24] camonz: has joined #RubyOnRails
[00:47:07] camonz: is there a way to config app-wide for routes paths to be dasherized instead of underscored?
[00:51:33] eckhardt: has joined #RubyOnRails
[00:55:22] Radar: camonz: nope
[00:56:03] camonz: Radar: thanks dude
[00:56:57] camonz: was just checking out an app with a react frontend and it seems they're dasherizing paths to conform to react's settings
[00:59:15] Radar: camonz: For one, it'd break the routing helpers. Dashes aren't allowed in method names in Ruby.
[00:59:35] Radar: Other than going through your routes file and manually defining path for each of the routes, I cannot think of another way to do this
[00:59:49] Radar: resources :your_things, path: "your-things"
[01:00:09] camonz: yep, that's how they're doing it
[01:00:41] camonz: Ember has a neat solution, just redefine pathForType on the ApplicationAdapter to use underscores
[01:04:46] Linuus: has joined #RubyOnRails
[01:37:59] alfiemax: has joined #RubyOnRails
[02:00:56] orbyt_: has joined #RubyOnRails
[02:10:40] alfiemax: has joined #RubyOnRails
[02:13:14] Linuus: has joined #RubyOnRails
[02:14:43] workmad3: has joined #RubyOnRails
[02:16:45] hays: has joined #RubyOnRails
[02:17:29] hays: i am not understanding exactly how ActiveRecord::Base.establish_connection is supposed to work
[02:17:52] hays: is this basically the connection for all classes derived from this class?
[02:52:36] tdy: has joined #RubyOnRails
[02:55:10] sevenseacat: has joined #RubyOnRails
[02:57:43] Linuus: has joined #RubyOnRails
[02:58:00] LateralOctober: has joined #RubyOnRails
[03:09:24] bga57: has left #RubyOnRails: ()
[03:13:41] bga57: has joined #RubyOnRails
[03:13:51] schneider: has joined #RubyOnRails
[03:30:18] mroutis: has joined #RubyOnRails
[03:32:54] Linuus: has joined #RubyOnRails
[03:49:19] eckhardt: has joined #RubyOnRails
[03:53:44] cschneid_: has joined #RubyOnRails
[04:00:57] roamingdog: has joined #RubyOnRails
[04:07:11] Linuus: has joined #RubyOnRails
[04:13:39] workmad3: has joined #RubyOnRails
[04:39:19] cpruitt: has joined #RubyOnRails
[04:44:11] KeyJoo: has joined #RubyOnRails
[04:44:59] cpruitt: has joined #RubyOnRails
[04:55:26] mjolnird: has joined #RubyOnRails
[05:01:01] _aeris_: has joined #RubyOnRails
[05:10:40] Gizmokid2005: has joined #RubyOnRails
[05:21:36] jane_booty_doe: has joined #RubyOnRails
[05:21:42] Linuus: has joined #RubyOnRails
[05:39:05] reber: has joined #RubyOnRails
[05:42:51] cpruitt: has joined #RubyOnRails
[05:53:29] cpruitt: has joined #RubyOnRails
[05:53:50] dminuoso: has left #RubyOnRails: ("WeeChat 2.0.1")
[05:54:37] armyriad: has joined #RubyOnRails
[05:57:09] Linuus: has joined #RubyOnRails
[06:06:16] roshanavand: has joined #RubyOnRails
[06:12:39] workmad3: has joined #RubyOnRails
[06:22:29] conta: has joined #RubyOnRails
[06:31:34] cpruitt: has joined #RubyOnRails
[06:36:21] Linuus: has joined #RubyOnRails
[07:13:48] Linuus: has joined #RubyOnRails
[07:15:52] srinidhi: has joined #RubyOnRails
[07:26:53] dedeqtor: has joined #RubyOnRails
[07:29:12] syndikate: Is dependency injection good or bad? I have been reading a lot about it and I couldn't find a proper answer. I have an ActiveJob class which comprises lot of logic and calculation. I have extracted most of it to a service but there are still some more.
[07:29:37] syndikate: I was thinking of moving all the logic to another service and let the ActiveJob be lean and just call the service - is this a good pattern?
[07:29:55] baweaver: Only do so if it really makes sense.
[07:30:23] syndikate: Could you elaborate a little please?
[07:30:36] syndikate: So, for now I am writing lot of specs for that ActiveJob class
[07:30:43] syndikate: To cover all the cases
[07:31:00] syndikate: I was not sure if this is a good pattern to have so much logic comprised in the job itself
[07:31:12] baweaver: Sometimes it's small enough it's too much of a hassle to do that
[07:31:32] syndikate: Ah okay, since this is not being used elsewhere, I think I could just leave it as it is then?
[07:31:41] baweaver: so only extract what actually makes sense
[07:31:51] baweaver: Probably. People get too carried away with extracting before it makes sense
[07:32:24] syndikate: Okay, I usually follow this rule - if it is required in another place then make a service
[07:32:39] baweaver: or if it's really annoying to test otherwise :P
[07:33:57] syndikate: It is a bit of, yes. The output of all that is a boolean value going into a table. There are many use cases that builds up to this. So, when it fails it's little complex to start digging each method which contributes to it :D
[07:34:42] syndikate: I might be wrong with my whole architecture itself to begin with there
[07:34:51] syndikate: What could I read to improve on these stuff?
[07:35:47] cpruitt: has joined #RubyOnRails
[07:35:52] baweaver: Don't read, write
[07:36:13] baweaver: Design documents, explain everything. Give a high level overview of the task, take notes, and detail concerns and approaches
[07:36:24] baweaver: don't start coding until you have a clear vision of what you're trying to write
[07:36:41] baweaver: Of course, all within limits. No sense in doing that for a simple bug
[07:36:42] jane_booty_doe: syndikate, https://medium.com/@RyanDavidson/service-objects-explained-simply-for-ruby-on-rails-5-a8cc42a5441f
[07:37:08] jane_booty_doe: https://medium.com/@RyanDavidson/service-objects-in-ruby-on-rails-handling-growth-with-modular-namespaces-6f2e7eb7da1
[07:37:10] rrichardsr3: has joined #RubyOnRails
[07:37:14] jane_booty_doe: I kinda go off that
[07:37:54] syndikate: baweaver, my main trouble is that I have lot of edge cases, and I have a huge spec file for my ActiveJob :D
[07:38:06] syndikate: I was not sure if that's the way to go
[07:38:11] syndikate: jane_booty_doe, Thanks, will have a look
[07:38:33] baweaver: Mostly I just ask about concerns
[07:38:41] baweaver: Is this really a concern of this object?
[07:39:10] baweaver: That said, take apart large classes piece by piece. Hero refactors make things go boom fast.
[07:50:56] conta: has joined #RubyOnRails
[07:52:24] Linuus: has joined #RubyOnRails
[07:57:08] workmad3: has joined #RubyOnRails
[08:07:15] jottr: has joined #RubyOnRails
[08:07:29] schneider: has joined #RubyOnRails
[08:10:23] srinidhi: has joined #RubyOnRails
[08:22:58] pwnd_nsfw: has joined #RubyOnRails
[08:24:18] dionysus69: has joined #RubyOnRails
[08:30:23] rrichardsr3: has joined #RubyOnRails
[08:30:32] kapil___: how to find if a column is foreign key or not?
[08:33:53] dang`r`us: you could look at your database schema
[08:33:57] dang`r`us: are you using postgres?
[08:41:57] jottr: has joined #RubyOnRails
[08:45:11] srinidhi: has joined #RubyOnRails
[08:45:25] marr: has joined #RubyOnRails
[08:48:28] kapil___: But how to find it in rails?
[08:51:01] dang`r`us: check schema.rb
[08:51:10] dang`r`us: but the definitive info is in the database
[08:51:19] dang`r`us: (well, it depends on what you mean by foreign key....)
[08:51:44] DrYockel: has joined #RubyOnRails
[08:52:15] kapil___: i am talking about referring foreign keys
[08:52:40] dang`r`us: I have no idea what you mean/want
[08:52:45] kapil___: i am making a generator. i want to check is column is foreign key or not
[08:53:25] dang`r`us: Have you looked around for existing software to do that?
[08:54:00] dang`r`us: I suggested that earlier
[08:54:03] dang`r`us: I repeat my suggestion :V
[08:54:25] kapil___: i dont want to find it from \d table or schema.rb
[08:54:51] dang`r`us: you can have a look at https://alexpeattie.com/blog/stop-forgetting-foreign-key-indexes-in-rails-post-migration-script
[08:54:56] dang`r`us: it looks dodgy to me though
[08:55:25] dang`r`us: I still suggest you look around for generator gems
[08:55:59] dang`r`us: bundle exec rake db:schema:dump generates schema.rb
[09:00:36] Linuus: has joined #RubyOnRails
[09:02:55] jottr: has joined #RubyOnRails
[09:03:54] Technodrome: has joined #RubyOnRails
[09:06:25] defsdoor: has joined #RubyOnRails
[09:16:27] Cache_Money: has joined #RubyOnRails
[09:22:02] cabotto: has joined #RubyOnRails
[09:24:39] cpruitt: has joined #RubyOnRails
[09:26:53] _aeris_: has joined #RubyOnRails
[09:29:02] roshanavand: has joined #RubyOnRails
[09:30:32] ellcs: has joined #RubyOnRails
[09:35:07] beilabs: has joined #RubyOnRails
[09:43:08] Linuus: has joined #RubyOnRails
[09:55:02] apeiros_: has joined #RubyOnRails
[09:55:11] Fernando-Basso: has joined #RubyOnRails
[09:56:15] stemid: has joined #RubyOnRails
[09:56:54] stemid: hey I'm a user of a puma application. I'm not sure what the relation with rails is but my issue is that it's forcing redirects to https. even with X-Forwarded-Proto: https set. is this a setting in puma or rails that I can override?
[09:57:02] stemid: because the application controller has no code that does this https redirect.
[10:14:47] za1b1tsu: has joined #RubyOnRails
[10:18:34] ferr: has joined #RubyOnRails
[10:18:39] ferr: has left #RubyOnRails: ()
[10:20:12] Linuus: has joined #RubyOnRails
[10:21:30] srinidhi: has joined #RubyOnRails
[10:24:05] jerematic: has joined #RubyOnRails
[10:27:05] dionysus69: has joined #RubyOnRails
[10:27:32] jnollette: has joined #RubyOnRails
[10:30:22] alfiemax: has joined #RubyOnRails
[10:31:42] roshanavand: has joined #RubyOnRails
[10:32:28] Technodrome: has joined #RubyOnRails
[10:32:57] Technodrome: has joined #RubyOnRails
[10:38:44] za1b1tsu: Hello, I'm generating a dynamic css from theme#show. Is there a nice way to add it to my layout/application?
[10:43:41] cabotto: has left #RubyOnRails: ()
[10:44:28] za1b1tsu: like is there a way to set the path stylesheet_link, the most elegant solution I found is stylesheet_link theme_url(format: :css), but I dont like because it's a full url
[10:46:22] unreal: has joined #RubyOnRails
[10:53:28] dionysus69: has joined #RubyOnRails
[10:54:03] cschneid_: has joined #RubyOnRails
[11:02:37] Linuus: has joined #RubyOnRails
[11:05:52] ltd: has joined #RubyOnRails
[11:05:55] _aeris_: has joined #RubyOnRails
[11:08:33] roshanavand: has joined #RubyOnRails
[11:12:00] LateralO1: has joined #RubyOnRails
[11:12:07] Torrone: has joined #RubyOnRails
[11:14:57] Torrone: Hello, I'm setting up an additional environment for my capistrano deploy, during this process I ran cap {ENV} puma:config and uploaded a new puma conf, I had everything set up so that puma created its socket file in "unix://#{shared_path}/tmp/sockets/#{fetch(:application)}-puma.sock" but the new puma conf has '/var/www/#{fetch(:application)}/shared/tmp/sockets/#{fetch(:application)}-puma.sock'. How do I change the latter? couldn't find
[11:14:57] Torrone: information on how capistrano generates this file
[11:16:17] cabotto: has joined #RubyOnRails
[11:17:06] Torrone: #{shared_path} is /home/<user>/apps/<application>/shared/
[11:17:08] cpruitt: has joined #RubyOnRails
[11:20:13] Cavallari: has joined #RubyOnRails
[11:26:45] cabotto: has joined #RubyOnRails
[11:28:05] dipnlik: has joined #RubyOnRails
[11:33:53] srinidhi: has joined #RubyOnRails
[11:36:49] ma5ter: has joined #RubyOnRails
[11:38:54] cabotto: has joined #RubyOnRails
[11:47:25] Linuus: has joined #RubyOnRails
[11:48:54] jottr: has joined #RubyOnRails
[12:06:53] ferr: has joined #RubyOnRails
[12:12:09] cabotto: has joined #RubyOnRails
[12:18:13] za1b1tsu_: has joined #RubyOnRails
[12:21:05] ellcs: has joined #RubyOnRails
[12:23:52] Linuus: has joined #RubyOnRails
[12:31:06] kurko_: has joined #RubyOnRails
[12:42:50] Torrone: capistrano generated puma conf anyone?
[12:43:21] ellcs: has joined #RubyOnRails
[13:06:41] rfoust: has joined #RubyOnRails
[13:24:17] kurko_: has joined #RubyOnRails
[13:26:15] DTZUZO: has joined #RubyOnRails
[13:26:41] Saukk: has joined #RubyOnRails
[13:27:14] KeyJoo: has joined #RubyOnRails
[13:29:52] dionysus69: has joined #RubyOnRails
[13:30:53] Technodrome: has joined #RubyOnRails
[13:35:11] Linuus: has joined #RubyOnRails
[13:43:23] ellcs: has joined #RubyOnRails
[13:46:52] AnotherOne: has joined #RubyOnRails
[13:54:11] ellcs: has joined #RubyOnRails
[13:58:50] tycoon177: It appears that my rails app is saving datetime objects to the database in UTC time. Is there a way that I can correct this and/or fetch them under the correct time?
[13:59:27] silviu: has joined #RubyOnRails
[14:01:19] lupine: use the `_with_timezone` column time
[14:01:28] lupine: datetime_with_timezone or whatever it is
[14:01:53] AnotherOne: or if you have a fix timezone .in_time_zone("Your timezone")
[14:02:02] lupine: personally, I find it much saner to store UTC in the DB
[14:02:07] samort7: has joined #RubyOnRails
[14:03:05] AnotherOne: yea he should store UTC
[14:03:25] AnotherOne: and than just convert it for the needed timezone
[14:04:08] AnotherOne: but he asked if he can fetch them under the corret time so i guess he should go with that
[14:12:40] Linuus: has joined #RubyOnRails
[14:17:21] rrichardsr3: has joined #RubyOnRails
[14:17:40] jottr: has joined #RubyOnRails
[14:22:01] dblessing: has joined #RubyOnRails
[14:39:14] dang`r`us: usually UTC is better; if you need to store information about time zones (e.g. for users, sites etc.) store the time zone name separately
[14:41:23] beilabs: has joined #RubyOnRails
[14:47:09] tycoon177: sorry, i was pulled away from my desk. What would I do in rails to convert it to the correct time before serving it up? Just date.with_timezone?
[14:48:53] Linuus: has joined #RubyOnRails
[14:49:43] cschneid_: has joined #RubyOnRails
[14:54:07] troys: has joined #RubyOnRails
[14:58:22] AnotherOne: date.in_time_zone("your timezone")
[15:10:32] tubbo: has joined #RubyOnRails
[15:16:33] jcarl43: has joined #RubyOnRails
[15:29:19] Linuus: has joined #RubyOnRails
[15:37:55] ellcs: has joined #RubyOnRails
[15:40:04] conta: has joined #RubyOnRails
[15:51:47] dblessing: has joined #RubyOnRails
[16:01:14] eckhardt: has joined #RubyOnRails
[16:01:27] orbyt_: has joined #RubyOnRails
[16:04:55] fragamus: has joined #RubyOnRails
[16:08:04] silviu: has joined #RubyOnRails
[16:09:37] roshanavand: has joined #RubyOnRails
[16:10:43] Linuus: has joined #RubyOnRails
[16:15:20] cabotto: has joined #RubyOnRails
[16:17:59] op84: has joined #RubyOnRails
[16:21:16] op84: hey there! whats best practice to save a last_invitation_sent timestamp when a mail gets sent? create an activejob, send the mail with deliver_now and save on after_perform callback?
[16:21:33] alfiemax: has joined #RubyOnRails
[16:22:44] one_zero: has joined #RubyOnRails
[16:23:25] noodle: has joined #RubyOnRails
[16:27:09] eckhardt: has joined #RubyOnRails
[16:35:20] orbyt_: has joined #RubyOnRails
[16:38:20] alfiemax: has joined #RubyOnRails
[16:49:47] Linuus: has joined #RubyOnRails
[16:49:54] Technodrome: has joined #RubyOnRails
[16:50:34] noodle: has joined #RubyOnRails
[16:52:09] LateralOctober: has joined #RubyOnRails
[17:09:40] jottr: has joined #RubyOnRails
[17:30:09] Linuus: has joined #RubyOnRails
[17:33:36] Cavallari: has joined #RubyOnRails
[17:34:14] darkhanb: has joined #RubyOnRails
[17:35:14] KeyJoo: has joined #RubyOnRails
[17:38:08] darkhanb: has joined #RubyOnRails
[17:50:36] dionysus69: has joined #RubyOnRails
[17:57:12] conta: has joined #RubyOnRails
[18:02:45] ellcs: has joined #RubyOnRails
[18:07:47] kapil___: has joined #RubyOnRails
[18:14:02] Linuus: has joined #RubyOnRails
[18:14:10] mondongo: has joined #RubyOnRails
[18:20:59] greengriminal: has joined #RubyOnRails
[18:31:20] conta: has joined #RubyOnRails
[18:38:54] MrPunkin: has joined #RubyOnRails
[18:40:45] mroutis: has joined #RubyOnRails
[18:44:43] MrPunkin: Hey there. We have a contact form that takes UTF info from an HTML form (HTML5 site with proper UTF-8 meta tag in head), stores it via utf-8 into MySQL tables with proper charset and collation, including on the fields, and yet still having some bogus characters causing YAML decoding issues in Delayed::Job. This is just a contact form, so I’m fine removing / santitizing it after input before storing in the DB.
[18:44:44] MrPunkin: anyone suggest a good simple way to sanitize the input to remove any non standard characters that wouldn’t be needed for a contact form?
[18:46:23] rfoust: has joined #RubyOnRails
[18:47:58] Linuus: has joined #RubyOnRails
[18:51:41] atrius: has joined #RubyOnRails
[18:59:25] conta: has joined #RubyOnRails
[19:00:24] voker57: MrPunkin: smth like .encode(undef: :replace, replace: "")
[19:01:09] Linuus: has joined #RubyOnRails
[19:01:57] kapil___: Hello I am existing database. How can I generate models for it?
[19:03:53] NoGodDamnIdea: has joined #RubyOnRails
[19:04:08] voker57: generate model ... --skip-migrations
[19:05:08] kapil___: But I want to auto generate it
[19:09:49] darkhanb: has joined #RubyOnRails
[19:11:04] jottr: has joined #RubyOnRails
[19:12:23] darkhanb: has joined #RubyOnRails
[19:13:33] sameerynho: has joined #RubyOnRails
[19:19:09] jottr: has joined #RubyOnRails
[19:24:22] Linuus: has joined #RubyOnRails
[19:30:27] conta: has joined #RubyOnRails
[19:41:54] dedeqtor: has joined #RubyOnRails
[19:42:21] fragamus: has joined #RubyOnRails
[19:48:45] darkhanb: has joined #RubyOnRails
[20:01:06] Linuus: has joined #RubyOnRails
[20:15:28] kahootbird: has joined #RubyOnRails
[20:17:15] workmad3: has joined #RubyOnRails
[20:23:33] MrPunkin: voker57: I tried this on some of the test data that was causing issues and it didn’t seem to clean it up unfortunately. I’ll try again though
[20:24:48] thomasfedb: has joined #RubyOnRails
[20:25:04] conta: has joined #RubyOnRails
[20:29:38] chouhoulis: has joined #RubyOnRails
[20:32:00] weaksauce: has joined #RubyOnRails
[20:33:44] Linuus: has joined #RubyOnRails
[20:35:17] fragamus: has joined #RubyOnRails
[20:35:24] mroutis: has joined #RubyOnRails
[20:43:36] lord4163: has joined #RubyOnRails
[20:50:48] greengriminal: has joined #RubyOnRails
[20:51:25] schneider: has joined #RubyOnRails
[20:56:11] mroutis: has joined #RubyOnRails
[21:00:45] silviu: has joined #RubyOnRails
[21:01:57] dviola: has joined #RubyOnRails
[21:14:31] fragamus: has joined #RubyOnRails
[21:19:09] conta: has joined #RubyOnRails
[21:45:41] conta: has joined #RubyOnRails
[21:49:57] Linuus: has joined #RubyOnRails
[21:57:31] roshanavand: has joined #RubyOnRails
[22:03:01] weaksauce: has joined #RubyOnRails
[22:05:02] mondongo: has joined #RubyOnRails
[22:06:25] Technodrome: has joined #RubyOnRails
[22:12:52] alfiemax: has joined #RubyOnRails
[22:16:15] workmad3: has joined #RubyOnRails
[22:19:08] darkhanb: has joined #RubyOnRails
[22:23:45] Linuus: has joined #RubyOnRails
[22:26:57] conta: has joined #RubyOnRails
[22:52:03] garyserj: has joined #RubyOnRails
[22:52:07] garyserj: what is a rails serveR?
[23:03:51] Linuus: has joined #RubyOnRails
[23:16:42] shtirlic: has joined #RubyOnRails
[23:20:42] cpruitt: has joined #RubyOnRails
[23:21:21] alfiemax: has joined #RubyOnRails
[23:21:34] conta: has joined #RubyOnRails
[23:33:45] Technodrome: has joined #RubyOnRails
[23:39:35] Linuus: has joined #RubyOnRails
[23:50:45] fragamus: has joined #RubyOnRails
[23:59:51] Technodrome: has joined #RubyOnRails