« Back to channel list

#RubyOnRails - 12 November 2018

« Back 1 day Forward 1 day »
[00:08:43] agent_white: has joined #RubyOnRails
[00:59:49] sevenseacat: has joined #RubyOnRails
[01:07:00] mlt-: has joined #RubyOnRails
[01:25:03] sevenseacat: has joined #RubyOnRails
[01:53:05] davidh38: has joined #RubyOnRails
[01:58:41] uks: has joined #RubyOnRails
[03:30:05] Saukk: has joined #RubyOnRails
[04:08:32] braincrash: has joined #RubyOnRails
[04:23:08] roshanavand: has joined #RubyOnRails
[04:26:12] elcontrastador: Radar: Shrine is pimp..thx. Working bitchin'
[04:41:48] Radar: elcontrastador: :D
[04:52:35] jetchisel: has joined #RubyOnRails
[04:53:14] mlt-: has joined #RubyOnRails
[05:09:02] orpl: has joined #RubyOnRails
[05:20:29] kapil____: has joined #RubyOnRails
[05:31:26] MoritaShinobu: has joined #RubyOnRails
[06:09:01] tdy: has joined #RubyOnRails
[06:11:38] srinidhi: has joined #RubyOnRails
[06:22:01] conta: has joined #RubyOnRails
[06:30:13] roshanavand: has joined #RubyOnRails
[06:40:07] za1b1tsu: has joined #RubyOnRails
[06:55:37] mangold: has joined #RubyOnRails
[06:59:04] dionysus69: has joined #RubyOnRails
[07:26:57] voolik: has joined #RubyOnRails
[07:42:17] eckhardt: has joined #RubyOnRails
[07:43:44] mangold: has joined #RubyOnRails
[08:18:57] srinidhi: has joined #RubyOnRails
[08:28:09] lexileo: has joined #RubyOnRails
[08:31:18] roshanavand: has joined #RubyOnRails
[08:31:32] jsc: has joined #RubyOnRails
[08:35:35] whysthatso: has joined #RubyOnRails
[08:39:55] ur5us: has joined #RubyOnRails
[08:41:14] OrangeManBad: has joined #RubyOnRails
[08:42:36] roshanavand: has joined #RubyOnRails
[08:51:40] Guest53511: has joined #RubyOnRails
[09:02:38] MoritaShinobu: has joined #RubyOnRails
[09:09:37] mikecmpbll: has joined #RubyOnRails
[09:22:17] davidh38: has joined #RubyOnRails
[09:38:17] Ergo^: has joined #RubyOnRails
[09:49:48] lomex: has joined #RubyOnRails
[10:23:36] roshanavand: has joined #RubyOnRails
[10:40:05] JamieD: has joined #RubyOnRails
[10:50:54] ur5us: has joined #RubyOnRails
[10:54:52] kapil____: has joined #RubyOnRails
[10:59:28] hadifarnoud: has joined #RubyOnRails
[11:02:24] gavit: has joined #RubyOnRails
[11:10:44] apparition: has joined #RubyOnRails
[11:18:11] pavelz: has joined #RubyOnRails
[11:18:45] pavelz: hello, anyone knows what is the difference between coffee-script-source 1.10 and 1.12
[11:19:31] pavelz: when I upgrade turbolinks, that gem is also upgraded and I get execJS errors on image_tag and other parts of templates
[11:23:48] davidh38: has joined #RubyOnRails
[11:26:03] OrangeManBad: has joined #RubyOnRails
[11:27:17] davidh38: has joined #RubyOnRails
[11:44:10] conta: has joined #RubyOnRails
[11:52:35] jetchisel: has joined #RubyOnRails
[11:53:33] davidh38: has joined #RubyOnRails
[12:00:21] dionysus69: How are assets treated in production containerized environment? do I have different container for supplying assets or every pod has its own copy of assets precompiled within the app pod itself?
[12:03:57] lomex: has joined #RubyOnRails
[12:04:12] lankanmon: has joined #RubyOnRails
[12:09:22] tmm88: has joined #RubyOnRails
[12:18:17] hadifarnoud: has joined #RubyOnRails
[12:28:46] lomex: has joined #RubyOnRails
[12:40:57] roshanavand: has joined #RubyOnRails
[13:03:48] roshanavand: has joined #RubyOnRails
[13:05:07] lomex: has joined #RubyOnRails
[13:10:43] srinidhi: has joined #RubyOnRails
[13:11:26] CGibsonmm: has joined #RubyOnRails
[13:14:56] CGibsonmm: Question about the differences between pg on production and sqlite on local/dev, Its seems that local rails is building record associations but my production app and database all my through associations return empty arrays
[13:25:23] roshanavand: has joined #RubyOnRails
[13:33:35] kapil____: has joined #RubyOnRails
[13:35:32] roshanavand: has joined #RubyOnRails
[13:38:31] uks: has joined #RubyOnRails
[13:49:12] roshanavand: has joined #RubyOnRails
[14:12:06] roshanavand: has joined #RubyOnRails
[14:27:55] brendan-: has joined #RubyOnRails
[14:43:18] shenghi: has joined #RubyOnRails
[15:00:01] Jervis_: has joined #RubyOnRails
[15:00:37] maryo: has joined #RubyOnRails
[15:14:38] greengriminal: has joined #RubyOnRails
[15:15:16] jetchisel: has joined #RubyOnRails
[15:18:29] davidh38: has joined #RubyOnRails
[15:19:33] roshanavand: has joined #RubyOnRails
[15:39:45] roshanavand: has joined #RubyOnRails
[15:40:02] conta: has joined #RubyOnRails
[16:06:01] za1b1tsu: Anyone using an equivalent of pox on Linux?
[16:08:24] Aces1up: has joined #RubyOnRails
[16:09:00] Aces1up: hey all maybe someone can assist me here. have the following post on stack exchange https://stackoverflow.com/questions/53265793/determine-if-current-time-falls-within-time-ranges-if-not-find-what-the-next-o
[16:09:16] Aces1up: Determine if Current time falls within time ranges.. If not find what the next open window is
[16:09:26] Aces1up: not sure where to start
[16:11:07] whysthatso: has joined #RubyOnRails
[16:15:35] roshanavand: has joined #RubyOnRails
[16:18:55] tdy: has joined #RubyOnRails
[16:21:59] davidh38: has joined #RubyOnRails
[16:33:05] davidh38: has joined #RubyOnRails
[16:34:24] chouhoulis: has joined #RubyOnRails
[16:34:59] vedu_: has joined #RubyOnRails
[16:37:12] davidh38: has joined #RubyOnRails
[16:41:35] roshanavand: has joined #RubyOnRails
[16:42:55] davidh38: has joined #RubyOnRails
[16:45:54] hadifarnoud: has joined #RubyOnRails
[16:46:52] eckhardt: has joined #RubyOnRails
[16:48:55] snowy: has joined #RubyOnRails
[16:49:33] Dbugger: has joined #RubyOnRails
[16:58:55] lxsameer: has joined #RubyOnRails
[17:01:33] borodin: has joined #RubyOnRails
[17:03:12] hadifarnoud: has joined #RubyOnRails
[17:06:59] Saukk: has joined #RubyOnRails
[17:13:38] greengriminal: has joined #RubyOnRails
[17:18:21] darkhanb: has joined #RubyOnRails
[17:18:59] hnanon: has joined #RubyOnRails
[17:20:42] davidh38: has joined #RubyOnRails
[17:24:49] hnanon: I have this line in a VariantOption model: attribute :option_name
[17:25:01] hnanon: It's using the new 5.2 attributes api.
[17:25:07] snowy: has joined #RubyOnRails
[17:25:44] hnanon: In my Variants controller I have @options.each { |name, id| @variant.variant_options.build(option_name: name, option_id: id) }
[17:26:10] hnanon: So, with that, I'm assuming I should be able to access the option name with :option_name.
[17:26:37] hnanon: However, when I do:
[17:26:55] hnanon: <%= variant_option.text_field :value, placeholder: :option_name %>
[17:27:17] hnanon: The placeholder text is only "Option name," without the the actual name of the option.
[17:27:21] hnanon: Any ideas?
[17:27:51] agent_white: has joined #RubyOnRails
[17:28:57] hnanon: :option_id does indeed show the actual option id.
[17:29:31] hnanon: Why does :option_name not show the option name?
[17:31:09] hnanon: Doing @options.each { |name, id| puts name+id.to_s } does print both the name and id so I know that name is present.
[17:43:31] za1b1tsu: anyone using puma-dev on linux?
[17:58:28] hnanon: Finally, after all last night and this morning...I had to do: placeholder: variant_option.object.option_name
[17:58:38] hnanon: That "object" was key.
[17:58:54] hnanon: Is that documented anywhere (the use of "object").
[18:05:41] reber: has joined #RubyOnRails
[18:18:38] srinidhi: has joined #RubyOnRails
[18:23:46] za1b1tsu: any dev on linux?
[18:28:59] davidh38: has joined #RubyOnRails
[18:39:42] conta: has joined #RubyOnRails
[18:41:20] orbyt_: has joined #RubyOnRails
[18:49:25] gambl0re: has joined #RubyOnRails
[18:51:03] ur5us: has joined #RubyOnRails
[19:19:43] davidh38: has joined #RubyOnRails
[19:23:31] kapil____: has joined #RubyOnRails
[19:36:08] ur5us: has joined #RubyOnRails
[19:40:07] hightower3: has joined #RubyOnRails
[19:52:08] hnanon: has joined #RubyOnRails
[20:12:59] davidh38: has joined #RubyOnRails
[20:47:15] davidh38: has joined #RubyOnRails
[21:10:05] CGibsonmm: has joined #RubyOnRails
[21:13:00] davidh38: has joined #RubyOnRails
[21:15:33] davidh38: has joined #RubyOnRails
[21:19:12] matcouto: has joined #RubyOnRails
[21:19:13] CGibsonmm: Question about the differences between pg on production and sqlite on local/dev, Its seems that local rails is building record associations but my production app and database all my through associations return empty arrays, What am I missing?
[21:20:24] matcouto: Is it possible to create a Rails 5 Engine inside a Rails 4.2 host app?
[21:21:40] davidh38: has joined #RubyOnRails
[21:22:01] CGibsonmm: say I search user.forum_posts which forum_post belongs_to user and belongs_to forum_thread and user has_many on both post and thread
[21:22:20] CGibsonmm: It will return an empty array
[21:25:34] Radar: matcouto: nope. All Rails versions must be the same.
[21:25:47] Radar: cgibsonmm: my guess: you're missing data
[21:25:55] matcouto: @Radar cheers
[21:26:21] Radar: cgibsonmm: How would you go about proving that I'm wrong? ;)
[21:27:05] CGibsonmm: LOL, so basically my data got mad at its mom, packed it's bags and ran away?
[21:27:11] Radar: cgibsonmm: yup.
[21:27:39] Radar: cgibsonmm: Computers don't lie. If it's returning an empty array, it's probably because user.forum_posts is doing a query like "SELECT * from forum_posts where user_id = 1" and that's returning an empty data set.
[21:27:40] CGibsonmm: 8:00 pm bed time ruins everything...
[21:27:56] Radar: cgibsonmm: So can you say -- for certain -- that there is definitely forum posts in your database for that user?
[21:28:20] CGibsonmm: yes for certin
[21:28:27] Radar: cgibsonmm: And how are you knowing that?
[21:28:37] Radar: cgibsonmm: Show me a record that exists for that query.
[21:29:07] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[21:30:29] davidh38: has joined #RubyOnRails
[21:31:04] OrangeManBad: has joined #RubyOnRails
[21:31:26] krawchyk: has joined #RubyOnRails
[21:33:52] CGibsonmm: https://gist.github.com/cgibsonmm/449d20c2cf1525fadcda937b39800068
[21:34:18] CGibsonmm: I have "For Certain" forum_posts on my production server
[21:35:04] Radar: cgibsonmm: Are they using the same data?
[21:35:16] CGibsonmm: It's seem to be working intermittently say I search a diffrent user It will return the correct array,
[21:36:06] Radar: cgibsonmm: ForumPost.find_by_sql("SELECT * FROM forum_posts where user_id = '1'")
[21:36:13] Radar: What does that give you back?
[21:36:17] Radar: On production, not local.
[21:36:44] CGibsonmm: The correct array.
[21:37:26] Radar: cgibsonmm: You see all the correct posts?
[21:37:44] chouhoulis: has joined #RubyOnRails
[21:37:54] Radar: cgibsonmm: What is `user.forum_posts.to_sql` showing?
[21:38:09] Radar: Is it that big long join query?
[21:39:00] CGibsonmm: yeah updated the gist https://gist.github.com/cgibsonmm/449d20c2cf1525fadcda937b39800068
[21:39:28] Radar: Thanks :D
[21:39:57] Radar: Ok, I suspect this is happening because of that join. If a record along the "join chain" is missing, then you'll be seeing the behaviour that you're seeing.
[21:40:18] Radar: cgibsonmm: So to track down why this is happening, we'll need to go from post and along the join chain, verifying that all the expected records are there.
[21:40:51] Radar: cgibsonmm: Also, the end of your query says forum_categories.user_id = 1... is that intentional?
[21:41:12] Radar: I would think that should be forum_posts.user_id =1
[21:41:52] davidh38: has joined #RubyOnRails
[21:42:27] Radar: Going back to that first hypothesis: I would find a single post from the find_by_sql result, verify that its thread exists. Then that the thread's forum + category exists. If you can do that, then you can rule out the join being the cause.
[21:42:31] CGibsonmm: so full is chain categories > topic > thread > post
[21:42:47] Radar: So two possibilities: 1) something along the join chain is missing 2) that forum_categories.user_id = 1 is wrong.
[21:44:35] CGibsonmm: hhhhm, when I originally built the association I never put a user_id column in the categories du to the fact that only admin would create them any way
[21:45:05] Radar: Right. Your query is expecting the category to have a user_id set to 1. So if that's not the case, then your query is going to fail.
[21:45:10] CGibsonmm: I can go back add the column and add the id to all
[21:45:14] davidh38: has joined #RubyOnRails
[21:45:19] Radar: If you don't have user_id set on the category then I would count that as missing data ;)
[21:45:35] CGibsonmm: haha! thanks
[21:46:27] Radar: np :) This was fun!
[21:46:55] CGibsonmm: So aside from the fact that I am going to just add a column and add my user id to all, will that have any other sideeffects?
[21:49:17] Radar: cgibsonmm: Adding a column? forum_categories doesn't already have user_id?
[21:49:24] davidh38: has joined #RubyOnRails
[21:49:41] Radar: cgibsonmm: I'm finding it weird that forum_posts isn't scoping the find by forum_posts.user_id, but seemingly instead by forum_categories.user_id.
[21:50:23] CGibsonmm: wait I just checked my schema and yes categories does have a user_id
[21:51:02] CGibsonmm: I will add my schema to the gist
[21:51:52] davidh38: has joined #RubyOnRails
[21:52:33] Radar: cgibsonmm: can you show me how the forum_posts association is defined on users?
[21:52:34] Radar: in the model
[21:54:41] Radar: I'm going to be changing trains in a minute, so I'll be offline for about 15-20 mins
[21:56:17] CGibsonmm: okay, sounds good
[22:01:02] eckhardt_: has joined #RubyOnRails
[22:18:05] davidh38: has joined #RubyOnRails
[22:20:05] Fernando-Basso: has joined #RubyOnRails
[22:27:32] lexileo: has joined #RubyOnRails
[22:41:52] wethu: has joined #RubyOnRails
[22:42:35] andrewalso: has joined #RubyOnRails
[22:45:17] andrewalso: hello all, im trying to understand memory usage in resque-web. does the memory used by resque-web as get used by the workers? in my setup the workers and resque-web are all on different servers but resque-web is using over 20GB of ram. That seems extremly high to me. The original devs for this app are long gone and I just inherited it so trying to understand if what i am seeing is normal
[23:11:48] dviola: has joined #RubyOnRails
[23:25:17] OrangeManBad: has joined #RubyOnRails
[23:28:05] davidh38: has joined #RubyOnRails
[23:31:18] Radar: cgibsonmm: how's that association defined in the model?
[23:32:27] CGibsonmm: https://gist.github.com/cgibsonmm/449d20c2cf1525fadcda937b39800068/edit
[23:32:36] CGibsonmm: ... minus the edit
[23:33:02] mlt-: has joined #RubyOnRails
[23:33:05] Radar: cgibsonmm: missing the user model?
[23:36:59] OrangeManBad: has joined #RubyOnRails
[23:38:12] NpcOrangeManBad: has joined #RubyOnRails
[23:41:36] hnanon: has joined #RubyOnRails
[23:45:21] CGibsonmm: Radar updated it
[23:47:19] Radar: cgibsonmm: taking a look
[23:47:35] Radar: https://gist.github.com/cgibsonmm/449d20c2cf1525fadcda937b39800068#file-user-rb-L1
[23:47:37] Radar: cgibsonmm: two arrows?
[23:48:02] Radar: Association seems fine. I don't know why it's putting user_id as a condition on forum_categories still
[23:48:10] CGibsonmm: Sorry that was just a typo in the gist
[23:50:48] CGibsonmm: Radar: in my categories create method I am calling @category = current_user.forum_categories.builds(create_params), I don't think that has anything to do with the Query but just letting you know how that is done
[23:51:32] Radar: cgibsonmm: right. That seems fine .
[23:51:50] Radar: my best guess is that it's a bug in Rails due to the many levels of has_many :through
[23:52:00] Radar: it's finding the first table with a user_id field and using that instead.
[23:52:53] Radar: cgibsonmm: I don't understand why the association for forum_posts on users isn't simply has_many :forum_posts. Why does it have to go through thread?
[23:53:08] Radar: cgibsonmm: you have a belongs_to :user on ForumPost, which would indicate to me that it has a user_id field there.
[23:54:01] CGibsonmm: Okay trying the change, to see
[23:55:25] CGibsonmm: that may make the diff I ran the user.forum_posts.to_sql and it returned "SELECT \"forum_posts\".* FROM \"forum_posts\" WHERE \"forum_posts\".\"user_id\" = 1"
[23:56:34] Radar: Yes, that's better.
[23:56:39] Radar: That should return the right posts for the users.
[23:57:23] CGibsonmm: Okay I am trying in production now