« Back to channel list

#RubyOnRails - 29 January 2019

« Back 1 day Forward 1 day »
[00:05:34] mikecmpbll: has joined #RubyOnRails
[00:22:03] cnsvc: has joined #RubyOnRails
[00:26:38] jottr: has joined #RubyOnRails
[01:05:47] jottr: has joined #RubyOnRails
[01:41:13] Linuus`: has joined #RubyOnRails
[01:52:31] sevenseacat: has joined #RubyOnRails
[01:54:27] apparition: has joined #RubyOnRails
[01:56:21] brandoncc: has joined #RubyOnRails
[02:12:58] duderonomy: has joined #RubyOnRails
[02:14:57] maryo: has joined #RubyOnRails
[02:17:20] mikecmpbll: has joined #RubyOnRails
[02:22:33] tdy: has joined #RubyOnRails
[02:35:18] tdy: has joined #RubyOnRails
[02:48:59] Jervis_: has joined #RubyOnRails
[03:08:22] Saukk: has joined #RubyOnRails
[03:30:29] brandoncc: has joined #RubyOnRails
[03:43:49] NeXTSUN: has joined #RubyOnRails
[03:58:58] lankanmon: has joined #RubyOnRails
[04:04:34] orbyt_: has joined #RubyOnRails
[04:09:47] braincrash: has joined #RubyOnRails
[04:12:38] Linuus`: has joined #RubyOnRails
[04:22:25] tdy: has joined #RubyOnRails
[04:34:59] Technodrome: has joined #RubyOnRails
[04:49:44] Linuus`: has joined #RubyOnRails
[04:51:19] kapil____: has joined #RubyOnRails
[04:57:18] blackcross: has joined #RubyOnRails
[05:02:12] RiPuk: has joined #RubyOnRails
[05:06:52] jottr: has joined #RubyOnRails
[05:12:39] jottr: has joined #RubyOnRails
[05:38:04] cnsvc: has joined #RubyOnRails
[05:44:28] segy: has joined #RubyOnRails
[05:47:53] Leifr: has joined #RubyOnRails
[05:57:45] dviola: has joined #RubyOnRails
[06:18:22] conta: has joined #RubyOnRails
[06:52:27] Linuus`: has joined #RubyOnRails
[07:12:07] reber: has joined #RubyOnRails
[07:21:40] srinidhi: has joined #RubyOnRails
[07:23:46] ariedler: has joined #RubyOnRails
[07:44:27] FastJack: has joined #RubyOnRails
[07:48:19] za1b1tsu: has joined #RubyOnRails
[07:49:30] tuor: has joined #RubyOnRails
[08:27:21] hadifarnoud: has joined #RubyOnRails
[08:37:35] mikecmpbll: has joined #RubyOnRails
[08:40:01] quazimodo: has joined #RubyOnRails
[08:43:58] hahuang65: has joined #RubyOnRails
[08:44:03] paranoicsan: has joined #RubyOnRails
[08:44:51] hadifarnoud: has joined #RubyOnRails
[08:51:09] blackmesa1: has joined #RubyOnRails
[08:53:34] blackmesa: has joined #RubyOnRails
[08:56:17] LightStalker: has joined #RubyOnRails
[09:04:26] mikecmpbll: has joined #RubyOnRails
[09:19:53] srinidhi: has joined #RubyOnRails
[09:20:33] Linuus`: has joined #RubyOnRails
[09:24:35] ariedler: has joined #RubyOnRails
[09:25:00] conta: has joined #RubyOnRails
[09:45:41] jottr: has joined #RubyOnRails
[09:52:25] Ergo: has joined #RubyOnRails
[09:59:00] paranoicsan: has joined #RubyOnRails
[10:00:05] snuz: has joined #RubyOnRails
[10:00:55] Linuus`: has joined #RubyOnRails
[10:05:07] snuz: has joined #RubyOnRails
[10:06:36] snuz: has joined #RubyOnRails
[10:11:44] liya: what can rails do that django cant
[10:14:08] tbuehlmann: https://pbs.twimg.com/media/Bn8ZYxrIMAIBMG3.png:large
[10:14:35] kapil____: has joined #RubyOnRails
[10:15:58] liya: so the answer is contributors?
[10:17:30] sevenseacat: what can django do that rails can't?
[10:18:44] tbuehlmann: nah, the question is just loaded
[10:20:39] liya: i like ruby.. but college suggests python
[10:21:07] liya: and i chose python while still learning ruby
[10:36:27] liya: has left #RubyOnRails: ("Leaving")
[10:40:38] guyzmo: has joined #RubyOnRails
[10:42:40] guyzmo: instead of doing `Foo.where(id: Bar.all.pluck(:foo_id))` would there be a way I could do `Bar.all.foos` that would be semantically the same, but with a straightforward syntax?
[10:43:14] calaveraDeluxe08: has joined #RubyOnRails
[10:43:45] guyzmo: (my goal being that I want to do that in a `has_many` on `Bar` that would return all foos of current `bar` instance)
[10:48:02] tbuehlmann: I don't understand your second sentence
[10:49:08] tbuehlmann: if it's `Foo.has_many :bars` and you want all foos with associated bars, that'd be an inner join: Foo.joins(:bars)
[10:49:25] tbuehlmann: that might return double foos, so you might want to use a distinct
[10:51:37] guyzmo: damn, my question is ill asked
[10:51:44] guyzmo: let me rephrase it better
[10:53:23] guyzmo: I got a `Mission` that has a prop (has_one) `Location` under the name `destination`. I got a `DeliveryRound` that has a prop (has_many) `Mission` under the name `missions`. In `DeliveryRound` I want to have a list of all `Location` under the attribute name `destinations`
[10:54:30] guyzmo: so now, what I'm doing is a `has_many :destinations, lambda { |dr| Location.where(id: dr.missions.pluck(destination_id)) }, class_name: 'Location'`
[10:54:43] Linuus`: has joined #RubyOnRails
[10:55:24] guyzmo: (I'm writing it as we speak, and I'm about to test that, though I believe it should work fine)
[10:57:46] Guest16678: has joined #RubyOnRails
[10:57:50] guyzmo: but that syntax feels weird to read (not straightforward), and I'm pretty sure it translates to a subquery in SQL. So I'm thinking there should be a more concise way to write the same query, that would translate in SQL to a join
[10:58:39] guyzmo: something that would looks like `dr.missions.destinations` which would return a collection of `Location`
[10:59:31] tbuehlmann: without the renaming this would simply be: `DeliveryRound.has_many :destinations, through: :missions`. so some_delivery_round.destinations would work
[11:00:19] guyzmo: ok, now I feel dumb ☺
[11:01:01] guyzmo: now that you say it, it's obvious… why was I trying to over-complicate things ?
[11:08:36] guyzmo: (and thank you)
[11:08:48] tbuehlmann: you're welcome!
[11:10:51] srinidhi: has joined #RubyOnRails
[11:11:07] snuz: has joined #RubyOnRails
[11:25:43] ariedler: has joined #RubyOnRails
[11:55:07] ariedler: has joined #RubyOnRails
[12:01:19] Kutakizukari: has joined #RubyOnRails
[12:06:20] hadifarnoud: has joined #RubyOnRails
[12:10:21] paranoicsan: has joined #RubyOnRails
[12:14:35] Technodrome: has joined #RubyOnRails
[12:17:27] lankanmon: has joined #RubyOnRails
[12:17:54] Kutakizukari: has joined #RubyOnRails
[12:49:24] Kutakizukari: has joined #RubyOnRails
[12:51:52] blackmesa: has joined #RubyOnRails
[12:55:36] Kutakizukari: has joined #RubyOnRails
[13:13:04] dviola: has joined #RubyOnRails
[13:18:44] Kamuela: I'm using puma-dev and wondering... how can I see the logs I'd get if I were running `rails server`?
[13:19:29] Kamuela: I'd also be open to a more fruitful development workflow, currently using RubyMine if that helps
[13:27:42] beholders_eye: has joined #RubyOnRails
[13:27:57] cgfbee: has joined #RubyOnRails
[13:32:36] s2013: has joined #RubyOnRails
[13:42:44] Leifr: has joined #RubyOnRails
[13:44:02] duderonomy: has joined #RubyOnRails
[13:48:16] amperry: has joined #RubyOnRails
[13:50:14] amperry: hi folks, anyone be able to help me locate why I'm getting an ActionView::Template::Error (wrong number of arguments) when neither the message nor anything I can find in the logs says *where* this is happening?
[13:50:29] amperry: gist here: https://gist.github.com/amp108/d9974d66ebad780b10d920373303bca3
[13:51:36] amperry: and, just to be certain, is anyone else awake in here?
[13:55:56] tbuehlmann: I don't see anything suspicious
[13:56:57] amperry: is there a way to force ActionView::Template::Error to be more verbose?
[13:57:29] sevenseacat: can you gist the full error?
[13:58:48] amperry: I can, but also here, the entire text of the error: "An error of type ActionView::Template::Error happened; message is: wrong number of arguments (given 2, expected 0)."
[13:59:15] amperry: come to think of it, that is in the gist
[13:59:15] sevenseacat: the full error comes with a backtrace
[13:59:37] amperry: you'd think that, wouldn't you?
[13:59:53] sevenseacat: please add it to the gist :)
[14:00:08] amperry: but it isn't doing that; what I have is the entire text of everything it's telling me.
[14:00:17] amperry: a pdf renders with a header, and that message
[14:00:21] sevenseacat: in your development log?
[14:00:44] amperry: nothing I can see
[14:06:39] amperry: I was hoping someone would see the wkhtmtopdf part and say "oh, yeah, wkhtmtopdf always does that because <reason>"
[14:07:47] sevenseacat: if we did, it would be because we googled the error and found the problem
[14:08:10] amperry: me no google magic on this one
[14:10:50] tuor: has joined #RubyOnRails
[14:21:38] jgpawletko: has joined #RubyOnRails
[14:27:47] ramfjord: has joined #RubyOnRails
[14:28:41] ramfjord: I've just been reading up on the new rails 5 credentials, which is actually kind of nice and should prevent us from having to use vault for some stuff. I'm curious though - why not encrypt the DB credentials as well? Why keep them in config/database.yml?
[14:30:38] ramfjord: s/credentials/secrets
[14:36:49] tdy: has joined #RubyOnRails
[14:37:51] za1b1tsu: has joined #RubyOnRails
[14:41:39] Dbugger: has joined #RubyOnRails
[14:58:16] srinidhi: has joined #RubyOnRails
[14:58:53] KeyJoo: has joined #RubyOnRails
[15:13:12] alan_w: has joined #RubyOnRails
[15:22:54] Karunamon: has left #RubyOnRails: ()
[15:39:15] DTZUZO_: has joined #RubyOnRails
[15:45:17] s2013: has joined #RubyOnRails
[16:08:45] brandoncc: has joined #RubyOnRails
[16:11:43] brandoncc: has joined #RubyOnRails
[16:27:14] IGnorAND: Is it possible to edit a model (by means of a form, PUT via js or something) without allowing one to edit a certain field?
[16:27:56] conta: has joined #RubyOnRails
[16:30:32] IGnorAND: aah, I think I figured it out, use a params.require(:model).permit() for the update
[16:31:31] snuz: has joined #RubyOnRails
[16:34:58] hammer065: has joined #RubyOnRails
[16:46:23] maryo: has joined #RubyOnRails
[16:53:37] gambl0r3: has joined #RubyOnRails
[16:53:45] bruce_lee: has joined #RubyOnRails
[16:54:54] s2013: has joined #RubyOnRails
[16:56:28] orbyt_: has joined #RubyOnRails
[17:03:47] Cavallari: has joined #RubyOnRails
[17:15:52] orbyt_: has joined #RubyOnRails
[17:19:14] maryo: has joined #RubyOnRails
[17:26:24] brandoncc: has joined #RubyOnRails
[17:48:55] maryo: has joined #RubyOnRails
[17:50:52] guyzmo: has joined #RubyOnRails
[17:50:53] orbyt_: has joined #RubyOnRails
[17:57:01] lxsameer: has joined #RubyOnRails
[18:04:49] maryo_: has joined #RubyOnRails
[18:12:29] Net: say I have User.create(user_params) and I want to add :company => company to the parameters user will be created with. What's the cleanest way to do this?
[18:15:28] gambl0r3: has joined #RubyOnRails
[18:16:54] s2013: has joined #RubyOnRails
[18:19:41] mikecmpbll: has joined #RubyOnRails
[18:19:48] Net: in other words: is there a better way to write User.create(user_params.merge({company: company}))
[18:20:19] conta: has joined #RubyOnRails
[18:35:01] kapil____: has joined #RubyOnRails
[18:36:10] defsdoor: has joined #RubyOnRails
[18:43:04] bijan_: has joined #RubyOnRails
[18:51:00] havenwood: Net: That looks good to me.
[18:51:45] Net: havenwood: thanks, I was hoping there was some syntactic sugar for this
[18:52:11] havenwood: Net: You can drop the {}s
[18:52:28] havenwood: Net: User.create user_params.merge company: company
[18:58:01] tdy: has joined #RubyOnRails
[19:01:58] srinidhi: has joined #RubyOnRails
[19:19:16] ellcs: has joined #RubyOnRails
[19:23:52] beingjohnm: tests failing today with Time.now + 1.month. Question is do I ignore or rework the code so it passes?
[19:32:41] conta: has joined #RubyOnRails
[19:36:14] reber: has joined #RubyOnRails
[19:38:39] ravenousmoose: has joined #RubyOnRails
[19:40:27] hadifarnoud: has joined #RubyOnRails
[19:49:18] Linuus`: has joined #RubyOnRails
[19:54:19] ivanskie: has joined #RubyOnRails
[19:58:18] Technodrome: has joined #RubyOnRails
[20:03:57] cnsvc: has joined #RubyOnRails
[20:04:17] ariedler: has joined #RubyOnRails
[20:05:07] hadifarnoud: has joined #RubyOnRails
[20:13:13] conta: has joined #RubyOnRails
[20:14:00] havenwood: beingjohnm: Why's it failing?
[20:14:37] roshanavand: has joined #RubyOnRails
[20:15:26] havenwood: beingjohnm: Do you really not want a time zone?
[20:15:56] havenwood: beingjohnm: Consider `1.month.from_now` or its equivalent `Time.current.advance(months: 1)`.
[20:37:25] istrasci: has joined #RubyOnRails
[20:37:46] istrasci: Is there any way in the Rails console to only show what SQL would be generated but not actually execute it?
[20:42:42] havenwood: istrasci: #to_sql
[20:44:42] hadifarnoud: has joined #RubyOnRails
[20:45:27] ellcs: has joined #RubyOnRails
[20:45:41] istrasci: havenwood: Like MyModel.where(active: true).to_sql ? Or do I need to make the command a string first?
[20:46:32] havenwood: istrasci: Just like that. Try in rails console.
[20:48:23] blackmesa: HI havenwood
[20:48:30] havenwood: blackmesa: hi o/
[20:49:06] istrasci: havenwood: Works for that query, but not for a MyModel.find(1). Where is that method defined?
[20:52:18] havenwood: istrasci: You can ask it where it's defined: MyModel.method(:find).source_location
[20:53:47] aidanh010: has joined #RubyOnRails
[20:58:29] fcser_: has joined #RubyOnRails
[20:58:58] istrasci: havenwood: Ah, thanks. Didn't know of that introspection.
[21:07:07] _aeris: has joined #RubyOnRails
[21:12:59] hadifarnoud: has joined #RubyOnRails
[21:14:16] Radar: istrasci: it doesn't work for MyModel.find(1) because that is returning an instance of the model. The equivalent SQL would probably be: MyModel.where(id: 1).limit(1)
[21:14:21] Radar: then .to_sql on the end of that
[21:18:28] blackmesa: has joined #RubyOnRails
[21:29:02] blackmesa1: has joined #RubyOnRails
[21:44:51] segy: has joined #RubyOnRails
[21:44:54] Kutakizukari: has joined #RubyOnRails
[21:48:21] srinidhi: has joined #RubyOnRails
[21:49:19] roshanavand: has joined #RubyOnRails
[21:50:54] Fernando-Basso: has joined #RubyOnRails
[21:59:14] beingjohnm: havenwood: I think it is failing as it is setting the date for one month from now and then checking the month between dates. Typically that would return one and now I think it is returning zero.
[22:04:51] ariedler: has joined #RubyOnRails
[22:04:59] duderonomy: has joined #RubyOnRails
[22:06:28] segy: has joined #RubyOnRails
[22:14:46] dviola: has joined #RubyOnRails
[22:23:33] helpa: has joined #RubyOnRails
[22:26:51] kapil____: has joined #RubyOnRails
[22:27:09] ramfjord: has joined #RubyOnRails
[22:28:28] DTZUZO: has joined #RubyOnRails
[22:35:01] someish: has joined #RubyOnRails
[22:35:19] someish: has left #RubyOnRails: ()
[22:38:14] s2013: has joined #RubyOnRails
[22:45:43] NoGodDamnIdea: has joined #RubyOnRails
[22:49:48] NeXTSUN: has joined #RubyOnRails
[23:02:01] ur5us: has joined #RubyOnRails
[23:06:04] ravenousmoose: has joined #RubyOnRails
[23:14:08] tdy: has joined #RubyOnRails
[23:17:18] mat_bug: has joined #RubyOnRails
[23:29:22] ramfjord: has joined #RubyOnRails
[23:36:16] s2013: has joined #RubyOnRails
[23:36:42] FernandoBasso: has joined #RubyOnRails
[23:45:06] planigan: has joined #RubyOnRails
[23:48:09] mat_bug: has joined #RubyOnRails