« Back to channel list

#RubyOnRails - 16 February 2016

« Back 1 day Forward 1 day »
[00:06:12] roreeee: has joined #RubyOnRails
[00:06:25] blackmesa: has joined #RubyOnRails
[00:06:35] triptec: has joined #RubyOnRails
[00:09:47] kirillzh: has joined #RubyOnRails
[00:11:09] Technodrome: has joined #RubyOnRails
[00:11:32] Technodrome: any blog engine worth using? or just roll my own little blog thing?
[00:12:28] intrigueD: has joined #RubyOnRails
[00:12:56] judetucker: has joined #RubyOnRails
[00:13:05] judetucker: has left #RubyOnRails: ()
[00:13:49] _Tariq: has joined #RubyOnRails
[00:13:52] deadlock: has joined #RubyOnRails
[00:17:00] ur5us: has joined #RubyOnRails
[00:20:24] Radar: Technodrome: Jekyll is what I use for ryanbigg.com
[00:20:24] Devalo: has joined #RubyOnRails
[00:20:33] Radar: Technodrome: https://github.com/radar/ryanbigg.com source is there
[00:20:55] Radar: It handles hundreds of requests a day
[00:22:36] SteenJobs: if my create action is processing as JSON, what???s the syntax to redirect to a different controller???s action/view upon a successful save?
[00:24:47] askhat: has joined #RubyOnRails
[00:25:25] kirillzh: has joined #RubyOnRails
[00:25:28] Pazician: has joined #RubyOnRails
[00:26:20] ss_much: has joined #RubyOnRails
[00:26:49] kirillzh: has joined #RubyOnRails
[00:28:52] nickjj: has joined #RubyOnRails
[00:29:57] jfelchner: has joined #RubyOnRails
[00:30:14] ElFerna_: has joined #RubyOnRails
[00:31:32] mwcmitchell: has joined #RubyOnRails
[00:31:51] macsteps: has joined #RubyOnRails
[00:36:33] maesitos: has joined #RubyOnRails
[00:38:07] sinkensabe: has joined #RubyOnRails
[00:39:15] roshanavand: has joined #RubyOnRails
[00:39:38] Technodrome: Radar sure, but I was thinking maybe something powered by a db
[00:39:43] Radar: Technodrome: why
[00:39:59] Technodrome: i definitely respect the generators though
[00:40:18] Technodrome: well, i was just going to let the blogging people use the active admin thing and input that there to make it simple
[00:40:26] Technodrome: rather than getting them access to the file system
[00:41:57] railsFor_: @ruurd thanks man worked out
[00:43:34] ElFerna_: has joined #RubyOnRails
[00:43:54] Scriptonaut: has left #RubyOnRails: ()
[00:44:39] nogic: has joined #RubyOnRails
[00:45:23] nogic: has joined #RubyOnRails
[00:46:03] nogic: has joined #RubyOnRails
[00:50:03] Radar: Technodrome: why do you need a database?
[00:50:06] SteenJobs: has joined #RubyOnRails
[00:50:23] Technodrome: it seems like all the other solutions require the people to write down markdown files or something
[00:56:15] Technodrome: maybe i can ask them if they are comfortable with writing markdown files and uploading via git Radar ? Only issue is they are used to Drupal so some sort of an interface
[00:56:37] Radar: Technodrome: Perhaps https://ghost.org/?
[00:56:49] DLSteve: has joined #RubyOnRails
[00:56:57] Technodrome: isn't that php?
[00:57:34] Radar: Mostly JS
[00:57:35] Radar: https://github.com/TryGhost/Ghost
[00:57:52] Radar: However, they have a hosted version of it.
[00:58:04] jtong: has joined #RubyOnRails
[00:58:47] hardtail: has joined #RubyOnRails
[00:59:02] hardtail: has joined #RubyOnRails
[00:59:05] Radar: For instance, I just set this up with no fuss: http://ryanbigg.ghost.io/
[01:00:35] rgtk: has joined #RubyOnRails
[01:00:38] maesitos: has joined #RubyOnRails
[01:02:30] maesitos_: has joined #RubyOnRails
[01:02:54] flappynerd: has joined #RubyOnRails
[01:04:21] maesitos: has joined #RubyOnRails
[01:04:51] rgtk_: has joined #RubyOnRails
[01:06:16] maesitos: has joined #RubyOnRails
[01:06:26] sevenseacat: has joined #RubyOnRails
[01:06:55] rgtk: has joined #RubyOnRails
[01:07:23] bklane: has joined #RubyOnRails
[01:08:10] maesitos: has joined #RubyOnRails
[01:08:45] rgtk: has joined #RubyOnRails
[01:10:05] maesitos: has joined #RubyOnRails
[01:10:50] rgtk: has joined #RubyOnRails
[01:11:56] maesitos: has joined #RubyOnRails
[01:12:07] stannard: has joined #RubyOnRails
[01:12:36] rgtk: has joined #RubyOnRails
[01:12:42] slash_nick: that's not bad lookin'
[01:13:33] pawnbox: has joined #RubyOnRails
[01:13:51] maesitos: has joined #RubyOnRails
[01:14:25] rgtk: has joined #RubyOnRails
[01:15:06] triptec: has joined #RubyOnRails
[01:15:25] nickjj: has joined #RubyOnRails
[01:15:48] paradisaeidae: has joined #RubyOnRails
[01:15:48] maesitos_: has joined #RubyOnRails
[01:16:20] rgtk: has joined #RubyOnRails
[01:17:40] maesitos: has joined #RubyOnRails
[01:18:15] rgtk: has joined #RubyOnRails
[01:19:34] maesitos: has joined #RubyOnRails
[01:20:05] rgtk_: has joined #RubyOnRails
[01:21:27] maesitos: has joined #RubyOnRails
[01:22:00] rgtk: has joined #RubyOnRails
[01:23:23] maesitos: has joined #RubyOnRails
[01:23:45] rgtk: has joined #RubyOnRails
[01:24:23] bklane_: has joined #RubyOnRails
[01:25:15] maesitos: has joined #RubyOnRails
[01:25:45] rgtk: has joined #RubyOnRails
[01:25:58] jtong: has joined #RubyOnRails
[01:26:47] ur5us: has joined #RubyOnRails
[01:27:09] maesitos: has joined #RubyOnRails
[01:27:40] rgtk: has joined #RubyOnRails
[01:27:56] nickjj: has joined #RubyOnRails
[01:29:03] maesitos: has joined #RubyOnRails
[01:29:33] rgtk: has joined #RubyOnRails
[01:30:55] maesitos: has joined #RubyOnRails
[01:31:12] kirillzh: has joined #RubyOnRails
[01:31:18] rgtk: has joined #RubyOnRails
[01:31:53] sinkensabe: has joined #RubyOnRails
[01:32:50] maesitos_: has joined #RubyOnRails
[01:33:30] floror: has joined #RubyOnRails
[01:34:43] maesitos: has joined #RubyOnRails
[01:35:26] rgtk: has joined #RubyOnRails
[01:35:57] floror: has left #RubyOnRails: ()
[01:36:06] Coldblackice: has joined #RubyOnRails
[01:36:23] bklane: has joined #RubyOnRails
[01:36:26] floror: has joined #RubyOnRails
[01:36:36] maesitos: has joined #RubyOnRails
[01:37:26] rgtk: has joined #RubyOnRails
[01:37:41] floror: has left #RubyOnRails: ()
[01:38:18] floror: has joined #RubyOnRails
[01:38:31] maesitos: has joined #RubyOnRails
[01:38:44] floror: has left #RubyOnRails: ()
[01:39:05] floror: has joined #RubyOnRails
[01:39:21] rgtk: has joined #RubyOnRails
[01:39:58] nerium: has joined #RubyOnRails
[01:40:37] maesitos: has joined #RubyOnRails
[01:40:57] triptec: has joined #RubyOnRails
[01:41:02] baweaver: has joined #RubyOnRails
[01:41:16] rgtk: has joined #RubyOnRails
[01:42:16] maesitos: has joined #RubyOnRails
[01:43:11] rgtk: has joined #RubyOnRails
[01:43:24] nerium: has joined #RubyOnRails
[01:44:01] someish: has joined #RubyOnRails
[01:44:12] maesitos: has joined #RubyOnRails
[01:44:19] nerium: Is there a way to figure out what url helper is being used for a certain url in the browser, directly in the browser?
[01:44:50] nerium: So if I am at the index path I want it to say ???root_path"
[01:45:01] rgtk: has joined #RubyOnRails
[01:45:57] nickjj: has joined #RubyOnRails
[01:46:09] maesitos: has joined #RubyOnRails
[01:46:58] rgtk: has joined #RubyOnRails
[01:47:46] tjbiddle: has joined #RubyOnRails
[01:48:01] maesitos: has joined #RubyOnRails
[01:48:42] tjbiddle: Hey all - I currently have a helper method for formatting a string (Turns phone number 12345678abc90 into +1234567890) - I use this whenever I call .where or .find and am passing in a phone number. Is there a cleaner area to put this method, or would this be the best practice?
[01:49:01] rgtk: has joined #RubyOnRails
[01:49:44] bklane_: has joined #RubyOnRails
[01:49:54] maesitos: has joined #RubyOnRails
[01:50:43] rgtk: has joined #RubyOnRails
[01:51:27] goodcodeguy: has joined #RubyOnRails
[01:51:48] maesitos: has joined #RubyOnRails
[01:52:33] rgtk: has joined #RubyOnRails
[01:53:05] pawnbox: has joined #RubyOnRails
[01:53:06] _Tariq: has joined #RubyOnRails
[01:53:46] maesitos: has joined #RubyOnRails
[01:53:55] viiralvx: has joined #RubyOnRails
[01:54:28] rgtk: has joined #RubyOnRails
[01:55:40] maesitos: has joined #RubyOnRails
[01:56:15] rgtk: has joined #RubyOnRails
[01:57:32] maesitos: has joined #RubyOnRails
[01:58:15] rgtk: has joined #RubyOnRails
[01:59:24] maesitos: has joined #RubyOnRails
[02:00:07] rgtk: has joined #RubyOnRails
[02:00:39] dcope: anyone in here ever gotten devise + grape working in tandem?
[02:01:13] bklane: has joined #RubyOnRails
[02:01:21] maesitos: has joined #RubyOnRails
[02:01:41] openstruct: has joined #RubyOnRails
[02:02:05] rgtk: has joined #RubyOnRails
[02:03:17] maesitos: has joined #RubyOnRails
[02:03:55] rgtk: has joined #RubyOnRails
[02:05:08] maesitos: has joined #RubyOnRails
[02:05:50] rgtk: has joined #RubyOnRails
[02:07:03] maesitos: has joined #RubyOnRails
[02:07:45] rgtk: has joined #RubyOnRails
[02:08:34] SteenJobs: has joined #RubyOnRails
[02:08:48] baweaver: has joined #RubyOnRails
[02:08:54] maesitos: has joined #RubyOnRails
[02:09:35] rgtk: has joined #RubyOnRails
[02:10:47] maesitos_: has joined #RubyOnRails
[02:11:21] yeapiekiyay: has joined #RubyOnRails
[02:11:32] rgtk: has joined #RubyOnRails
[02:12:03] bklane: has joined #RubyOnRails
[02:12:45] maesitos: has joined #RubyOnRails
[02:13:23] rgtk: has joined #RubyOnRails
[02:14:49] maesitos_: has joined #RubyOnRails
[02:15:18] rgtk: has joined #RubyOnRails
[02:16:30] Kulo: has joined #RubyOnRails
[02:16:33] maesitos_: has joined #RubyOnRails
[02:17:10] rgtk: has joined #RubyOnRails
[02:18:08] roshanavand: has joined #RubyOnRails
[02:18:18] arBmind: has joined #RubyOnRails
[02:18:32] maesitos: has joined #RubyOnRails
[02:19:05] rgtk: has joined #RubyOnRails
[02:19:50] underplank: has joined #RubyOnRails
[02:20:21] maesitos_: has joined #RubyOnRails
[02:21:00] rgtk: has joined #RubyOnRails
[02:21:13] bklane: has joined #RubyOnRails
[02:21:44] Devalo: has joined #RubyOnRails
[02:22:08] Honeycomb: has joined #RubyOnRails
[02:22:15] maesitos: has joined #RubyOnRails
[02:22:50] rgtk: has joined #RubyOnRails
[02:24:11] maesitos_: has joined #RubyOnRails
[02:24:43] rgtk: has joined #RubyOnRails
[02:26:10] maesitos: has joined #RubyOnRails
[02:26:20] kirillzh: has joined #RubyOnRails
[02:26:28] rgtk: has joined #RubyOnRails
[02:27:55] maesitos: has joined #RubyOnRails
[02:28:30] rgtk: has joined #RubyOnRails
[02:28:50] bklane_: has joined #RubyOnRails
[02:29:03] laurenonthehill: has joined #RubyOnRails
[02:29:58] maesitos: has joined #RubyOnRails
[02:30:25] rgtk: has joined #RubyOnRails
[02:31:06] ur5us: has joined #RubyOnRails
[02:31:41] maesitos: has joined #RubyOnRails
[02:32:20] rgtk: has joined #RubyOnRails
[02:33:13] pawnbox: has joined #RubyOnRails
[02:33:37] maesitos: has joined #RubyOnRails
[02:33:41] lexileo: has joined #RubyOnRails
[02:34:12] rgtk: has joined #RubyOnRails
[02:35:34] maesitos_: has joined #RubyOnRails
[02:36:09] rgtk: has joined #RubyOnRails
[02:37:28] maesitos: has joined #RubyOnRails
[02:38:04] rgtk: has joined #RubyOnRails
[02:39:00] one_zero: has joined #RubyOnRails
[02:39:24] maesitos: has joined #RubyOnRails
[02:39:56] rgtk_: has joined #RubyOnRails
[02:41:18] maesitos: has joined #RubyOnRails
[02:41:51] rgtk: has joined #RubyOnRails
[02:43:11] maesitos: has joined #RubyOnRails
[02:43:41] rgtk: has joined #RubyOnRails
[02:45:07] maesitos: has joined #RubyOnRails
[02:45:36] rgtk: has joined #RubyOnRails
[02:46:14] kies^: has joined #RubyOnRails
[02:46:51] Pazician: has joined #RubyOnRails
[02:47:04] hardtail: has joined #RubyOnRails
[02:47:12] yfeldblum: has joined #RubyOnRails
[02:47:13] maesitos: has joined #RubyOnRails
[02:47:29] rgtk: has joined #RubyOnRails
[02:47:42] Radar: nerium: late reply: but no you can't do that. More than one routing helper can go to the same path.
[02:48:29] Radar: tjbiddle: I guess you're using https://github.com/carr/phone for that validation>
[02:48:33] Radar: slash-cleaning-up
[02:48:55] maesitos_: has joined #RubyOnRails
[02:49:24] rgtk: has joined #RubyOnRails
[02:50:20] nerium: Radar: Listing all possible routes works
[02:50:34] Radar: nerium: Do you have some code for that?
[02:50:48] maesitos: has joined #RubyOnRails
[02:51:09] nerium: Radar: No, that was my question if such a tool for the browser exists. Having to look up all routers takes time
[02:51:14] rgtk: has joined #RubyOnRails
[02:51:18] Radar: nerium: !xy
[02:51:18] helpa: nerium: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[02:52:14] eddyzz: has joined #RubyOnRails
[02:52:31] nerium: I???m not sure if you understand what i mean. I just want the current path/paths when browsing to speed up the dev process. Currently I*m using ???rails routes | grep ?????? to figur out the route
[02:52:45] maesitos_: has joined #RubyOnRails
[02:53:10] rgtk: has joined #RubyOnRails
[02:53:18] nerium: So at the index page the tool would yeild ???root_path???
[02:54:39] maesitos: has joined #RubyOnRails
[02:55:01] rgtk: has joined #RubyOnRails
[02:55:42] Radar: But there's more than one path that can match a route?
[02:55:52] Radar: get "/", to: "home#index", as: "other_root"
[02:55:57] Radar: which is correct? root_path or other_root_path?
[02:56:23] nerium: Radar: Listing all possible paths is still faster then what I just showed
[02:56:32] maesitos: has joined #RubyOnRails
[02:56:34] Radar: nerium: And what are you using to "list all possible paths"?
[02:56:35] edwinrozario_: has joined #RubyOnRails
[02:56:56] rgtk: has joined #RubyOnRails
[02:57:03] nerium: Radar: I???m asking for a tool that does this for me, that???s my whole question
[02:57:20] nerium: Given ???/a/b/c/d???, give me all possible url helpers
[02:57:31] openstruct: has joined #RubyOnRails
[02:57:31] openstruct: has joined #RubyOnRails
[02:58:07] nerium: Ember has this tool directly in the browser. I was expecing rails to have something similar as it is a pain to look up all the router manually
[02:58:24] nerium: *all the router manually
[02:58:25] maesitos: has joined #RubyOnRails
[02:58:28] underplank: has joined #RubyOnRails
[02:58:35] nerium: Darn auto completion
[02:58:51] rgtk: has joined #RubyOnRails
[02:59:01] tjbiddle: Radar: No - actually just a custom helper - gsub with throwing a + in front
[02:59:10] tjbiddle: Looking into that though, thanks!
[02:59:30] Radar: nerium: no, Rails does not have something like this. You can usually intuit the routing helper with enough experience
[02:59:39] Radar: nerium: i.e. to go to the /posts/1/edit page it's going to be edit_post_path(post)
[03:00:02] Radar: tjbiddle: It might be more of a struggle than your gsub thing, but at least you'll get phone number validation out of it.
[03:00:22] maesitos: has joined #RubyOnRails
[03:00:39] nerium: Yeah, but when you???ve 500 different routers, all renamed nested with 5 different non optional params, it takes some time to figure out the path
[03:00:41] rgtk: has joined #RubyOnRails
[03:01:01] kirillzh: has joined #RubyOnRails
[03:01:41] cih: has joined #RubyOnRails
[03:02:15] maesitos: has joined #RubyOnRails
[03:02:35] tjbiddle: Radar: Hm, looks like I need to manually throw in the + either way, so can't just throw in whatever the controller gets in params. Neat to know though, thanks! Will stick with my current method. Is a helper_method in the application_controller the best place for that then, do you think?
[03:02:36] rgtk: has joined #RubyOnRails
[03:03:04] Radar: tjbiddle: Do you need it in both the controller and views? Can you get away with just using it in the view?
[03:03:19] sevenseacat: has joined #RubyOnRails
[03:03:28] tjbiddle: Radar: I have no views; API-only rails applications using ActiveModelSerializer
[03:03:33] tjbiddle: So just in the controller
[03:04:08] maesitos: has joined #RubyOnRails
[03:04:24] tjbiddle: Use cases: Saving into two separate models, as well as formatting it prior to a find_by or where on those models
[03:04:26] rgtk: has joined #RubyOnRails
[03:04:44] Radar: tjbiddle: Yes, then I think that's fine.
[03:04:51] tjbiddle: Great, thank you
[03:06:04] maesitos_: has joined #RubyOnRails
[03:06:21] rgtk_: has joined #RubyOnRails
[03:07:58] maesitos: has joined #RubyOnRails
[03:08:16] rgtk: has joined #RubyOnRails
[03:08:31] fedexo: has joined #RubyOnRails
[03:09:09] _Tariq: has joined #RubyOnRails
[03:09:24] underplank: has joined #RubyOnRails
[03:09:50] maesitos: has joined #RubyOnRails
[03:10:09] rgtk: has joined #RubyOnRails
[03:11:46] maesitos_: has joined #RubyOnRails
[03:12:02] rgtk: has joined #RubyOnRails
[03:13:05] pawnbox: has joined #RubyOnRails
[03:13:23] JoshL: has joined #RubyOnRails
[03:13:37] maesitos: has joined #RubyOnRails
[03:13:52] rgtk: has joined #RubyOnRails
[03:15:30] maesitos: has joined #RubyOnRails
[03:15:50] rgtk: has joined #RubyOnRails
[03:16:05] neilfse: has joined #RubyOnRails
[03:17:22] maesitos: has joined #RubyOnRails
[03:17:44] rgtk: has joined #RubyOnRails
[03:19:16] maesitos: has joined #RubyOnRails
[03:19:37] rgtk: has joined #RubyOnRails
[03:20:07] sinkensabe: has joined #RubyOnRails
[03:21:12] maesitos: has joined #RubyOnRails
[03:21:27] rgtk_: has joined #RubyOnRails
[03:23:04] maesitos: has joined #RubyOnRails
[03:23:21] rgtk: has joined #RubyOnRails
[03:23:26] Devalo: has joined #RubyOnRails
[03:24:58] maesitos_: has joined #RubyOnRails
[03:25:15] rgtk: has joined #RubyOnRails
[03:26:53] maesitos: has joined #RubyOnRails
[03:26:58] rgtk: has joined #RubyOnRails
[03:28:48] maesitos: has joined #RubyOnRails
[03:29:03] rgtk: has joined #RubyOnRails
[03:29:28] alxm: has left #RubyOnRails: ()
[03:30:39] maesitos_: has joined #RubyOnRails
[03:30:48] rgtk: has joined #RubyOnRails
[03:36:57] B1n4r10: has joined #RubyOnRails
[03:36:57] SteenJobs: anyone know the best way to download a file thru the browser from s3 using carrierwave? the method retrieve_from_store!() seems to return an unusable symbol of sorts
[03:40:22] DmitryBochkarev: has joined #RubyOnRails
[03:44:11] _Tariq: has joined #RubyOnRails
[03:47:14] SteenJobs: and using read() throws a no method error ???undefined method `body' for nil:NilClass???
[03:48:15] baweaver: has joined #RubyOnRails
[03:51:12] roshanavand: has joined #RubyOnRails
[03:51:13] tjbiddle: has joined #RubyOnRails
[03:51:29] polishdub: has joined #RubyOnRails
[03:53:30] pawnbox: has joined #RubyOnRails
[03:57:47] dmz: has joined #RubyOnRails
[04:00:03] underplank: has joined #RubyOnRails
[04:02:20] cih: has joined #RubyOnRails
[04:02:42] roshanavand: has joined #RubyOnRails
[04:02:53] kirillzh: has joined #RubyOnRails
[04:03:01] Technodrome: has joined #RubyOnRails
[04:03:49] treaki: has joined #RubyOnRails
[04:05:40] grothendieck: has joined #RubyOnRails
[04:05:52] bronson: has joined #RubyOnRails
[04:06:40] grothendieck: has left #RubyOnRails: ()
[04:06:45] treaki_: has joined #RubyOnRails
[04:06:50] grothendieck: has joined #RubyOnRails
[04:10:04] qejk: has joined #RubyOnRails
[04:10:17] stannard: has joined #RubyOnRails
[04:12:59] barhum2013: has joined #RubyOnRails
[04:13:29] braincrash: has joined #RubyOnRails
[04:19:43] norc_: has joined #RubyOnRails
[04:20:23] DmitryBochkarev: has joined #RubyOnRails
[04:22:25] alphaatom: has joined #RubyOnRails
[04:24:57] DmitryBochkarev: has joined #RubyOnRails
[04:25:45] krz: has joined #RubyOnRails
[04:26:24] triptec: has joined #RubyOnRails
[04:27:16] jtong: has joined #RubyOnRails
[04:28:09] stardiviner: has joined #RubyOnRails
[04:33:06] bronson: has joined #RubyOnRails
[04:34:52] atrius: has joined #RubyOnRails
[04:37:27] EMCHAMP_: has left #RubyOnRails: ()
[04:43:28] arup_r: has joined #RubyOnRails
[04:45:41] arup_r: why my fields_for not showing any data in the form? What is the thing I missed in my code? https://gist.github.com/aruprakshit/92a53bec3aea3f442572
[04:46:15] krz: has joined #RubyOnRails
[04:47:57] Pazician: has joined #RubyOnRails
[04:49:30] rubyonrailed: has joined #RubyOnRails
[04:49:41] triptec: has joined #RubyOnRails
[04:50:04] Radar: arup_r: Show us your Participant model too please.
[04:50:12] arup_r: Radar: added
[04:51:18] sevenseacat: do you have any data to show? :)
[04:51:36] arup_r: yes. I added the rails console data that is why..
[04:51:50] Radar: where is the accepts_nested_attributes_for call
[04:52:19] Radar: And there's no proof that @tournament in the controller is the same as Tournament.find(1).
[04:52:24] arup_r: ok, I didn't add it yet. i was just building the form...
[04:52:25] Radar: arup_r: Logs for the action too please
[04:52:28] arup_r: Radar: the url is http://localhost:5000/tournaments/1/participants/new
[04:55:20] SteenJobs: has joined #RubyOnRails
[04:55:29] arup_r: Radar: in Rails 5 I don't see the logs of this page.. sometimes it comes and sometimes it is not.. I don't what is wrong.. Otherwise I can paste the log.. log has no trace for this request.
[04:56:15] Radar: ACTION puts $20 on Turbolinks
[04:56:33] sevenseacat: rails 5? good to mention these things
[04:56:34] quazimodo: has joined #RubyOnRails
[04:56:44] Radar: I don't know what else could be wrong. Might be one of those things where I'd need to see an app which is having the issue.
[04:56:58] arup_r: oh..sorry not to mention that.
[04:57:36] rogue_koder: has joined #RubyOnRails
[04:58:35] arup_r: sevenseacat: it is (Rails 5.0.0.beta2)
[05:01:04] roshanavand: has joined #RubyOnRails
[05:03:06] jtong: has joined #RubyOnRails
[05:04:17] jtong: has joined #RubyOnRails
[05:05:12] arup_r: should I add it to the issue list ? because it is so basic thing, I expected it to work
[05:06:03] arup_r: in my app someone added turbolink5 :) and which broke all .on "reade page:load" thing.
[05:08:07] hashtd: has joined #RubyOnRails
[05:08:34] sinkensabe: has joined #RubyOnRails
[05:16:50] adavia: is it possible the data-disable_with attr could fire after an ajax complete callback?
[05:22:18] Radar: arup_r: Is the issue fixed yet?
[05:22:22] Radar: arup_r: The one with your app?
[05:22:49] Eswar: has joined #RubyOnRails
[05:22:57] atrius: has joined #RubyOnRails
[05:23:22] arup_r: No Radar, I am adding inverse_of to see what happens.. I added <%= participant_form.object.division_participants.size %> and seeing it prints 2 as expected, but fields for doesn't output any.
[05:23:40] krz: has joined #RubyOnRails
[05:25:25] arup_r: ok. inverse_of doesn't help too.. It is somehow fields_for giving trouble..
[05:29:48] triptec: has joined #RubyOnRails
[05:30:24] johnflux: has joined #RubyOnRails
[05:30:24] johnflux: has joined #RubyOnRails
[05:30:43] arup_r: Radar: little progress. After restart the server, I see field_for to iterate only once, but it should iterate 2 times.. https://gist.github.com/aruprakshit/92a53bec3aea3f442572
[05:30:52] arup_r: fields_for**
[05:31:33] maesitos: has joined #RubyOnRails
[05:33:09] SteenJobs: Radar: speaking of turbolinks???even with jQuery turbolinks gem, and the usual work arounds, and even setting data-no-turbolink, dropzone.js only worked upon page refresh until i completely removed turbolinks from the asset pipeline - does that make sense to you (meaning that the above methods wouldn???t work, yet removing it would)?
[05:34:18] dexter_: has joined #RubyOnRails
[05:34:33] benlieb: has joined #RubyOnRails
[05:38:01] Radar: SteenJobs: No idea. Your problem is too complex for IRC.
[05:38:11] SteenJobs: is that a thing?
[05:38:23] SteenJobs: i mean i got it working by just getting rid of turbolinks, so not a huge loss
[05:38:51] SteenJobs: merely curious from an educational standpoing how the aformentioned fixes didn???t work, no worries though.
[05:38:55] Radar: Getting rid of turbolinks is _always_ my advice.
[05:38:56] arup_r: has joined #RubyOnRails
[05:39:04] Radar: It messes with you so many different ways.
[05:39:15] SteenJobs: didn???t know that, and that makes me feel a million times better
[05:39:49] arup_r: brb .. very obvious things not working.. so I need a break. I dunno what's going on.. :/
[05:40:52] arup_r: brb 15 mins
[05:40:53] SteenJobs: Radar: btw, administrate is pretty dope so far. it???s really barebones and allows pretty much complete flexibility
[05:41:00] Radar: SteenJobs: Great to hear :D
[05:41:18] arup_r: has left #RubyOnRails: ()
[05:41:46] SteenJobs: Radar: i was able to customize it so that when an admin clicks on an image link for an image belonging to a user, it initiates a download from s3 directly thru the browser. something tells me AA doesn???t let you do that
[05:43:06] SteenJobs: sevenseacat: oh and hey :)
[05:44:55] SteenJobs: the web world finally beckoned me back from the world of mobile dev
[05:46:01] Eswar: has joined #RubyOnRails
[05:48:13] SteenJobs: aright, night everyone
[05:48:24] eisi: has joined #RubyOnRails
[05:48:36] arup_r: has joined #RubyOnRails
[05:49:27] baweaver: has joined #RubyOnRails
[05:49:38] Bloomer: has joined #RubyOnRails
[05:49:51] Devalo: has joined #RubyOnRails
[05:51:30] cih: has joined #RubyOnRails
[05:54:00] stardiviner: has joined #RubyOnRails
[05:56:30] _djbkd: has joined #RubyOnRails
[05:57:47] tetraktys: has joined #RubyOnRails
[06:01:10] eisi: has joined #RubyOnRails
[06:02:58] triptec: has joined #RubyOnRails
[06:03:39] sinkensabe: has joined #RubyOnRails
[06:04:43] arup_r: has joined #RubyOnRails
[06:06:32] arup_r: any idea why inside the fields for seeing only 1, whereas I have 2 objects https://gist.github.com/aruprakshit/92a53bec3aea3f442572
[06:07:30] sevenseacat: arup_r: there's still no accepts_nested_attributes_for there
[06:07:41] arup_r: ok.. let me add
[06:07:52] apotry: has joined #RubyOnRails
[06:07:57] arup_r: I thought to render the form it is not needed.. let me add and check
[06:08:12] sevenseacat: it always helps to listen to the advice you get when you ask for help.
[06:08:16] kp666: has joined #RubyOnRails
[06:08:40] srinidhi: has joined #RubyOnRails
[06:09:31] arup_r: sevenseacat: yes, I forgot the advise.. +1 worked.
[06:10:11] arup_r: they all are interconnected .. nice :)
[06:10:23] ayonkhan: has joined #RubyOnRails
[06:14:58] _djbkd: has joined #RubyOnRails
[06:15:18] benlieb: has joined #RubyOnRails
[06:17:55] pawnbox: has joined #RubyOnRails
[06:18:36] ur5us: has joined #RubyOnRails
[06:20:36] neanderslob: has joined #RubyOnRails
[06:21:41] neanderslob_: has joined #RubyOnRails
[06:23:28] baweaver: has joined #RubyOnRails
[06:28:57] Technodrome: has joined #RubyOnRails
[06:30:56] arup_r: ijIi is:wa
[06:31:12] Macaveli: has joined #RubyOnRails
[06:32:47] arup_r: oops... sorry
[06:33:25] arup_r: I was on call.. and this is why I was not able to type in the remote guy's vim editor..
[06:33:37] sinkensabe: has joined #RubyOnRails
[06:33:41] arup_r: all my keystrokes were here..
[06:34:30] triptec: has joined #RubyOnRails
[06:36:12] roshanavand: has joined #RubyOnRails
[06:37:15] arup_r: has left #RubyOnRails: ()
[06:38:46] norc_: has joined #RubyOnRails
[06:41:27] rvanlieshout: has joined #RubyOnRails
[06:43:49] duncannz: has joined #RubyOnRails
[06:44:27] rubyonrails339: has joined #RubyOnRails
[06:44:58] lxsameer: has joined #RubyOnRails
[06:49:02] Macaveli: has joined #RubyOnRails
[06:50:05] ur5us: has joined #RubyOnRails
[06:52:02] ur5us_: has joined #RubyOnRails
[06:56:31] neanderslob: has joined #RubyOnRails
[07:01:11] yardenbar: has joined #RubyOnRails
[07:07:53] solars: has joined #RubyOnRails
[07:09:34] rubyonrailed: has joined #RubyOnRails
[07:10:56] rubyonrailed: has joined #RubyOnRails
[07:12:06] neanderslob: has joined #RubyOnRails
[07:13:30] quazimodo: has joined #RubyOnRails
[07:15:53] rafaelfranca: has joined #RubyOnRails
[07:17:14] krz: has joined #RubyOnRails
[07:20:29] techsethi: has joined #RubyOnRails
[07:21:15] tvw: has joined #RubyOnRails
[07:22:04] norc: has joined #RubyOnRails
[07:22:11] qejk: has joined #RubyOnRails
[07:23:25] techsethi: Hi, I am getting this error when trying "conditions" with find_each. "ArgumentError: Unknown key: :conditions. Valid keys are: :start, :batch_size". My rails version is "Rails 4.2.4". The API doc at this URL says, it should work. http://apidock.com/rails/ActiveRecord/Batches/ClassMethods/find_each I am confused as to what am I missing ? Thanks in advance
[07:24:03] Radar: techsethi: the docs are linking to the 2.3.8 method.
[07:24:05] Radar: techsethi: You probably want http://apidock.com/rails/ActiveRecord/Batches/find_each
[07:24:16] Radar: techsethi: May I recommend devdocs.io as an alternative to apidock?
[07:24:23] moeabdol2: has joined #RubyOnRails
[07:25:18] Pazician: has joined #RubyOnRails
[07:26:27] techsethi: thanks Radar but your url also shows "condition", let me check devdocs.io
[07:26:49] sinkensabe: has joined #RubyOnRails
[07:27:55] norc_: Is there a quick way to compile all my coffee assets to javascript in place? I want to get rid of this nonsense.
[07:28:03] Radar: techsethi: it doesn't show me conditions.
[07:28:08] Radar: norc_: no.
[07:28:20] Radar: norc_: You could try coffee2js (I think that's what it's called) but it will do a crap job.
[07:28:41] moeabdol: has joined #RubyOnRails
[07:29:00] Palsson: has joined #RubyOnRails
[07:29:02] norc_: Radar: But doesn't my asset pipeline do this already under the hood anyway?
[07:29:10] Radar: norc_: yes, but it is crap JS.
[07:29:37] norc_: Fair enough. Thank you for your input.
[07:29:38] norc_: Good night.
[07:30:47] techsethi: Radar: oops, was looking at wrong url. you're correct. got it. thanks a lot !
[07:31:16] roshanavand: has joined #RubyOnRails
[07:32:27] maesitos: has joined #RubyOnRails
[07:33:25] norc_: I wish I had never started with CoffeeScript. :(
[07:33:37] norc_: Seemed like a cool idea, but that was before I really learned JavaScript..
[07:36:23] tjbiddle: has joined #RubyOnRails
[07:40:14] cih: has joined #RubyOnRails
[07:40:57] gingray: has joined #RubyOnRails
[07:43:55] Prira: has joined #RubyOnRails
[07:45:20] neanderslob: hi everyone, I'm having a little trouble with using attr_accessor attributes in a conditional validation; more info here: http://stackoverflow.com/questions/35426344/conditional-validation-in-rails-using-attr-accessor
[07:45:45] p7r: has joined #RubyOnRails
[07:46:17] neanderslob: if anyone has any suggestions, I'd appreciate it; I think I'm misunderstanding something about attr_accessor
[07:46:25] roshanavand: has joined #RubyOnRails
[07:46:30] zenergi: has joined #RubyOnRails
[07:46:34] Janno: has joined #RubyOnRails
[07:47:26] itkin: has joined #RubyOnRails
[07:47:35] sandstrom: has joined #RubyOnRails
[07:47:53] mclee: has joined #RubyOnRails
[07:47:56] Radar: has joined #RubyOnRails
[07:47:56] davout: has joined #RubyOnRails
[07:48:19] hfp_work: has joined #RubyOnRails
[07:48:29] ekem: has joined #RubyOnRails
[07:48:44] Fridtjof: has joined #RubyOnRails
[07:49:17] IceBear: has joined #RubyOnRails
[07:51:42] AntiSpamMeta: has joined #RubyOnRails
[07:55:37] hnanon: has joined #RubyOnRails
[07:56:49] hnanon: If you have a Company model that had many users and jobs would you nest users and jobs under Company?
[07:57:09] sevenseacat: 'nest users and jobs under company' how?
[07:57:38] hnanon: I mean resource-wise.
[07:57:47] sevenseacat: so... routing?
[07:58:00] sevenseacat: depends on your use case
[07:58:45] hnanon: Can you give an example where it would be beneficial to do so?
[07:59:16] hnanon: I'm thinking that having the company id in the route will make some code writing easier or more concise?
[07:59:19] sevenseacat: uh... when you want routes that are structured like that
[07:59:42] hnanon: So just for aesthetic reasons?
[08:00:04] sevenseacat: its a weird question. 'why would i want my URLs to look like X?' i dont know, why would you?
[08:01:42] hnanon: Well, I'm not saying I want the URLs to look one way or another. I'm just wondering if they're nested will the controllers be simpler, for example.
[08:02:56] sevenseacat: well, you have IDs in URLs, and you look up records by IDs
[08:03:11] sevenseacat: having one ID in the URL or two, doesnt make much difference
[08:09:10] laurenonthehill: has joined #RubyOnRails
[08:09:11] rgtk: has joined #RubyOnRails
[08:11:01] Spami: has joined #RubyOnRails
[08:11:56] Macaveli: has joined #RubyOnRails
[08:13:08] darutoko: has joined #RubyOnRails
[08:16:29] speakingcode: has joined #RubyOnRails
[08:17:00] norc_: sevenseacat: I have a question, what is your stance on CoffeeScript? Do you use it? Do you avoid it?
[08:17:16] sevenseacat: I only use it if I'm working on existing project that use it
[08:17:22] sevenseacat: I do not include it in new apps
[08:23:21] Devalo: has joined #RubyOnRails
[08:25:31] Guest99318: has left #RubyOnRails: ()
[08:25:53] Radar: has joined #RubyOnRails
[08:27:55] antgel: has joined #RubyOnRails
[08:28:11] edwinvdgraaf: has joined #RubyOnRails
[08:29:55] rogue_koder: has joined #RubyOnRails
[08:30:30] seaworthy: has joined #RubyOnRails
[08:32:28] ilhami: has joined #RubyOnRails
[08:32:32] ilhami: sevenseacat, hey
[08:32:49] ilhami: which Auth lib do you use?
[08:36:50] srinidhi: has joined #RubyOnRails
[08:37:02] ilhami: https://github.com/plataformatec/devise ?
[08:37:03] ilhami: this one?
[08:37:12] maesitos: has joined #RubyOnRails
[08:37:16] quazimodo: has joined #RubyOnRails
[08:37:25] universa1: ilhami: yes
[08:37:43] ilhami: ok thanks.
[08:45:29] lexileo: has joined #RubyOnRails
[08:47:26] artto: has joined #RubyOnRails
[08:49:06] defsdoor: has joined #RubyOnRails
[08:49:13] roshanavand: has joined #RubyOnRails
[08:49:44] roshanavand: has joined #RubyOnRails
[08:51:16] kerunaru: has joined #RubyOnRails
[08:51:28] chooky: has joined #RubyOnRails
[08:54:54] Eswar: has joined #RubyOnRails
[08:55:38] sandstrom: has joined #RubyOnRails
[08:58:00] bronson: has joined #RubyOnRails
[08:58:07] snowy: has joined #RubyOnRails
[09:00:09] mdw: has joined #RubyOnRails
[09:01:34] drptbl: has joined #RubyOnRails
[09:01:49] mdw: has joined #RubyOnRails
[09:02:59] Cork: i have a multi level deep relation that i'm trying to use autosave with
[09:03:02] Cork: but i can't get it to work
[09:03:24] Cork: is it possible to use autosave more then one assosiation deep?
[09:05:41] Cork: hmm wonder what it is that is breaking this then
[09:05:47] Cork: is scopes a problem?
[09:06:05] maesitos: has joined #RubyOnRails
[09:06:11] arBmind: has joined #RubyOnRails
[09:06:35] universa1: wait, i polish my magic bubble and have a look...
[09:06:36] cih: has joined #RubyOnRails
[09:06:45] universa1: nah... no clear image...
[09:06:47] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[09:07:45] universa1: s/magic mubble/crystal ball/
[09:08:16] Cork: ya, its a complex relation so it is a bit problematic to paste the relation
[09:08:31] universa1: ok, then it is impossible for us to help you.
[09:08:50] Cork: ya, i get that
[09:08:51] universa1: but create a dummy app and add levels of relations until it breaks
[09:09:04] mark4: has joined #RubyOnRails
[09:09:05] Cork: good point
[09:09:25] defsdoor: has joined #RubyOnRails
[09:09:26] Cork: the relation is 6 levels deep ^^'
[09:09:45] savos_darkran: has joined #RubyOnRails
[09:10:30] Ergo: has joined #RubyOnRails
[09:18:19] baweaver: has joined #RubyOnRails
[09:18:44] savos_darkran: has left #RubyOnRails: ()
[09:18:50] savos_darkran: has joined #RubyOnRails
[09:19:35] savos_darkran: When would an assert_template not work? Example: assert_template 'users/edit'
[09:20:01] herbst: has joined #RubyOnRails
[09:20:01] herbst: has joined #RubyOnRails
[09:20:14] universa1: savos_darkran: define: not work
[09:20:59] savos_darkran: let me get you a gist. one second
[09:22:20] savos_darkran: https://gist.github.com/anonymous/df5c7f9e1ea6cb93e3cd
[09:22:28] Psy-Q: has joined #RubyOnRails
[09:24:13] snowy: has joined #RubyOnRails
[09:24:25] Thouren: has joined #RubyOnRails
[09:24:52] Devalo: has joined #RubyOnRails
[09:25:04] kp666: has joined #RubyOnRails
[09:25:19] sevenseacat: because you're not rendering that template
[09:25:37] sevenseacat: thats a really weird test
[09:26:24] renews: has joined #RubyOnRails
[09:27:04] savos_darkran: I'm quite new to rails, so everything is weird to me:)
[09:27:52] sevenseacat: then again, i find integration tests weird in general
[09:28:09] sevenseacat: by that, i mean what rails calls integration tests
[09:28:32] comrad: has joined #RubyOnRails
[09:31:02] drptbl: has joined #RubyOnRails
[09:31:42] universa1: savos_darkran: assert_template should be for controller tests, in integration tests you basically test from a browsers point of view, and a browser does not know which page was rendered
[09:31:54] universa1: it knows which url it is on and what content is on the page.
[09:32:46] universa1: and in an integration test you would basically click through your application, so you start at some page, fill in some form, click submit and then check the resulting page, ...
[09:32:46] blackmesa: has joined #RubyOnRails
[09:32:58] FooMunki: has joined #RubyOnRails
[09:36:19] jahbrewski: has joined #RubyOnRails
[09:42:16] maesitos: has joined #RubyOnRails
[09:43:46] marr: has joined #RubyOnRails
[09:44:28] treaki: has joined #RubyOnRails
[09:45:27] mhoungbo: has joined #RubyOnRails
[09:46:58] rodfersou: has joined #RubyOnRails
[09:48:02] sandstrom: has joined #RubyOnRails
[09:54:26] swistak35: has joined #RubyOnRails
[09:54:57] Dios: has joined #RubyOnRails
[09:57:21] srinidhi: has joined #RubyOnRails
[09:57:40] cih_: has joined #RubyOnRails
[09:58:42] Bloomer: has joined #RubyOnRails
[09:58:49] eyck: has joined #RubyOnRails
[09:59:37] eyck: has joined #RubyOnRails
[10:02:09] Macaveli: has joined #RubyOnRails
[10:02:16] herbst0: has joined #RubyOnRails
[10:03:24] techsethi: has joined #RubyOnRails
[10:10:27] tvw: has joined #RubyOnRails
[10:10:49] msyvich: has joined #RubyOnRails
[10:11:02] oded_: has joined #RubyOnRails
[10:11:45] jyraff: has joined #RubyOnRails
[10:11:48] giom: has joined #RubyOnRails
[10:12:51] nettoweb: has joined #RubyOnRails
[10:13:47] mikecmpbll: has joined #RubyOnRails
[10:15:18] trinaldi: has joined #RubyOnRails
[10:16:31] lexiMon: has joined #RubyOnRails
[10:16:47] lexiMon: has joined #RubyOnRails
[10:17:02] lexiMon: has joined #RubyOnRails
[10:17:19] lexiMon: has joined #RubyOnRails
[10:17:36] lexiMon: has joined #RubyOnRails
[10:17:52] lexileo: has joined #RubyOnRails
[10:18:16] lexileo: has joined #RubyOnRails
[10:18:44] nocontrol: has joined #RubyOnRails
[10:18:53] durexlw: has joined #RubyOnRails
[10:20:42] durexlw: I need some help on testing scopes... what I want to do is test that an active record scope returns what I expect. I kinda hoped I could do this with factory girl, but that don't seem to work. Can someone say how you test AR-scopes?
[10:21:46] ElFerna_: has joined #RubyOnRails
[10:22:13] ddv: durexlw: why do you want to test that?
[10:23:09] universa1: durexlw: !rule5 ;-)
[10:23:09] helpa: durexlw: Saying that something "doesn't work" is completely useless to the people who are trying to help you. Please show all available information you have that indicates to you that something doesn't work. (remember to use http://gist.github.com for code/error messages)
[10:23:33] durexlw: well I'm writing a serializer to output to a graph, but I want to make sure I integrate in the test the valid output of the scope... I'm willing to consider indeed if I need to do this however
[10:23:40] msyvich: has joined #RubyOnRails
[10:24:03] durexlw: universa1: Am I violating a rule here?
[10:24:21] universa1: durexlw: no, was just too lazy to write that out myself.
[10:24:35] durexlw: helpa: factory girl returns arrays... I kinda expected it to populate the database and go through active record to retreive data
[10:25:37] universa1: durexlw: factory girl populates the database.
[10:25:54] Bloomer: has joined #RubyOnRails
[10:25:57] durexlw: universa1: then I must fuck up somewhere :)
[10:26:34] arup_r: has joined #RubyOnRails
[10:32:19] bmalum: has joined #RubyOnRails
[10:34:22] worknick: has joined #RubyOnRails
[10:34:31] durexlw: universa1: https://gist.github.com/durexlw/39b6cfd4319a3e69852d
[10:35:27] universa1: durexlw: full stack / error trace
[10:36:14] universa1: and add it as a separate file to the same gist.
[10:36:20] durexlw: universa1: added
[10:36:28] matthewd: durexlw: Where do you call the scope?
[10:36:49] durexlw: matthewd: In the model: ContractSerializer.koppen_per_maand(self.koppen_per_maand).to_json
[10:36:56] durexlw: "self.koppen_per_maand"
[10:36:56] universa1: durexlw: class vs instance level
[10:36:57] ql6wlld: has joined #RubyOnRails
[10:37:05] matthewd: durexlw: Where do you call that in the test?
[10:37:21] universa1: durexlw: and your contract model has no aantal_koppen method / attribute.
[10:37:41] universa1: durexlw: https://gist.github.com/durexlw/39b6cfd4319a3e69852d#file-contract_serializer-rb-L4 this is the line that actually errors
[10:38:05] universa1: durexlw: starting here: https://gist.github.com/durexlw/39b6cfd4319a3e69852d#file-test-L8
[10:38:13] markelite: has joined #RubyOnRails
[10:38:46] universa1: durexlw: and for readability if you multiple objects of one thing, i'd use plural names, so @contracts = create_list(...); @stats = ... (@contracts)
[10:38:53] element_zer0: has joined #RubyOnRails
[10:39:03] universa1: durexlw: and koppen_per_maand(contracts); contracts.map ...
[10:39:34] bahar: has joined #RubyOnRails
[10:39:49] arup_r: worknick: hlo
[10:40:01] durexlw: universa1: about the readability: much agreed... just did it to stay in line with "Contract.all", but contracts for this would make sense indeed
[10:40:32] durexlw: universa1: seems like i mis interpreted error indeed... one sec... going to revisit it...
[10:40:45] matthewd: [21:07:05] <matthewd> durexlw: Where do you call that in the test?
[10:41:03] universa1: matthewd: he doesn't get to the scope ;)
[10:42:31] durexlw: matthewd: the test calls the serializer class, which calls the model, which should call the scope, which should rely on the factory
[10:42:32] blackmesa: has joined #RubyOnRails
[10:42:47] matthewd: universa1: I'm not asking because *I* don't know what's happening ;)
[10:43:00] durexlw: point taken :)
[10:43:09] universa1: matthewd: yeah... ..figured... ;)
[10:43:32] matthewd: durexlw: You said the scope gets called from serialize_for_graph
[10:43:38] matthewd: durexlw: What calls serialize_for_graph ?
[10:43:46] artto: has joined #RubyOnRails
[10:45:39] durexlw: matthewd: I see what you mean, that's because I've been tampering with the code... it used to be: "contracts = contract.koppen_per_maand"
[10:46:44] durexlw: matthewd: I changed the code in order to try to make it testable... but it all became a little blurry for me along the way
[10:47:18] matthewd: Okay, well the problem with the code as presented is that you need to call the scope to introduce the extra column, and nothing's doing so
[10:47:27] pjammer: has joined #RubyOnRails
[10:47:31] ddv: durexlw: try to program in English...
[10:48:02] universa1: ddv: why? not that i personally prefer to program in english
[10:48:12] mdw: has joined #RubyOnRails
[10:48:14] durexlw: matthewd: I'm going to update the gist... then the error will be visible I was talking about
[10:48:24] ddv: universa1: because I find it unprofessional
[10:48:36] sevenseacat: 'i dont like the way you code, so change it'
[10:49:38] matthewd: Mixing languages in code does seem likely to increase confusion to me, but it's easy for me to say that when English is my first language
[10:49:39] quazimodo: has joined #RubyOnRails
[10:50:04] sevenseacat: that may be a valid reason to code in English, 'i dont like it' is not
[10:50:25] durexlw: matthewd: updated the gist
[10:50:41] ldnunes: has joined #RubyOnRails
[10:51:03] matthewd: durexlw: Okay, so yeah: create_list returns an array, not a relation
[10:51:09] universa1: matthewd: i feel the same, even with english not being my first language... ...but then i can imagine people feel more comfortable using their native language :-)
[10:51:37] durexlw: matthewd: indeed, how can I produce a proper factory for this?
[10:52:54] msyvich: has joined #RubyOnRails
[10:53:14] y2mq37: has joined #RubyOnRails
[10:53:24] universa1: durexlw: what is improper about create_list?
[10:53:33] matthewd: durexlw: If those are the only contracts in your database, you could just use Contract.koppen_per_maand
[10:53:56] durexlw: ddv: "heads per month" just sounds crappy... otherwise I
[10:54:08] durexlw: would do it in english... couldn't find a proper translation :/ :)
[10:54:14] ddv: durexlw: naming things is hard
[10:54:27] durexlw: certainly if the database fields are in dutch
[10:54:34] tetraktys: has joined #RubyOnRails
[10:54:42] matthewd: durexlw: Otherwise, I guess you'll need Contract.where(id: @contract.map(&:id)).koppen_per_maand
[10:56:08] durexlw: matthewd: It just seems I'm interpreting the workings of factory girl completely wrong...
[10:56:21] renegadeandy: has joined #RubyOnRails
[10:56:59] agoldboi: has joined #RubyOnRails
[10:57:01] matthewd: FG will give you instances of the models... just not an AR::Relation
[10:57:04] EdwardIII: hrm someone told me something about being able to 'scope' monkey patching changes - is this what happens when i do e.g. 'DateTime.include'? it's only patched in the current scope?
[10:57:13] durexlw: universa1: so a factory create populates the database, and from there on I just use "Contract.whatever" and it works on the data I populated with factory girl?
[10:57:14] EdwardIII: or should i be doing some further reading?
[10:57:43] universa1: durexlw: yep.
[10:58:00] matthewd: EdwardIII: Refinements
[10:58:19] durexlw: universa1: I see now, let me try that
[10:58:29] durexlw: matthewd: yeah, I had that completely wrong
[10:58:43] Terens: how can I call rails help ?
[10:58:49] ddv: durexlw: do you work for a condom company? Durex :p
[10:59:03] Terens: When I call it ,it shows help for new command I typed before
[10:59:16] durexlw: ddv: nah, I just help to make them profit :p
[10:59:59] durexlw: I do appreciate the help guys. Thanks
[11:00:28] sevenseacat: Terens: what help are you looknig for?
[11:01:21] EdwardIII: matthewd: thanks
[11:01:59] herpless: has joined #RubyOnRails
[11:02:57] Terens: rails that lists all commands
[11:03:20] EdwardIII: matthewd: think i've got it
[11:03:42] matthewd: Terens: `rails --help` ?
[11:03:47] sevenseacat: you can get a list of common rails commands by just running `rails --help`
[11:04:06] EdwardIII: matthewd: "Refinements are an experimental feature in Ruby 2.0" - but they're ok to use now? or still a beta feature?
[11:04:06] sevenseacat: when inside a Rails application
[11:07:39] matthewd: EdwardIII: They're still used fairly rarely, but have been around for a few years. I don't know how likely things are to change, but I'd guess it's more likely some corner cases might be adjusted, while the main behaviour would remain as is.
[11:13:59] spiman: has joined #RubyOnRails
[11:14:09] jsrn_: has joined #RubyOnRails
[11:14:52] EdwardIII: hrm, if i want to use a route's alias (that's what as: is for, right?) how can i do that in form_for?
[11:15:22] EdwardIII: i can do url: '/hardcoded/url', or url_for(@model), but can't figure out how to refer to whatever i put in :as in routes.rb?
[11:15:27] matthewd: form_for(foo_path(..)) ?
[11:15:27] bbrowning: has joined #RubyOnRails
[11:17:54] EdwardIII: matthewd: hmm not sure how i can get model_path(@model) to generate the path based on the alias?
[11:18:41] Terens: ok thanks it worked
[11:19:17] arup_r: need some help.. https://gist.github.com/aruprakshit/f0b4b19ed2c3f4bcca2c I am showing the a check box before each division, and I want users to select it. Once users will select it, I want to send the id of the corresponding division. Can you suggest me how to do it? I am very close but not perfect https://gist.github.com/aruprakshit/f0b4b19ed2c3f4bcca2c
[11:19:20] matthewd: EdwardIII: You use [the_alias]_path
[11:19:23] baweaver: has joined #RubyOnRails
[11:20:00] arup_r: check_box generally sends `1` or `0`, but I want to send the `id` of each division... How to do it ?
[11:20:37] EdwardIII: matthewd: that's the only thing aliases are for? in django, it's just a name you can use
[11:20:45] matthewd: arup_r: Does the check_box method's API documentation contain anything that seems relevant?
[11:20:48] EdwardIII: so if you change the url you don't have to update all your code
[11:21:01] EdwardIII: the thing is, my routes don't relate directly to CRUD
[11:21:13] matthewd: EdwardIII: I'm not sure I understand the question. Some real code might help.
[11:21:39] arup_r: matthewd: yes, they have 2 options checked and unchecked.
[11:22:33] arup_r: "It???s intended that method returns an integer and if that integer is above zero, then the checkbox is checked." .. but I don't want like that. I want checked value to be the id of the division..
[11:22:57] arup_r: not sure, what should be the unchecked value..
[11:23:09] EdwardIII: matthewd: sure, i want to link to '/search/results', but i don't wanna hard code the path, so i thought maybe i could just use the as: 'alias'? https://gist.github.com/EdwardIII/8d16ea763d9dc6c6e53a
[11:23:14] arup_r: http://apidock.com/rails/v4.2.1/ActionView/Helpers/FormHelper/check_box
[11:23:18] arup_r: sevenseacat: true :)
[11:23:21] tvw: has joined #RubyOnRails
[11:24:09] EdwardIII: matthewd: here: https://gist.github.com/EdwardIII/8d16ea763d9dc6c6e53a#file-routes-rb-L7 and here: https://gist.github.com/EdwardIII/8d16ea763d9dc6c6e53a#file-t-erb-L2
[11:24:16] spiman: hey everyone, just a quick question. is there a shortcut for where('EXTRACT(MONTH from created_at) = 1 AND EXTRACT(YEAR from created_at) = 2016') queries using AR?
[11:24:16] arup_r: should I hardcode like { checked: division_fields.object.division.id, unchecked: 0 }
[11:24:40] atrius: has joined #RubyOnRails
[11:24:58] arup_r: spiman: I like what you have..
[11:26:09] matthewd: spiman: You could use a range... seems unlikely to be shorter, but might play better depending on what indexes you have defined
[11:27:18] matthewd: arup_r: You're conflating the description for `method` with that for `checked_value` and `unchecked_value`, I think.
[11:27:21] Devalo: has joined #RubyOnRails
[11:27:39] aganov: has joined #RubyOnRails
[11:27:54] spiman: i mean i can create a utility method somewhere to simplify the behavior i want, i'm just checking if there's already something built-in to AR that I'm missing
[11:27:59] matthewd: EdwardIII: Right, so, you can use `results_path` there
[11:28:44] EdwardIII: matthewd: that works a treat, i see now, thanks
[11:28:58] EdwardIII: matthewd: but i'm confused about the design decision. why not just :results? or 'results'?
[11:30:15] someish: has joined #RubyOnRails
[11:30:37] matthewd: EdwardIII: Most paths need parameters. And you need to use them in various other places, where it would be unreasonable to assume any string could be looked up like that. Thus: a method.
[11:31:02] EdwardIII: or url_for(:results)? i'm curious because like i say in django you just bang in it and it does a kind of chain-of-command thing to work out which thing you mean, then throws 404 if it doesn't resolve. params are always just optional
[11:31:18] qejk: has joined #RubyOnRails
[11:31:36] EdwardIII: so url_for(:results) is fine, so is url_for(:results, {:a_param => true})
[11:31:45] EdwardIII: just a curisoity, not a criticism
[11:31:48] alessandro1997: has joined #RubyOnRails
[11:31:53] sevenseacat: railsisnotdjangorailsisnotdjangorailsisnotdjango
[11:32:28] EdwardIII: you're right, i should not be interested in the reasons for things working the way they do because rails is not django
[11:32:55] ddv: Django the Rails wannabe
[11:33:15] sevenseacat: EdwardIII: well, you've made the huge assumption that rails doesn't have a url_for method that works very similarly
[11:34:34] EdwardIII: sevenseacat: i read the docs for url_for and it didn't seem to work the way i'm describing?
[11:35:09] krz: has joined #RubyOnRails
[11:35:28] sevenseacat: then you're describing something a bit poorly
[11:35:56] ddv: sevenseacat is cranky all day
[11:36:01] ddv: I just noticed
[11:36:16] matthewd: EdwardIII: I think there's a fine line between "is there a specific reason these differ that it would be worth me knowing", and "my default assumption is that things should be designed exactly as django did; please justify in detail why it's been done differently"
[11:36:28] sevenseacat: no, I just have low tolerance
[11:36:30] EdwardIII: sorry if that's how it came across - that's not my intent
[11:36:42] EdwardIII: i was just interested in why it's implemented that way
[11:37:12] ddv: ask the guys who committed it
[11:37:14] EdwardIII: for all i know it is the godmode of getting-urls-from-the-framework
[11:37:17] techsethi: has joined #RubyOnRails
[11:37:31] EdwardIII: ok, let's end the discussion - i didn't mean to cause a big conflict, i was just curious
[11:37:34] ddv: there are no women in Rails, sevenseacat
[11:37:36] Tempesta: has joined #RubyOnRails
[11:37:48] sevenseacat: ddv: i'd be very careful with the direction you're going in.
[11:40:45] qejk: has joined #RubyOnRails
[11:41:15] ddv: EdwardIII: what is your problem specifically?
[11:42:19] EdwardIII: ddv: i don't have one, i was just interested
[11:42:45] adaedra: Why have problems when you can have solutions?
[11:42:57] ddv: ohai adaedra
[11:42:59] arup_r: ok, one more last hint. My checkboxes are auto checked due to my controller code, what should I fix, so that I get, whatever I am seeing now, but the checkboxes are not checked..? https://gist.github.com/aruprakshit/f0b4b19ed2c3f4bcca2c
[11:43:28] adaedra: me pokes ddv
[11:43:34] adaedra: oops, lacks a / here.
[11:45:20] arup_r: I can do simply `@participant.division_participants.build`, but then I will not have the division id to mention in the check_box method as the checked value
[11:45:36] matthewd: arup_r: Maybe you just want check_box_tag ?
[11:47:41] arup_r: how it will help, just thinking.. :)
[11:50:14] Bloomer: has joined #RubyOnRails
[11:50:21] arup_r: but yes, I can see one solution with Rails 5 attribute api http://edgeapi.rubyonrails.org/classes/ActiveRecord/Attributes/ClassMethods.html ..
[11:51:12] syath: has joined #RubyOnRails
[11:51:26] matthewd: arup_r: IIUC, you want an empty checkbox, not one whose current state is determined by a property of the model
[11:51:35] matthewd: arup_r: That's what check_box_tag is for
[11:51:55] arup_r: let me see... ok
[11:53:10] Terens: what is the difference rake db:migrate and rails db:migrate ?
[11:53:13] Macaveli: has joined #RubyOnRails
[11:53:21] fox_mulder_cp: Terens: in rails 5 - no difference
[11:53:37] arup_r: hum, then the form will not be reusable .. and I need to write another for edit ..
[11:53:43] matthewd: (and in rails < 5, the latter doesn't exist)
[11:54:05] fox_mulder_cp: in r 4 no 'rails db:migrate'
[11:54:45] tetraktys: has joined #RubyOnRails
[11:54:53] Terens: I dont get where rails dbconsole is used
[11:55:03] sevenseacat: thats one "feature" of rails 5 I'm not keen on
[11:55:22] Terens: it seems that it exists within 4.2.5 too
[11:55:25] sevenseacat: Terens: when you want a rails console
[11:55:31] sevenseacat: to your database
[11:55:32] cih: has joined #RubyOnRails
[11:55:43] sevenseacat: it just connects to the db you specify in your database.yml, with the same credentials
[11:56:22] matthewd: sevenseacat: The problem with rake is that we don't own argument parsing, so you end up with ugly env-var hacks to pass parameters
[11:56:37] sevenseacat: true, arguments to rake tasks are fugly
[11:56:48] matthewd: (to me, unifying the actual "rake" vs "rails" thing-that-you-must-type is secondary, but likely also good for newbies)
[11:56:55] sevenseacat: so is rails taking over all custom tasks in a rails app?
[11:57:06] sevenseacat: or will custom tasks still use rake
[11:57:54] matthewd: I think you'd ultimately end up adding custom rails commands
[11:58:21] matthewd: For 5.0, it's going to end up as little more than a shim over rake: we haven't gotten it to a good standalone place in time
[11:59:19] bronson: has joined #RubyOnRails
[12:02:48] cih: has joined #RubyOnRails
[12:03:40] dtordable: has joined #RubyOnRails
[12:04:50] sandstrom: has joined #RubyOnRails
[12:10:45] n00bDev: has joined #RubyOnRails
[12:11:56] naftilos76: has joined #RubyOnRails
[12:13:42] krz: has joined #RubyOnRails
[12:13:49] dexter_: has joined #RubyOnRails
[12:18:49] rgtk: has joined #RubyOnRails
[12:19:51] lexileo: has joined #RubyOnRails
[12:21:32] EdwardIII: hrm, setting this default value sort of changes the behaviour of validation: https://gist.github.com/EdwardIII/41c2a227071d2a3fff70#file-s-rb-L36
[12:21:56] EdwardIII: now the validation error never gets triggered, it just gets automatically set to tomorrow
[12:22:03] EdwardIII: trying to decide if this is better or worse
[12:23:17] roshanavand: has joined #RubyOnRails
[12:25:21] arup_r: I am using Rails 5, but I have one question to you. Do you see logs in the `tail -f log/development.log` when you submit a form using html/Ajax ? I am not seeing those. just checking if it is only me facing this issue or not.
[12:26:52] arup_r: https://gist.github.com/aruprakshit/9f60c094999d5699b2d0 see no log, although I am submitting form, records are getting created. everything is happening, but no trace.
[12:30:09] arup_r: due to this, I am not able to debug stuff.. because I don't see what is coming ..
[12:31:26] durexlw: matthewd: You have any idea why this is: https://gist.github.com/durexlw/4984b0adc8e45c61cb1b I'm creating a factory, but I get something else when running the test
[12:32:28] durexlw: so there's "sequence(:voornaam) { |n| "voornaam #{n}" }" in the factory, but when debugging and asking for "contracts.last.voornaam", I get a method missing
[12:32:34] universa1: durexlw: Contract.content_columns.map(&:name)
[12:32:45] universa1: can't remember the shortcut for that...
[12:33:05] durexlw: man, I definately need a break
[12:33:12] universa1: durexlw: https://gist.github.com/durexlw/4984b0adc8e45c61cb1b#file-04running-test-L19
[12:33:19] universa1: durexlw: your contract has no voornam attribute
[12:33:32] blackmesa: has joined #RubyOnRails
[12:33:46] durexlw: universa1: I know, but that doesn't make sense, given that I define that attribute in the factory
[12:34:06] universa1: durexlw: the factory only uses the model.
[12:34:10] matthewd: durexlw: Factories aren't quite that magical
[12:34:15] universa1: durexlw: it does not define the model.
[12:34:30] universa1: durexlw: basically all it does is call: Model.new/create attributes_hash
[12:34:31] matthewd: durexlw: The factory just populates properties of the model
[12:34:44] universa1: and attributes_hash is retrieved from your factory definition
[12:35:28] durexlw: then somehow my scope doesn't return what I expect
[12:35:36] durexlw: it should contain more fields
[12:36:23] techsethi: has joined #RubyOnRails
[12:36:36] universa1: durexlw: show the full definition of your contract class!
[12:36:43] fox2: has joined #RubyOnRails
[12:38:35] rubyonrails511: has joined #RubyOnRails
[12:39:31] nettoweb: has joined #RubyOnRails
[12:39:59] hcnewsom: has joined #RubyOnRails
[12:40:53] Danielpk: has joined #RubyOnRails
[12:41:35] godzillaenlacasa: has joined #RubyOnRails
[12:41:38] d-snp: has left #RubyOnRails: ()
[12:41:40] artto: has joined #RubyOnRails
[12:42:19] durexlw: universa1: chenged it to be english... I'll update the gist, one sec
[12:45:02] durexlw: universa1: https://gist.github.com/durexlw/4984b0adc8e45c61cb1b
[12:45:30] ddv: durexlw: You can't change the column names? :)
[12:45:53] Kryptonic: has joined #RubyOnRails
[12:46:16] fox2: has left #RubyOnRails: ()
[12:46:27] durexlw: ddv: legacy reasons... I could all duplicate them, but that's a pretty heavy database cost
[12:46:49] ddv: durexlw: what kind of db is this?
[12:46:54] fox2: has joined #RubyOnRails
[12:46:58] durexlw: personal database
[12:47:11] durexlw: of a company
[12:47:17] ddv: durexlw: I mean mysql, mssql, posgres?
[12:48:17] durexlw: it's actually a website that I scrape... they don't have an api, so this is the last part of scraping the site, etl'ing the data and now finally I'm building a reporting on top of that
[12:48:32] Ergo^: has joined #RubyOnRails
[12:48:33] lacrymology: has joined #RubyOnRails
[12:48:39] ddv: durexlw: some databases support views
[12:49:07] ddv: durexlw: so you don't have to change the schema but just create views and then you can use any column name you want
[12:50:02] durexlw: ddv: yeah, not these fuckers... I asked them if they could give me a view, they told me they could ftp me files for a pretty decent amount of money each month... not quite the anser I expected... rather build a scraper
[12:51:02] durexlw: it's something for local government, we still see terminal apps around here
[12:51:16] ElFerna_: has joined #RubyOnRails
[12:51:17] durexlw: data connectivity is a luxery around here :)
[12:51:25] ddv: are you Dutch?
[12:51:55] durexlw: where you from?
[12:52:22] ddv: Netherlands
[12:53:43] durexlw: hi there neighbour :)
[12:56:17] durexlw: mm... factory seems to work properly... I can pretty much rule that one out
[12:56:42] fox2: may there is someone from the Ukraine??? )))
[12:58:16] durexlw: probably a few million peole... just don't know if they are here :)
[12:58:45] msyvich: has joined #RubyOnRails
[13:00:29] durexlw: universa1: everything works properly... somehow inspect just doesn't show calculated fields
[13:02:18] techsethi: has joined #RubyOnRails
[13:08:33] ElFerna_: has joined #RubyOnRails
[13:09:11] artto: has joined #RubyOnRails
[13:09:20] durexlw: got the testcode to work... starting to make sense now
[13:09:54] techsethi_: has joined #RubyOnRails
[13:11:48] n00bDev: has joined #RubyOnRails
[13:11:59] maesitos: has joined #RubyOnRails
[13:14:14] DEA7TH: has joined #RubyOnRails
[13:15:37] renegadeandy: has joined #RubyOnRails
[13:16:18] rickmasta: has joined #RubyOnRails
[13:17:56] _Tariq: has joined #RubyOnRails
[13:19:40] nfk: has joined #RubyOnRails
[13:22:55] maesitos: has joined #RubyOnRails
[13:28:45] Devalo: has joined #RubyOnRails
[13:29:05] bbrowning: has joined #RubyOnRails
[13:30:14] _Tariq: has joined #RubyOnRails
[13:32:26] giom: has joined #RubyOnRails
[13:35:03] bbrowning: has joined #RubyOnRails
[13:39:47] goodcodeguy: has joined #RubyOnRails
[13:39:51] Terens: I am a newbie... After creating via rails g model User blah...
[13:40:19] Terens: then I could modify the migration in order to add index etc or I should create a new migration ?
[13:40:44] ramortegui: has joined #RubyOnRails
[13:41:30] rvanlieshout: Terens: modify it
[13:41:37] rvanlieshout: unless you performed it, then rollback and modify
[13:41:42] rvanlieshout: unless you've placed it in production already
[13:41:47] rvanlieshout: then create a new one
[13:41:48] Mia: has joined #RubyOnRails
[13:41:48] Mia: has joined #RubyOnRails
[13:46:01] agoldboi: has joined #RubyOnRails
[13:46:26] bahar: has joined #RubyOnRails
[13:47:05] mdw: has joined #RubyOnRails
[13:47:26] Macaveli: has joined #RubyOnRails
[13:50:51] mrgreenfur: has joined #RubyOnRails
[13:52:35] tulak_: has joined #RubyOnRails
[13:53:01] arbys: has joined #RubyOnRails
[13:54:23] _Tariq: has joined #RubyOnRails
[14:00:04] lacrymology: has joined #RubyOnRails
[14:00:38] bronson: has joined #RubyOnRails
[14:01:13] blackmesa: has joined #RubyOnRails
[14:02:59] arbys: has left #RubyOnRails: ()
[14:05:08] configged: has joined #RubyOnRails
[14:06:28] msyvich: has joined #RubyOnRails
[14:06:33] mwlang: has joined #RubyOnRails
[14:06:52] configged: i'm pretty new to this and want to setup rails using a Windows host but with vagrant and chef for ubuntu. i see a lot of people recommend postgres but the guide on gorails uses mysql. can anyone recommend a cheffile and vagrantfile for postgres? or is postgres something i would add after i ssh to vagrant?
[14:07:52] rvanlieshout: configged: for now you could just use mysql
[14:08:10] rvanlieshout: follow that guide you have and consider switching or changing stuff afterwards
[14:08:13] rvanlieshout: when you understand the impact
[14:09:58] openstruct: has joined #RubyOnRails
[14:10:39] configged: alright. i've been following michael hartl's tutorial using the C9 environment. in that tutorial you usually deploy to heroku at the end of the chapter. do you think i would have any conflicts?
[14:10:56] configged: i'm not really liking C9 that much and wanted to setup something on my own
[14:11:13] rvanlieshout: and that's fine, but you might want to follow a guide first
[14:13:38] Macaveli: has joined #RubyOnRails
[14:15:46] dextertzu: has joined #RubyOnRails
[14:15:54] drbayer: has joined #RubyOnRails
[14:16:02] bbrowning: has joined #RubyOnRails
[14:16:53] configged: that's cool. i'll just follow this guide on gorails then. not trying to get too far ahead of myself but just trying to get a better understanding of how this works based on some stuff i read. as long as my gemfile is set to use sqlite, can i always develop in that locally. and whenever i deploy it somewhere(whether it be heroku or my own server), as long as postgres is installed there, it can be made to work?
[14:19:05] rvanlieshout: yes, but it would be better if your local environment matches your production environment
[14:19:16] rvanlieshout: in e.g. using the same database server
[14:19:25] mwlang: In my Rails 4.1 app connecting to MySQL database, I have set the time_zone info in application.rb to: config.active_record.default_timezone = :local; config.time_zone = 'Eastern Time (US & Canada)???; in my specs, I sometimes have to use ???-05:00??? and other times ???-04:00??? for datetime field comparisons???for example: is_expected.to eq DateTime.new(2015, 7, 15, 0,0,0,???-04:00???)
[14:20:16] mwlang: as far as I can tell, the database columns in all cases are datetime fields, so I???m at a loss to figure out why one field???s value is in ???-05:00??? while another, even in same table is at ???-04:00???
[14:20:31] tetraktys: has joined #RubyOnRails
[14:20:49] fwaokda: I'm using the sass-bootstrap gem. how can I totally override what's in the @media print ? When trying to print I can't print with background colors
[14:20:51] matthewd: mwlang: Because that's your timezone? :/
[14:21:40] mwlang: matthewd: I???m in Pacific Time zone, so I don???t think my own timezone is in play here, esp since I???m instantiating with specific timezones.
[14:22:01] matthewd: mwlang: Okay, s/your/your configured/
[14:22:26] pawnbox: has joined #RubyOnRails
[14:23:46] mary5030: has joined #RubyOnRails
[14:24:30] moeabdol: has joined #RubyOnRails
[14:24:47] mwlang: matthewd: The timezone is configured as 'Eastern Time (US & Canada)??? so why would the tests sometimes need ???-05:00??? and other times ???-04:00???? wouldn???t they all be one or the other and not both?
[14:25:52] matthewd: mwlang: DST?
[14:25:55] sankaber: has joined #RubyOnRails
[14:26:05] adaedra: This thing is annoying as hell when programming.
[14:26:07] tetraktys: has joined #RubyOnRails
[14:26:13] mary5030: has joined #RubyOnRails
[14:26:42] mwlang: Daylight Saving Time? Wouldn???t it change seasonally? Not within a single test run?
[14:26:49] zworks: has joined #RubyOnRails
[14:27:18] matthewd: Right.. depending on the date you're using
[14:27:41] sergey_makagon: has joined #RubyOnRails
[14:27:56] adaedra: Because it really looks like it, Eastern Time alternates between -5 and -4
[14:28:13] zworks: I set session data via multiple post requests, but when i try to access those data in the next request , some session data is missing/nil
[14:28:23] zworks: I use activerecord session-store
[14:28:34] zworks: any ideas to fix this issue?
[14:29:20] ddv: zworks: what kind of data is this?
[14:29:31] ddv: zworks: also are you redirecting to different domains?
[14:30:26] zworks: no, let me explain what actually happens there
[14:31:14] zworks: it's the file uploading feature, using jquery uploader, each selected file is uploaded immediately and the app stores the tempfile name in the session
[14:31:47] unl0ckd: has joined #RubyOnRails
[14:31:58] zworks: after it has finished all the requests, when the user clicks the save button, it's when i try to access all the previously submited data
[14:32:09] artto: has joined #RubyOnRails
[14:32:14] ddv: zworks: this is a multi step form?
[14:32:25] zworks: but some file names are missing in the session
[14:32:40] zworks: not multi step form
[14:33:26] zworks: the user is on the same page, but each file is sent seperatley immediately as the user selects the file, the app caches the file and stores the filename in the session
[14:34:13] rvanlieshout: you know carrierwave has support for this?
[14:34:16] zworks: each request returns the filename which stored on the session, so when the save button is clicked, it sends a request to the app with the list of all file names
[14:34:40] solars: has joined #RubyOnRails
[14:34:49] ddv: this is hard to get right to be honest
[14:34:59] zworks: but when i inspect the session in the 'save' request some session keys are missing
[14:35:04] ddv: so better use a gem for this
[14:35:17] zworks: carrierwave support for what ?
[14:35:27] zworks: I am already using carrierwave
[14:35:28] rvanlieshout: redisplay of form
[14:35:36] rvanlieshout: storing the file in a temp place
[14:36:03] zworks: do you know the name for that specific feature or any docs link you know?
[14:36:35] sankaber: has joined #RubyOnRails
[14:36:39] rvanlieshout: https://github.com/carrierwaveuploader/carrierwave#making-uploads-work-across-form-redisplays
[14:36:45] zworks: I think this is rather an issue with rails session
[14:36:54] railsForDaiz: has joined #RubyOnRails
[14:37:04] zworks: no idea, why some data is missing in the very next request !!
[14:37:07] KensoDev: has joined #RubyOnRails
[14:37:22] rvanlieshout: zworks: have you checked the result of your http request? and the log?
[14:38:06] stannard: has joined #RubyOnRails
[14:38:20] zworks: when i send requests to store the filenames in session it successfully stores and returns the stored session keys
[14:38:25] mwlang: Ok, I think I found the problem. The offset is a constant in the code. Is there a way to get the current offset of a timezone given it???s name? i.e. 'Eastern Time (US & Canada)??? => ???-05:00???
[14:38:34] zworks: but in the 'save' request all those data is sent to the app
[14:38:47] sandstrom: has joined #RubyOnRails
[14:38:52] zworks: when i debug it, i see some of those session data is missing
[14:39:11] ddv: zworks: are you not overwriting the session?
[14:39:33] ddv: zworks: drop byebug or pry in there in step through it
[14:39:38] zworks: I am not overriting explicitly, not sure it gets overwritten by rails for some reason
[14:39:48] zworks: yes am using pry
[14:40:03] zworks: that's how i noticed session data is missing
[14:40:28] zworks: when i try each time with the same set of files, each time a random set of files is missing
[14:40:28] matthewd: mwlang: As we just discussed, you can't get from 'Eastern..' to '-05:00', because sometimes it's '-04:00'
[14:40:39] matthewd: mwlang: Code please
[14:40:56] zworks: you mean to check session reset using pry?
[14:41:08] giom: has joined #RubyOnRails
[14:41:09] zworks: How can i check if my session is reset ?
[14:41:17] mwlang: matthewd: I???m looking to make it ???real-time??? instead of a hard-coded -5 in the code. I think I found it uzing the tz.current_period
[14:41:40] techsethi: has joined #RubyOnRails
[14:42:31] matthewd: mwlang: I don't think your interpretation of what's wrong matches the problem you're actually having, but I can only guess without seeing the code
[14:43:05] pyemkey: has joined #RubyOnRails
[14:43:26] mwlang: matthewd: basically, we???re getting date and times in string format from a SOAP client. there???s a method to parse the incoming date/times to a Ruby DateTime class.
[14:43:53] mwlang: the code is tacking on a hard-coded +5 to ???push??? that date/time to UTC
[14:44:15] matthewd: That seems like a bad idea
[14:45:02] mwlang: so what strategy would you use to turn string data into DateTime?
[14:45:09] matthewd: Code please
[14:45:32] jtong: has joined #RubyOnRails
[14:45:41] chrisarcand: mwlang: Do you not get any indication from the format given by the SOAP client as to its offset?
[14:46:05] mwlang: none, otherwise I would bank on it.
[14:46:45] mwlang: The SOAP client is a rather poorly written one that we just have to deal with since it???s out of our control.
[14:47:31] pyemkey: Hello. I am curious about get some feedback about my association structure. Let's say I have a Cv. This cv has many skills. I would like to manage visibility of the skills on cv not by each one, but by a group/section. For example I decided that skill section will be hidden. I prepared gist https://gist.github.com/pyemkey/91b428b8e5372d6722fc Gist contains how associations looked before adding visibility feature. I woul
[14:47:31] pyemkey: d be appreciate if anyone give some feedback about my way of thinking.
[14:47:36] mwlang: but we know that all times are being generated from Eastern Time so we???re making the assumption.
[14:48:10] ddv: pyemkey: grouping skills via another model, maybe a category model
[14:48:14] matthewd: mwlang: ActiveSupport::TimeZone["Eastern Time (US & Canada)"].parse(string_as_supplied_without_explicit_offset)
[14:48:39] jottr: has joined #RubyOnRails
[14:48:42] jscheel: has joined #RubyOnRails
[14:48:44] stardiviner: has joined #RubyOnRails
[14:48:52] sandstrom: has joined #RubyOnRails
[14:48:55] matthewd: mwlang: Or Time.zone.parse(..), given you're setting Eastern as your app TZ
[14:49:08] AntiSpamMeta: has joined #RubyOnRails
[14:49:09] mwlang: The gist: https://gist.github.com/mwlang/6887e2c679b5a486bc0e
[14:49:45] pyemkey: ddv: Actually I would like to have two states. Show skills or not. I will not manage skill by unit, but a whole group.
[14:50:00] ddv: pyemkey: yeah so add a join model
[14:50:09] ddv: pyemkey: with a state field
[14:50:29] pyemkey: ddv: could you look into gist file https://gist.github.com/pyemkey/91b428b8e5372d6722fc
[14:50:34] polishdub: has joined #RubyOnRails
[14:51:38] ddv: pyemkey: seems like you're almost there, but a simple join model should be enough between cv and skill (don't overthink this)
[14:51:46] aegis3121: has joined #RubyOnRails
[14:53:11] matthewd: mwlang: Yeah, at a glance, I'm not seeing what TimeZone#parse would fail to handle there
[14:54:14] matthewd: mwlang: I'm also slightly intrigued that your API can apparently sometimes return any/all of Date, DateTime, Time, and String -- and that you care to maintain the Date/DateTime/Time distinction on the way out
[14:55:45] noodman: has joined #RubyOnRails
[14:57:16] pyemkey: ddv: I added after_revision file to previous gist. So you think it's enough for my problem?
[14:57:51] ddv: pyemkey: Looks good to me. That should do it.
[14:58:32] M-shine: has joined #RubyOnRails
[14:58:38] n00bDev: has joined #RubyOnRails
[14:59:08] pyemkey: ddv: How would you check that skill as a group is visible or not? By simple checking any? visible: true
[14:59:10] mwlang: matthewd: the SOAP clients that are talking to the server are fairly inconsistently implemented. So we???re using this method to ???normalize??? the dates and times coming in. We???re preserving as much info as possible. When it???s already a DateTime, we???ll turn it into a Date object. When it???s a String, we???ll turn it into a Time object. If the time is all zeros, we drop it down to a Date.
[14:59:33] ddv: pyemkey: add a state field?
[14:59:48] pyemkey: state field for cv?
[14:59:55] ddv: pyemkey: no for the join model
[14:59:57] mwlang: matthewd: so it makes it far easier to deal with further along in processing and storing that data.
[15:00:27] pyemkey: ddv: this state field give me info about skill as an unit
[15:00:33] matthewd: mwlang: Overriding the TZ inside an already-built Time/DateTime seems surprising... though if the data definitely requires you to do so, I guess you don't have another choice
[15:00:55] ddv: pyemkey: pick a descriptive name like visibility and put it on the join model
[15:01:03] ddv: or visible
[15:01:03] matthewd: mwlang: I believe the above #parse should be able to deal with your whole String case, though
[15:01:38] pyemkey: ddv: actually this is a case what I provided to gist
[15:01:47] ddv: pyemkey: let me look again
[15:01:48] mwlang: matthewd: I like it. I???m looking into simplifying this code using your approach.
[15:02:09] ddv: pyemkey: yeah
[15:02:15] ElFerna_: has joined #RubyOnRails
[15:04:12] forgottenleaf: has joined #RubyOnRails
[15:06:08] durexlw: Anyone has an idea how I can do this with active record query? "SELECT COUNT(DISTINCT persnr), year, month FROM contracts WHERE equivalent > 0 GROUP BY month_counter"
[15:06:41] suchness: has joined #RubyOnRails
[15:06:47] rvanlieshout: Contract.where('equivalent > 0').group(:month_counter).pluck('COUNT(DISTINCT persnr), year, month)
[15:06:49] matthewd: durexlw: Isn't that what you were already doing?
[15:06:50] rvanlieshout: oh. missing '
[15:06:53] railsForDaiz: has joined #RubyOnRails
[15:07:21] durexlw: matthewd: nah, it lacked the distinct
[15:07:28] adavia: has joined #RubyOnRails
[15:07:35] durexlw: I tried several things, but I never get the right query
[15:08:05] msyvich: has joined #RubyOnRails
[15:08:22] rikkipitt: has joined #RubyOnRails
[15:08:54] rikkipitt: hey everyone. i was wondering if any of you have done locale based rails apps. e.g. if you're in the UK you get the .co.uk version else .com
[15:09:26] qejk: has joined #RubyOnRails
[15:09:41] rikkipitt: I'm thinking of using cloudflare for the IP detection, but was wondering if it's best to add locales to the single app or duplicate. duplicating sounds bad to me though... but adding locales might get messy?
[15:09:43] durexlw: matthewd: this one gives the closest result: "Contract.select("persnr").distinct.select("jaar, maand, count(persnr) as aantal_koppen").where('equivalent > 0').group("maand_teller")" but still, it's wrong
[15:10:31] matthewd: durexlw: Yeah, I think you'll need to put the distinct into the count call directly
[15:10:35] tbuehlmann: durexlw, have you tried this? http://www.scuttle.io/
[15:11:32] durexlw: matthewd: "Contract.select("COUNT (DISTINCT persnr), jaar, maand").where('equivalent > 0').group("maand_teller")" doesn't quite do it either
[15:12:23] w0bni: has joined #RubyOnRails
[15:12:39] durexlw: tbuehlmann: if this is the correct query: "Contract.select( [ Contract.arel_table[:persnr].count, :year, :month ] ).where(Contract.arel_table[:equivalent].gt(0)).group(:month_counter)" then I'd never had that one figured out anyway :)
[15:12:48] matthewd: durexlw: Okay, what does that produce?
[15:13:09] techsethi: has joined #RubyOnRails
[15:13:43] durexlw: matthewd: there's contracts. But people can have more than one contract. I need to count the individual people, so I can do that only by distinct persnr (persnr = unique identifier for a person)
[15:13:45] w0bni: has joined #RubyOnRails
[15:13:49] alphaatom: has joined #RubyOnRails
[15:13:58] arthropododo: has joined #RubyOnRails
[15:14:18] durexlw: that query gives grouped per month the count of each distinct individual that has a contract
[15:14:50] durexlw: basicly: it's counting "how many actual people do I have in this business, regardless of how many contracts thay have"
[15:15:31] matthewd: durexlw: What SQL is the above Contract.select(..) etc running, which differs from what you want?
[15:15:35] underplank: has joined #RubyOnRails
[15:15:42] korzybski: has joined #RubyOnRails
[15:17:26] durexlw: matthewd: closer inspection: it seems to produce the correct result
[15:17:39] durexlw: isn't there a way to see in the debugger the actual result an AR query gives?
[15:17:56] hcnewsom: has joined #RubyOnRails
[15:20:40] durexlw: matthewd: query works
[15:21:28] askhat: has joined #RubyOnRails
[15:21:56] baweaver: has joined #RubyOnRails
[15:23:42] maesitos: has joined #RubyOnRails
[15:24:16] macsteps: has joined #RubyOnRails
[15:28:10] dexter_: has joined #RubyOnRails
[15:28:17] ryanRT: has joined #RubyOnRails
[15:29:45] ryanRT: has left #RubyOnRails: ()
[15:30:04] rogue_koder: has joined #RubyOnRails
[15:30:15] Devalo: has joined #RubyOnRails
[15:33:02] adre: has joined #RubyOnRails
[15:33:33] Sylario: has joined #RubyOnRails
[15:34:03] Sylario: I have a gem (that i created) used in my project. I want my gem to be able to output logs. How do i mak a gem output log in the main rails app? I tried Rails.logger but it does not works
[15:34:30] Sylario: Also when i do a search i only find gem dedicated to logs :/
[15:35:48] tubbo: sylario: what happens when you try Rails.logger?
[15:35:56] Sylario: tubbo: nothing
[15:36:10] Sylario: neither in the server or the log/dev
[15:36:15] tubbo: that's interesting
[15:36:21] tubbo: sylario: so the logs are going *somewhere*, but you can't see them
[15:36:39] Ergo: has joined #RubyOnRails
[15:37:07] tubbo: because that means Rails.logger is actually set to something, a Logger object of some kind, otherwise it would go `undefined method 'info' for nil:nilClass`...that's what happens if you try to use Rails.logger before actually initializing a Rails app (Rails.configuration.logger, I believe, is what configures Rails.logger)
[15:37:22] macsteps: has joined #RubyOnRails
[15:38:12] tubbo: sylario: https://gist.github.com/tubbo/2582eaa37e932d9cc8b1
[15:38:28] tubbo: if you're not getting that error, then Rails.logger must be set to something.
[15:38:41] rubyonrailed: has joined #RubyOnRails
[15:38:45] Sylario: i am trying that
[15:39:41] atrius: has joined #RubyOnRails
[15:40:54] railsForDaiz: has joined #RubyOnRails
[15:43:25] rickmasta: has joined #RubyOnRails
[15:44:19] lindii_: has joined #RubyOnRails
[15:44:30] norc_: has joined #RubyOnRails
[15:47:45] sandstrom: has joined #RubyOnRails
[15:48:27] sloggerkhan: has joined #RubyOnRails
[15:48:58] c0defeed: has joined #RubyOnRails
[15:52:04] pyemkey: I have a join model with additional column visibility. How can I pass collection with additional param. Let's say something like this @cv.cv_skills.build(skill: @skills, visibility: false). Do you have any pattern to do this?
[15:53:12] pyemkey: I know that without additional column I can just call @cv.skills << @skills
[15:53:36] pyemkey: but in my case join table has additional column
[15:56:59] FooMunki: has joined #RubyOnRails
[15:57:25] DmitryBochkarev: has joined #RubyOnRails
[15:57:57] underplank: has joined #RubyOnRails
[16:01:45] stannard_: has joined #RubyOnRails
[16:02:44] bronson: has joined #RubyOnRails
[16:02:52] nettoweb: has joined #RubyOnRails
[16:03:08] durexlw: sup Terens
[16:03:21] durexlw: pyemkey: not sure if I understand your question. What is it you want to do?
[16:04:52] Terens: I want to make an that plain users place requests and managers view then and respond
[16:05:06] Terens: should I make two controllers for Request ?
[16:05:15] pyemkey: durexlw: I would like to simplify this https://gist.github.com/pyemkey/296d1a6c424b1b1fea2f
[16:08:37] sonofdirt: has joined #RubyOnRails
[16:08:55] M-shine: has joined #RubyOnRails
[16:09:38] emachnic: has joined #RubyOnRails
[16:10:09] chouhoulis: has joined #RubyOnRails
[16:10:26] durexlw: pyemkey: you know about nested resources and how to make forms for them?
[16:10:39] emachnic: has joined #RubyOnRails
[16:11:24] durexlw: Terens: I guess one controller is enough: you have a view for the request and you have conditional things showing or hiding based on the kind of user accessing them
[16:11:52] fwaokda: I'm attempting to aggregate columns of my records, and I'm getting a "missing attribute: " error. Anyone can point me in the direction of why I'm getting this? https://gist.github.com/daveomcd/c226338950f3603ac60d
[16:12:23] sonalkr132: has joined #RubyOnRails
[16:12:34] arBmind1: has joined #RubyOnRails
[16:13:04] durexlw: fwaokda: can you post the query AR is making of this?
[16:14:01] rikkipitt: has joined #RubyOnRails
[16:14:06] fwaokda: durexlw, sure thanks, added to the link
[16:14:29] rikkipitt: Hey everyone, when does `request` become available to use? I'm trying to use request.remote_ip in my application contoller to no avail...
[16:14:32] emachnic: has joined #RubyOnRails
[16:14:46] pyemkey: durexlw: I need to be more clear. I have input where I can provide many skills separated by comma. Profile has many skills through ProfileSkill table. I only want to know how can i simplify this part https://gist.github.com/pyemkey/296d1a6c424b1b1fea2f#file-x-rb-L7-L9 BTW I know about nested resources
[16:15:34] arBmind1: has joined #RubyOnRails
[16:16:38] durexlw: fwaokda: I'm kinda getting the impression NcaaDefensiveStatistic belongs_to ncaa_game_id ?
[16:16:51] fwaokda: durexlw, yes ncaa_game
[16:17:06] chouhoulis: has joined #RubyOnRails
[16:17:13] durexlw: fwaokda: make sure it's present... it's a bit of a long shot, but I'm getting the impression for this record, the relation is missing. Maybe AR is freaking on that
[16:17:24] durexlw: ... long shot, but worth checking
[16:17:39] fwaokda: durexlw, ok I'll do that now - thanks a bunch for looking at it!
[16:18:46] durexlw: pyemkey: what would you like to simplify?
[16:20:29] pyemkey: durexlw: passing visibility state into creation.
[16:21:00] Terens: has left #RubyOnRails: ()
[16:21:55] arup_r: has joined #RubyOnRails
[16:22:35] durexlw: pyemkey: I get the sense I'm missing info to understand you. So you have skills and skills can either be visible or not?
[16:22:54] durexlw: I have to run. Hope someone else can help you. Laterz all!
[16:23:34] worknick: has joined #RubyOnRails
[16:23:49] worknick: != is a valid not equal to in rails right?
[16:24:11] pyemkey: dualbus: I would like manage skills not by unit but by group. During creation I want to setup visibility based on previous skills.
[16:24:22] dsimon: worknick, you mean, generally in ruby?
[16:24:34] worknick: in rails view. index.html.erb
[16:25:09] tonios57: has joined #RubyOnRails
[16:25:30] dsimon: yeah, you can embed any ruby code into erb
[16:25:52] dsimon: are you getting a syntax error or something like that?
[16:25:59] M-shine: has joined #RubyOnRails
[16:26:24] worknick: dsimon: no the if not equal was failing. now i found out the input data itself is blank.
[16:26:49] cschneid_: has joined #RubyOnRails
[16:28:04] c0defeed: What is the difference between <%= and <% in an .erb file
[16:28:13] emachnic: has joined #RubyOnRails
[16:28:28] emachnic: has joined #RubyOnRails
[16:29:22] worknick: c0defeed: <%= prints it on the page <% is for not printing statemets like if
[16:29:23] adaedra: <% will just execute code, <%= will print the result to the output
[16:29:41] emachnic: has joined #RubyOnRails
[16:29:42] c0defeed: worknick, adaedra thanks
[16:31:20] emachnic: has joined #RubyOnRails
[16:31:21] ryanRT: has joined #RubyOnRails
[16:32:01] emachnic: has joined #RubyOnRails
[16:32:21] emachnic: has joined #RubyOnRails
[16:33:11] emachnic: has joined #RubyOnRails
[16:34:03] sonalkr132: has joined #RubyOnRails
[16:34:51] nerium: has joined #RubyOnRails
[16:35:30] disgrntld: has joined #RubyOnRails
[16:37:05] techsethi: has joined #RubyOnRails
[16:37:08] emachnic: has joined #RubyOnRails
[16:38:48] godzillaenlacasa: What's a good way to trim a JSON response? I'm getting ["a", "b", "c"] back, but really need a,b,c (no brackets or quotes)
[16:40:00] n1lo: has joined #RubyOnRails
[16:40:59] n00bDev: has joined #RubyOnRails
[16:41:36] kirillzh: has joined #RubyOnRails
[16:42:31] qejk: has joined #RubyOnRails
[16:42:44] ziyadb: has joined #RubyOnRails
[16:43:02] havenwood: godzillaenlacasa: ["a", "b", "c"].join(",") #=> "a,b,c"
[16:44:43] claytonzaugg: has joined #RubyOnRails
[16:45:32] sonalkr132_: has joined #RubyOnRails
[16:46:21] godzillaenlacasa: @havenwood ah, i was getting an error earlier because my array was already converted to a string... removed that and twas fixed!
[16:46:35] godzillaenlacasa: @havenwood any way to get rid of the commas in the same line?
[16:46:55] godzillaenlacasa: @havenwood replace them with a space instead?
[16:47:10] havenwood: godzillaenlacasa: join(" ")
[16:47:12] emachnic: has joined #RubyOnRails
[16:47:36] railsForDaiz: has joined #RubyOnRails
[16:48:39] havenwood: godzillaenlacasa: Or say more about what return value you want. It seems you have an Array of Strings and want to join them into a single String?
[16:48:49] rubyonrailed: has joined #RubyOnRails
[16:49:01] pawnbox: has joined #RubyOnRails
[16:50:20] godzillaenlacasa: @havenwood yeah, they're actually IP addresses: ["10.10.10.2", "10.10.10.1"] ... think I got it though: ["10.10.10.2", "10.10.10.1"] .join(", ").gsub(",", "") => 10.10.10.2 10.10.10.1
[16:50:45] havenwood: godzillaenlacasa: Why add the comma and then remove it?
[16:50:59] havenwood: godzillaenlacasa: join(" ")
[16:51:50] godzillaenlacasa: I don't intentially add the comma... acts_as_taggable_on does that
[16:52:00] aegis3121: has joined #RubyOnRails
[16:52:11] PedramT: has joined #RubyOnRails
[16:52:40] benlieb: has joined #RubyOnRails
[16:52:43] godzillaenlacasa: @havenwood oh, i see what you're saying.
[16:55:10] ElFerna_: has joined #RubyOnRails
[16:55:42] cih: has joined #RubyOnRails
[16:56:06] NeoHamled: has joined #RubyOnRails
[16:56:47] Macaveli: has joined #RubyOnRails
[16:56:49] Pumukel: has joined #RubyOnRails
[16:56:58] underplank: has joined #RubyOnRails
[16:58:17] Pazician: has joined #RubyOnRails
[16:58:19] Zadrel: has joined #RubyOnRails
[17:00:02] emachnic: has joined #RubyOnRails
[17:02:20] openstruct: has joined #RubyOnRails
[17:04:25] benlieb: has joined #RubyOnRails
[17:05:23] Terens: has joined #RubyOnRails
[17:05:30] efy: has joined #RubyOnRails
[17:05:44] Terens: how can I add class html property to this ?
[17:05:45] Terens: <%= f.select :description, options_from_collection_for_select(@users, 'id', 'name'),{ class: "ui search dropdown"} %>
[17:05:49] Terens: it doesnt work
[17:07:14] jottr: has joined #RubyOnRails
[17:07:17] wldcordeiro: has joined #RubyOnRails
[17:07:43] msyvich: has joined #RubyOnRails
[17:07:49] tbuehlmann: Terens, add an empty hash between: f.select :description, options_from_collection_for_select(@users, 'id', 'name'), {}, {class: "ui search dropdown"}
[17:07:52] mickey_mouse_2: has joined #RubyOnRails
[17:08:50] Terens: hm thanks
[17:09:13] Terens: is there any way to break it into multiple lines? because it doesnt work
[17:09:33] tbuehlmann: what does "doesn't work" mean exactly?
[17:09:39] cih: has joined #RubyOnRails
[17:09:45] worknick: is this correct <%= distance_of_time_in_words_to_now(pa.created_at,options={include_seconds: true})%>
[17:10:03] worknick: its not printing anything on page.
[17:10:21] keekri: has left #RubyOnRails: ()
[17:11:07] tbuehlmann: <%= distance_of_time_in_words_to_now(pa.created_at, include_seconds: true) %> should suffice and work
[17:11:58] Technodrome: has joined #RubyOnRails
[17:14:20] emachnic: has joined #RubyOnRails
[17:14:46] emachnic: has joined #RubyOnRails
[17:16:01] worknick: tbuehlmann: that works. thanks.
[17:16:05] emachnic: has joined #RubyOnRails
[17:17:06] emachnic: has joined #RubyOnRails
[17:17:20] emachnic: has joined #RubyOnRails
[17:17:28] pawnbox: has joined #RubyOnRails
[17:18:29] AzaToth: has joined #RubyOnRails
[17:19:35] dretnx: has joined #RubyOnRails
[17:23:04] baweaver: has joined #RubyOnRails
[17:23:38] pawnbox: has joined #RubyOnRails
[17:24:15] claytonzaugg: has joined #RubyOnRails
[17:24:39] maesitos: has joined #RubyOnRails
[17:25:25] mwlang: matthewd: thanks for help on the timezone stuff.
[17:25:44] railsForDaiz: has joined #RubyOnRails
[17:25:55] matthewd: mwlang: No worries! Hopefully you were able to end up with something a bit shorter
[17:25:56] mwlang: now have a better implementation and consistent spec behavior no matter DST period
[17:26:39] mwlang: yeah, the ActiveSupport::TimeZone stuff is good???I did some reading up and learned a few new tricks.
[17:29:19] EkoZap: has joined #RubyOnRails
[17:29:37] giom: has joined #RubyOnRails
[17:30:54] Maletor: has joined #RubyOnRails
[17:31:33] manfrin: has joined #RubyOnRails
[17:31:47] Devalo: has joined #RubyOnRails
[17:33:01] triptec: has joined #RubyOnRails
[17:33:45] EkoZap: has left #RubyOnRails: ()
[17:34:06] EkoZap: has joined #RubyOnRails
[17:35:11] EkoZap: Hello, i have a question about unless statement
[17:35:49] EkoZap: Do unless statement like this: unlesss condition && condition can lead to trouble?
[17:36:34] tbuehlmann: I don't use `unless` when having more than one condition, but it will work
[17:38:13] davidcelis: EkoZap: what kind of trouble
[17:38:18] EkoZap: ok, because maybe its my code, but with this unless with 2 condition that dont seem to hit, so i just ask to know if in this case i need to put between () or just use if !
[17:38:42] safety_cut: has joined #RubyOnRails
[17:39:02] Surt_Q: has joined #RubyOnRails
[17:39:02] EkoZap: If unless and if are the same but just need false and true to be hit, its my code then
[17:39:06] tubbo: EkoZap: what's the line of code that is screwed up?
[17:39:10] mwlang: EkoZap: I would only use ???unless??? for a simple conditional. All too often developers flip the meaning of compound expressions in their minds.
[17:39:27] EkoZap: well, i can copy and paste, but that will problably dont help you
[17:39:32] EkoZap: give me a minute
[17:39:54] EkoZap: unless profile.disable_super && blocked
[17:40:11] EkoZap: i want if both are false, then continue
[17:40:12] mwlang: if I really want ???unless??? and I need to assert two or three things, then I wrap those two or three things into a method.
[17:40:35] baweaver: has joined #RubyOnRails
[17:40:57] mwlang: EkoZap: in your case, I might write a def profile_active? and then call ???unless profile_active????
[17:41:10] davidcelis: yeah, extract that
[17:41:26] corioliss: has joined #RubyOnRails
[17:41:29] EkoZap: ah no, its just a condition inside a def
[17:41:54] EkoZap: im not enough pro to try to extract all my code hehe
[17:42:06] AnomalousBit: has joined #RubyOnRails
[17:42:20] EkoZap: I just need to fix this bug before put my website in beta mode on a server
[17:43:24] mwlang: EkoZap: if you had a bug here, then that???s definitely indicative using unless A && B was confusing. ;-)
[17:43:56] EkoZap: My mainly question was, when i use Unless, do the first condition are fixed to unless and the next after && become fixed also to unless or maybe the second one can be fixed to if?
[17:44:05] slash_nick: ^... and god forbid, `unless A && B` with else/elsif
[17:44:06] ryanRT: has left #RubyOnRails: ()
[17:44:19] stannard: has joined #RubyOnRails
[17:44:23] hierbabuena: has joined #RubyOnRails
[17:44:42] rhizome: unless doesn't have else/if
[17:45:01] EkoZap: ok i will try to put if not and see if the bug continue
[17:45:11] EkoZap: thx for your time
[17:45:49] rhizome: ruby tutorial!
[17:46:01] slash_nick: rhizome: doesn't it? 2.3.0 :006 > unless true; puts false; else; puts true; end #=> true
[17:46:17] Devalo: has joined #RubyOnRails
[17:46:32] safety_cut: has joined #RubyOnRails
[17:46:56] slash_nick: rhizome: ah, but no elsif
[17:47:04] mwlang: slash_nick: you mean like this? https://gist.github.com/mwlang/ea8a141cb10a4b6f7aa1 :-D
[17:47:53] slash_nick: mwlang: exactly... except the unless conditional is simple there
[17:47:59] slash_nick: STILL a PITA
[17:48:33] eljimmy: has joined #RubyOnRails
[17:48:46] rhizome: frankly i didn't think it even had else, half mea culpa
[17:49:24] elbigode: has joined #RubyOnRails
[17:49:55] mwlang: slash_nick: indeed, but that???s some freakessly hard code to consistently mentally interpret correctly.
[17:50:00] rubyonrailed: has joined #RubyOnRails
[17:50:04] rhizome: brb writing #butwhatabout
[17:50:15] zworks: has joined #RubyOnRails
[17:50:31] elbigode: has left #RubyOnRails: ()
[17:50:37] openstruct: has joined #RubyOnRails
[17:52:02] rhizome: mwlang: watch this: https://www.youtube.com/watch?v=8bZh5LMaSmE
[17:52:23] zworks: Redis says it's in-memory data structure store, does that means all the session data is stored in the RAM?
[17:52:56] rakm: has joined #RubyOnRails
[17:53:09] rhizome: i guess so. how much session data do you have?
[17:53:12] tubbo: zworks: for the most part, yes. i think redis will write to disk in between reboots.
[17:53:20] dopie: has joined #RubyOnRails
[17:53:59] sandstrom: has joined #RubyOnRails
[17:54:16] EkoZap: if !profile.disable_super && !blocked
[17:54:20] korzybski: has joined #RubyOnRails
[17:54:22] EkoZap: That have solved my problem
[17:54:33] EkoZap: So, unless have something shitty
[17:54:57] zworks: mm, then i am concerned about using Redis for caching and session data, because the capacity will depend on the ram size right?
[17:55:11] tubbo: EkoZap: i think it's because you're testing `true && true` this time, whereas last time you were testing `false && false`.
[17:55:33] zworks: I have read that using memory to store session data have disadvantages such as users can get logged out if app runs out of memory,
[17:55:39] EkoZap: i put ! in each condition, so its the same no?
[17:55:59] rhizome: then don't use redis
[17:56:10] tubbo: EkoZap: not really. each of those conditions are their own expression. so it's really ((exp1) && (exp2)) to Ruby
[17:56:12] pyemkey: I have a problem with designing associations. I would like to add multiple skills at once. Also, I would like to mark skills as visible or not. Visibility should be used per group not per unit. For example when i hit lock button, all skills shoud be invisible. I'm curious what do you think about this https://gist.github.com/pyemkey/49716fc68f9bd9e95f8e
[17:56:30] tubbo: EkoZap: however, (false && false) is just one expression. i think that *might* be why you're seeing the issue?
[17:56:36] tubbo: EkoZap: i'm just speculating here fwiw
[17:57:07] tubbo: zworks: that's never been a problem for us but then again, we log out users after a certain period of inactivity :)
[17:57:10] EkoZap: unless profile.disable_super && blocked VS if !profile.disable_super && !blocked
[17:57:21] EkoZap: What is the main difference?
[17:57:23] tubbo: for those systems that *don't* do that, we also don't lose session data in between deploys or restarts of redis
[17:57:58] macsteps: has joined #RubyOnRails
[17:58:25] nogic: has joined #RubyOnRails
[17:58:57] zworks: but for an average sized app, how much memory you think needed to keep things smooth ?
[17:59:45] hbr: has joined #RubyOnRails
[18:00:19] DoubleMalt: has joined #RubyOnRails
[18:00:23] msyvich: has joined #RubyOnRails
[18:00:49] zworks: With my understanding i think, sessions will be kept in memory while a specific user is accessing the site, ( until they close the browser tab )
[18:01:49] zworks: So the memory extra memory size will depend on the number of concurrent users of the app multiplied by average session data size?
[18:02:08] sleungcy: has joined #RubyOnRails
[18:02:16] tubbo: zworks: no, the session is kept in memory until a.) the user logs out or b.) it expires
[18:02:19] Dios|afk: has joined #RubyOnRails
[18:02:22] tubbo: not just when the user accesses the site
[18:02:37] tubbo: for example, you're probably logged into facebook.com right now but you're not on the site.
[18:03:03] KensoDev: has joined #RubyOnRails
[18:03:19] ElFerna_: has joined #RubyOnRails
[18:03:32] zworks: yep i agree
[18:04:16] zworks: so the active sessions multiplied by avg session size, extra memory needed right ?
[18:05:12] railsForDaiz: has joined #RubyOnRails
[18:05:53] rhizome: ACTION doesn't understand the question
[18:06:54] goodcodeguy: has joined #RubyOnRails
[18:07:16] zworks: Ok, i decided to go with Redis after doing the math
[18:07:33] tubbo: imho redis is a great solution if you're using it for other stuff
[18:07:35] zworks: The session data doesn't seem much extra space on the RAM
[18:07:40] tubbo: sessions, rails cache, http cache, etc.
[18:07:45] tubbo: yeah its' not
[18:07:48] tubbo: it's not*
[18:08:06] tubbo: zworks: not sure why you care so much about it though :)
[18:08:08] rhizome: until you start storing their friends list there
[18:08:44] zworks: haha, the thing is at first i got the impression that data is stored on the ram instead of disk, so i was concerned
[18:09:14] Hans267: has joined #RubyOnRails
[18:09:14] zworks: but now just did some rough calculations and found that it's just an extra GB or two on RAM
[18:10:04] tubbo: yeah, if that
[18:10:33] tubbo: like i don't even need 20mb *for my entire redis store* on a small-scale site.
[18:11:01] mwlang: rhizome: great video. thanks for sharing.
[18:11:02] aegis3121: has joined #RubyOnRails
[18:12:59] chouhoulis: has joined #RubyOnRails
[18:13:41] slash_nick: mwlang: i didn't have the video up at first (just heard audio)... thought it was launching an episode of the cleveland show
[18:14:25] moeabdol: has joined #RubyOnRails
[18:14:48] dopamean_: has joined #RubyOnRails
[18:16:04] nozpheratu: has joined #RubyOnRails
[18:16:52] mfaeh: has joined #RubyOnRails
[18:17:28] ryanRT: has joined #RubyOnRails
[18:18:12] PedramT: has joined #RubyOnRails
[18:18:27] ryanRT: has left #RubyOnRails: ()
[18:18:31] Dios: has joined #RubyOnRails
[18:18:33] [BNC]WizJin: has joined #RubyOnRails
[18:19:19] zworks: tubbo, do you recommend using dalli on rails?
[18:19:32] tubbo: zworks: dalli if you're using memcache.
[18:19:40] zworks: btw, how can i mention a name here? :)
[18:20:42] slash_nick: zworks: you just did it... you can probably tab-complete people's nicknames after typing a few characters
[18:22:02] zworks: slash_nick: hi :) mike testing 1, 2, ..:)
[18:22:22] slash_nick: zworks: it workz :D
[18:22:22] rgtk: has joined #RubyOnRails
[18:22:30] zworks: great thanks!
[18:23:52] zworks: tubbo: do you have any idea, why rails session information is missing ? I am using activerecord session store
[18:24:06] tubbo: zworks: probably cosmic rays
[18:24:12] tildes: has joined #RubyOnRails
[18:24:19] rhizome: mwlang: cool, glad you liked it. one of my favorites.
[18:24:38] zeknox: has joined #RubyOnRails
[18:24:54] zworks: that might help, thank!
[18:24:59] mfaeh: has left #RubyOnRails: ()
[18:25:10] rhizome: "car won't start. what's wrong?"
[18:25:46] zeknox: what would be a good approach to downloading a screenshot of a highchart image part of a view? Need a PNG or JPG file somewhere stored locally
[18:25:47] yatish27: has joined #RubyOnRails
[18:27:13] drbayer: has joined #RubyOnRails
[18:27:52] triptec: has joined #RubyOnRails
[18:28:01] slash_nick: zeknox: it'd be done with javascript... i'm assuming highchart is using canvas, so something like this http://stackoverflow.com/questions/923885/capture-html-canvas-as-gif-jpg-png-pdf
[18:28:08] mfaeh: has joined #RubyOnRails
[18:28:48] someish: has joined #RubyOnRails
[18:28:59] openstruct: has joined #RubyOnRails
[18:29:41] zeknox: slash_nick: thanks for the link, that might be what im after
[18:29:49] mfaeh: has joined #RubyOnRails
[18:30:17] rhizome: you can have a :jpg and/or :png response type
[18:30:41] zeknox: rhizome: you mean within highchart specifically?
[18:31:42] slash_nick: rhizome: if his/her server were generating the charts or any images, that'd fly...
[18:32:49] arup_r: has joined #RubyOnRails
[18:32:57] nettoweb: has joined #RubyOnRails
[18:33:30] fox_mulder_cp: has joined #RubyOnRails
[18:33:52] mdw: has joined #RubyOnRails
[18:36:26] rhizome: oh, API. i didn't think HC relied on 3rd party, but maybe that's something else.
[18:36:41] arup_r: why will_paginate gives me error like https://gist.github.com/aruprakshit/aa87c3a07564201536a2 ?
[18:37:36] rhizome: because you're using an instance method on a class
[18:38:11] arup_r: that's what I see https://github.com/mislav/will_paginate/tree/3-0-stable#basic-will_paginate-use
[18:38:31] arup_r: rhizome: I think it is a scope in will_paginate and it should work. But it is failing
[18:38:59] rhizome: then maybe it's not a scope the way you think
[18:39:13] arup_r: but, I did as it is shown in the README
[18:39:47] rhizome: dunno. maybe you're not using 3.0
[18:40:25] drbayer: has joined #RubyOnRails
[18:41:15] yatish27: has joined #RubyOnRails
[18:41:19] Watermelon: has joined #RubyOnRails
[18:43:15] dangerousdave: has joined #RubyOnRails
[18:43:33] mordof_work: has joined #RubyOnRails
[18:44:01] wedow: has joined #RubyOnRails
[18:44:36] worknick: i wanted to use https://github.com/peterwillcn/rails4-autocomplete with my Mailboxer on conversation controller index action. i configurted it as per doc, and i get error conversations/autocomplete_user_email?term=test 404 not found
[18:44:47] arup_r: it is 3.0 I checked
[18:44:52] mordof_work: how does rails determine whether a method in a controller (an action) is available? i've got a central controller, and i've got those actions defined as def translate; super; end
[18:44:58] Maletor: Is it possible to OR two subqueries in ActiveRecord or do I need Rails 5 for that? For instance: `User.where(id: [Account.where(id: 4), Account.where(id: 5)])`
[18:45:00] mordof_work: i'd like to find out how to just not define those in the controller
[18:45:25] noodman: has joined #RubyOnRails
[18:45:30] hierbabuena: has joined #RubyOnRails
[18:46:47] baweaver: has joined #RubyOnRails
[18:47:05] edwinvdgraaf: has joined #RubyOnRails
[18:48:47] jxs_: has joined #RubyOnRails
[18:49:18] CowMan: has joined #RubyOnRails
[18:49:54] DmitryBochkarev: has joined #RubyOnRails
[18:50:42] rubyonrailed: has joined #RubyOnRails
[18:53:41] fox_mulder_cp: mordof_work: read guides.rubyonrails.org/active_record_basics.html and http://guides.rubyonrails.org/active_record_querying.html
[18:54:34] CowMan: has left #RubyOnRails: ()
[18:55:12] mordof_work: fox_mulder_cp: wrong person
[18:55:24] mordof_work: maletor: ???^ what fox_mulder_cp said to me
[18:55:35] renegadeandy: has joined #RubyOnRails
[18:56:16] Maletor: it's not documented there. i don't think it's possible
[18:57:44] baweaver: has joined #RubyOnRails
[18:57:48] openstruct: has joined #RubyOnRails
[18:57:48] openstruct: has joined #RubyOnRails
[18:58:41] PedramT: has joined #RubyOnRails
[18:59:14] baweaver: has joined #RubyOnRails
[18:59:32] worknick: i have to add a new controller to bypass devise to allow rails autocomplete plugin to work. what can i do to secure this controller and make it only access request from my own application
[19:00:20] fox_mulder_cp: worknick: all public methods touched by client browser
[19:00:23] drbayer: has joined #RubyOnRails
[19:00:41] fox_mulder_cp: /get, /post and etc
[19:00:43] worknick: fox_mulder_cp: amm?
[19:01:14] worknick: fox_mulder_cp: yes client browser will only sent that request but since devise is out of question how do i make it secure? do i need to worry abuot it or not?
[19:01:30] fox_mulder_cp: u want touch method from localhost from your server?
[19:01:52] worknick: no not localhost
[19:02:22] worknick: internet but its juts get rquest. can be done with curl to get list of users in my db? i want to avoid that
[19:02:38] fox_mulder_cp: worknick: read devise manual first :)
[19:02:46] fox_mulder_cp: it's very easy
[19:03:25] worknick: fox_mulder_cp: thats what i am sayig. i am bypassing devise.
[19:03:28] worknick: its not in picture now.
[19:04:17] fox_mulder_cp: worknick: u disable devise for your controller and want block curl'ed bots which cat get your users from DB?
[19:04:39] worknick: fox_mulder_cp: this specific controller gives list of all users email in my db.
[19:04:47] Cohedrin: has joined #RubyOnRails
[19:04:48] unl0ckd: has joined #RubyOnRails
[19:04:53] worknick: without devise anyone who is not logged in can just get it plaintext
[19:05:02] worknick: fox_mulder_cp: to make https://github.com/peterwillcn/rails4-autocomplete work
[19:05:35] fox_mulder_cp: worknick: bot can be regular user. dot.
[19:05:38] moeabdol: has joined #RubyOnRails
[19:06:07] fox_mulder_cp: it can pass to page, take security token and get databse
[19:06:10] worknick: fox_mulder_cp: but regular user can only access his frieds email. not all email.
[19:06:42] fox_mulder_cp: worknick: and why u take anauthorized access for anyone?
[19:06:44] tubbo: "bypassing devise" to make autocomplete sounds dangerous.
[19:06:51] tubbo: s/make/implement
[19:07:12] fox_mulder_cp: tubbo: thanks for a formula, yep
[19:07:21] worknick: tubbo: someone here reports that only http://stackoverflow.com/questions/23318836/rails-4-jquery-autocomplete-with-devise
[19:07:21] hahuang65: has joined #RubyOnRails
[19:07:41] mhoungbo: has joined #RubyOnRails
[19:07:43] tubbo: oh ok, yeah. i've never used the autocomplete "plugin" for either jQuery or Rails
[19:07:44] stannard: has joined #RubyOnRails
[19:08:11] worknick: tubbo: how do i imelpment it without that?
[19:08:45] fox_mulder_cp: worknick: in asp.net i used autocomplete with method, but it works only for logged in users
[19:09:01] fox_mulder_cp: and filter content for autocomplete by user session data
[19:09:01] baweaver: has joined #RubyOnRails
[19:09:14] tubbo: worknick: i wrote it myself using Rails UJS and jQuery. https://github.com/waxpoetic/brotherly/blob/master/app/assets/javascripts/searches.coffee but this isn't authenticated or anything.
[19:09:38] fox_mulder_cp: u can add scope in devise, which filter emails only for friends of user
[19:10:08] worknick: fox_mulder_cp: scoping is not issue. "autocomplete" is.
[19:10:12] worknick: how to that?
[19:10:33] worknick: shall i provide list of all friends to jq? then jq handles the autocomplete?
[19:10:36] jscheel: has joined #RubyOnRails
[19:11:10] fox_mulder_cp: in get method u can filter data by current user
[19:11:38] tubbo: worknick: the error you're getting doesn't seem to have anything to do with devise.
[19:11:46] worknick: tubbo: right.
[19:11:51] tubbo: worknick: word :) great
[19:11:51] worknick: tubbo: no wait.
[19:11:55] fox_mulder_cp: @article = Article.find_by(id: params[:id])
[19:12:12] fox_mulder_cp: replace id -> your logged-in user
[19:12:16] worknick: tubbo: if i impletent that plugin in any controller while it has before authenticate then it fails
[19:12:29] worknick: fox_mulder_cp: i can already do current_user.friends
[19:12:56] fox_mulder_cp: ... and why u allow autocomplete for not logged-in users?
[19:12:58] jottr_: has joined #RubyOnRails
[19:13:10] fox_mulder_cp: i can know this idea case
[19:13:11] worknick: tubbo: when devise is there , it tries to find :id for that autocomplete path. which is not provided and not needed
[19:13:20] tubbo: worknick: !gist your routes.rb and the controller this is happening on
[19:13:20] helpa: worknick: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[19:13:20] worknick: fox_mulder_cp: i dont want to!
[19:14:04] tildes: has joined #RubyOnRails
[19:14:12] fox_mulder_cp: worknick: and what blocked u to block work this autocomplete for anonymous persone?
[19:14:15] agoldboi: has joined #RubyOnRails
[19:15:01] fox_mulder_cp: all methods exept register and log-in must be secured by devise, anyway
[19:16:11] fox_mulder_cp: if it not publicly allowed
[19:16:17] Watermelon: Hi! I want to contribute to an opensource project, but the most popular ones seem to be a bit too abstract. Is there a way to find something more specific, like, something dealing with healthcare, education or charity?
[19:16:23] hahuang65: has joined #RubyOnRails
[19:16:28] magickid: has joined #RubyOnRails
[19:16:49] fox_mulder_cp: Watermelon: all github projects opened for your contribution :)
[19:17:11] baweaver: https://www.ruby-toolbox.com/
[19:17:18] tubbo: fox_mulder_cp: not what was asked. :)
[19:17:24] tubbo: Watermelon: check out https://github.com/explore
[19:17:42] tubbo: not sure if you'll be able to find much there, since healthcare is traditionally a very closed world
[19:17:46] gingray: has joined #RubyOnRails
[19:17:52] tubbo: they can barely communicate with each other much less the open source world
[19:17:58] baweaver: worked in Healthcare, can confirm
[19:18:29] worknick: fox_mulder_cp: tubbo https://gist.github.com/wrknck/13db03b797651a7188d6
[19:18:30] tubbo: Watermelon: https://github.com/change is change.org's github? :)
[19:18:50] baweaver: could always just go work for a healthcare company too.
[19:18:58] underplank: has joined #RubyOnRails
[19:19:21] Watermelon: Yes, thank you, that is what I was looking for
[19:19:35] tubbo: baweaver: that sounds awful
[19:19:46] goodcodeguy: has joined #RubyOnRails
[19:20:11] fox_mulder_cp: devise - only log in/register/profile
[19:20:12] baweaver: why do you think I say 'worked' instead of 'working'? :)
[19:20:37] fox_mulder_cp: worknick: authorize != authentificate
[19:20:56] fox_mulder_cp: worknick: u must use pundit for grants requirement
[19:21:13] tubbo: you don't HAVE to use pundit, fwiw ^
[19:21:17] tubbo: there are a few options
[19:21:20] tubbo: (i like pundit the best, too)
[19:21:47] Jet4Fire: has joined #RubyOnRails
[19:21:48] fox_mulder_cp: ook, i wrongly say
[19:21:52] SteenJobs: has joined #RubyOnRails
[19:22:06] worknick: fox_mulder_cp: i just showed you the original controller instead of my new controller without devise.
[19:22:08] fox_mulder_cp: pundit one of gems, which can help u with your questioin
[19:22:13] worknick: fox_mulder_cp: this is what i am actually trying to do.
[19:22:39] fox_mulder_cp: worknick: u write your own chat?:)
[19:23:01] ModusPwnens: has joined #RubyOnRails
[19:23:50] ModusPwnens: My controller received a request to download a pdf, but the underlying resource doesn't exist. I want to redirect to a 404, but no matter what I try, the content type of the response is pdf. This causes the browser to try and use a pdf viewer, which is not the best experience.
[19:24:02] worknick: fox_mulder_cp: tubbo please check the gist for updated error file. this error says its trying to find something in Mailboxer::conversation. but i just want it to find users
[19:24:11] ModusPwnens: How do I get the response type to change to html when the pdf download request fails and I want to show an error view?
[19:24:22] lxsameer: has joined #RubyOnRails
[19:24:22] lxsameer: has joined #RubyOnRails
[19:24:27] tubbo: ModusPwnens: what if you did `render text: '', status: :not_found`
[19:24:44] ModusPwnens: I tried that, but with render htm: '<view_name>'
[19:24:53] mdw: has joined #RubyOnRails
[19:24:59] zackzorman: has joined #RubyOnRails
[19:25:15] stannard: has joined #RubyOnRails
[19:25:18] tubbo: hmm...yeah i mean rails typically will use the Content-Type header that the browser sends..
[19:25:26] maesitos: has joined #RubyOnRails
[19:25:30] ModusPwnens: is there a way to change it?
[19:25:35] ModusPwnens: or is that bad form anyways?
[19:25:47] ModusPwnens: it just seems silly to have this pdf viewer with a blank page when it should really be a 404
[19:25:57] ModusPwnens: i've tried a redirect to, but it seems to still keep the original request format
[19:26:06] nettoweb: has joined #RubyOnRails
[19:27:05] edwinvdgraaf: has joined #RubyOnRails
[19:28:07] tubbo: ModusPwnens: when there's a will, there's a way ;) but i've honestly never had to generate PDFs on the fly like that
[19:30:26] Pazician: has joined #RubyOnRails
[19:31:16] srinidhi: has joined #RubyOnRails
[19:32:36] SteenJobs: ModusPwnens: dude, never seen you here before (well i was gone for a while), but your handle is officially the greatest handle i???ve ever come across. hats off to you brotha/sista.
[19:33:27] gabeodess: has joined #RubyOnRails
[19:33:35] MuffinPimp: has joined #RubyOnRails
[19:35:08] gabeodess: Hey all. I???m trying to setup a slack app with a custom slash command backed by a rails server but I???m getting stuck after I auth using devise/omniauth. I see that the app has been added to my slack account, but the slash command does not seem to be accessible. I realize this isn???t really a Rails question, but does anyone know what I???m missing? Or could direct me to another place where I might be able to get help with
[19:36:50] FernandoBasso: has joined #RubyOnRails
[19:38:18] Frem: has joined #RubyOnRails
[19:38:19] manfrin: has joined #RubyOnRails
[19:38:43] qejk: has joined #RubyOnRails
[19:40:22] ModusPwnens: SteenJobs: Hahaha, thanks.
[19:40:25] panzi: has joined #RubyOnRails
[19:40:27] stannard: has joined #RubyOnRails
[19:40:50] SteenJobs: ModusPwnens: anyone that makes reference to any-order logic wins my attention, making a pun out of it is just a cherry on top
[19:40:52] podman: has joined #RubyOnRails
[19:41:27] renanoronfle: has joined #RubyOnRails
[19:41:54] panzi: I've Company.where(...).union(Company.where(...)) (the where is out of my control which is why I cant rewirte as OR). this returns a Arel::Nodes::Union. how do I get a ActiveRecord::Result from that?
[19:42:28] dsimon: ModusPwnens, SteenJobs : it also establishes the correct pronunciation for the word "pwn", so that's a cherry on the cherry
[19:43:04] SteenJobs: dsimon: hahah amazing! i said it out loud so i would have the slightest idea what you???re talking about, and then burst out laughing in this starbucks
[19:43:20] SteenJobs: haha i???m still doing it - great way to make sure you pronounce it correctly
[19:45:04] ElFerna_: has joined #RubyOnRails
[19:46:16] hierbabuena: has joined #RubyOnRails
[19:46:41] mdw: has joined #RubyOnRails
[19:46:45] dsimon: panzi, i think i've googled it to here: http://radar.oreilly.com/2014/05/more-than-enough-arel.html
[19:46:52] dsimon: under heading "executing the union"
[19:47:42] Nerian: has joined #RubyOnRails
[19:48:05] Pazician: has joined #RubyOnRails
[19:48:21] dsimon: i feel like it would be cool if AR#from could figure out what to do with an arel node directly, but i guess that might get kinda weird if multiple types were involved
[19:50:07] replay: has joined #RubyOnRails
[19:50:08] AnomalousBit: Hello! Just curious if anyone here is using a docker image to deploy rails? if so, any suggestions on a dockerimage from the hub?
[19:50:36] dstarh: has joined #RubyOnRails
[19:51:03] alaing: has joined #RubyOnRails
[19:51:07] bronson: has joined #RubyOnRails
[19:51:17] dsimon: AnomalousBit, i'm a weirdo and i like phusion/baseimage because i can stick with my old ansible playbooks mostly unedited, but a lot of docker people hate it
[19:51:54] alaing: HI is there a way of setting a custom html5 data attribute on <option>? using collection_select? this is what i have = f.collection_select :case_type_id, @case_types, :id, :name, { prompt: true }, data: { is_fixed_fee: :is_fixed_fee?}
[19:52:01] MuffinPimp: has joined #RubyOnRails
[19:52:21] alaing: it seems to only create the data attribute at the <select> level
[19:52:55] rubyonrailed: has joined #RubyOnRails
[19:52:59] dsimon: gabeodess, the first question to ask is: is slack even sending a request to your rails server?
[19:53:16] AnomalousBit: cool thanks dsimon, my first foray into docker, mostly looking over dockerfiles to get a start. Hoping to streamline my rails deployments.
[19:53:35] dsimon: try and check the earliest logs you can find to see if anything is coming in to your webhook
[19:54:01] dsimon: and also, try to manually send post requests to the url you told slack about, to make sure it can receive anything at all
[19:55:37] intrigueD: has joined #RubyOnRails
[19:56:29] gabeodess: has joined #RubyOnRails
[19:57:01] mhoungbo: has joined #RubyOnRails
[19:57:33] AnomalousBit: the docker question leads me to another, puma or passenger? I've been using passenger for years now, but this would be an ideal time for me to switch if I'm going to
[19:57:54] AnomalousBit: the only comparison between puma and passenger I found via google was old and seemed to not apply anymore
[19:58:11] kshah: has joined #RubyOnRails
[19:58:26] blackmesa: has joined #RubyOnRails
[19:59:12] roshanavand: has joined #RubyOnRails
[20:00:41] stannard: has joined #RubyOnRails
[20:00:55] SteenJobs: hey guys - i???ve configured my routes (and i???m using devise) to 1) within the user namespace, set :path => ?????? so that ???user??? doesn???t appear in the url, and 2) to redirect ???/sign_in??? to ???/??? 3) for get ???/??? to point to ???devise/sessions#new???. When i put in the /sign_in url, it correctly redirects to ???/?????? but when i press the login button without entering valid credentials, the page is reloaded but t
[20:00:55] SteenJobs: url shows ???/sign_in??? - any idea why/how to fix this?
[20:02:55] alaing: HI is there a way of setting a custom html5 data attribute on <option>? using collection_select? this is what i have = f.collection_select :case_type_id, @case_types, :id, :name, { prompt: true }, data: { is_fixed_fee: :is_fixed_fee?}
[20:02:59] alaing: it seems to only create the data attribute at the <select> level
[20:03:10] godzillaenlacasa: has joined #RubyOnRails
[20:03:34] kshah: I???m trying to access the controller inside a ActionDispatch::IntegrationTest#setup block so I can access a method on ApplicationController but everything is so deeply deeply nested I can???t see if I have access or not, @controller is nil as well
[20:03:47] gabeodess: dsimon: yes Slack is responding with the expected omniauth details.
[20:04:03] laurenonthehill: has joined #RubyOnRails
[20:04:42] arBmind: has joined #RubyOnRails
[20:04:43] gabeodess: dsimon: is that what you meant?
[20:04:45] dalpo: has joined #RubyOnRails
[20:04:57] laurenonthehill: Hello, I'm trying to render a partial using ajax but it's not working. The javascript runs and the code inside the partial runs (both confirmed by a debugger) but I never see anything on screen
[20:05:21] kshah: laurenonthehill: do you have your browsers tools open?
[20:05:28] AnomalousBit: laurenonthehill: try looking at the Network tab in your browser console
[20:05:44] AnomalousBit: laurenonthehill: you can then look at the response from your server, see if it includes what you're expecting
[20:06:12] ruurd: laurenonthehill what os?
[20:06:30] Nerian: has left #RubyOnRails: ()
[20:07:48] tubbo: laurenonthehill: wrong selector in the JS maybe?
[20:07:50] tubbo: happens to me all the time
[20:08:25] ruurd: If you want to excercize a server without bothering with a browser have a look at Paw
[20:08:26] nerium: has joined #RubyOnRails
[20:08:38] ur5us: has joined #RubyOnRails
[20:09:18] ruurd: https://luckymarmot.com/paw
[20:09:30] juddey: has joined #RubyOnRails
[20:09:36] tubbo: ruurd: lol i was so confused for a second because 'a' and 'o' look very similar in this font
[20:09:50] tubbo: i'm a big fan of Postman since it's free
[20:10:03] gabeodess: dsimon: I think I found it. I had to change my scope to `commands` in the oauth initializer, but I forgot to restart my app in dev which I need to do since it???s in an initializer.
[20:10:14] gabeodess: dsimon: after restarting it looks to have added the slack command.
[20:11:20] doublemalt_: has joined #RubyOnRails
[20:12:18] railsForDaiz: has joined #RubyOnRails
[20:12:32] laurenonthehill: tubbo: if I just put a string in the javascript it works ok, so the selector must be ok. Good idea to check though
[20:13:13] yfeldblum: has joined #RubyOnRails
[20:14:28] triptec: has joined #RubyOnRails
[20:15:17] rgtk: has joined #RubyOnRails
[20:16:39] roshanavand: has joined #RubyOnRails
[20:16:49] tubbo: laurenonthehill: when you run a `debugger` in the JS, what's the response you get from rails?
[20:17:04] tubbo: like when you make your ajax request, what are you adding into the page?
[20:17:37] laurenonthehill: It seems to be working now. I have absolutely no idea why...
[20:17:55] laurenonthehill: Thanks for the pointers anyhow!
[20:18:42] stannard: has joined #RubyOnRails
[20:18:50] cih: has joined #RubyOnRails
[20:20:28] laurenonthehill: Btw, is there a way to add simple_form fields dynamically to a form?
[20:20:47] smathy: has joined #RubyOnRails
[20:20:59] xploshioon: has joined #RubyOnRails
[20:21:13] ur5us: has joined #RubyOnRails
[20:21:32] roshanavand: has joined #RubyOnRails
[20:21:46] dalpo: has joined #RubyOnRails
[20:21:51] dsimon: gabeodess, rock on, i wish rails dev server would restart itself when an initializer or config changed
[20:22:05] gabeodess: dsimon: yeah, me too
[20:22:05] dsimon: heck, there's probably a gem for that, or i could just rig entr to do it probably
[20:22:43] gabeodess: dsimon: maybe I???ll submit a PR to the core team for that??? if I get motivated :)
[20:25:24] ruurd: laurenonthehill that's not the way to do that. most of the time a field is switched on or off with JavaScript.
[20:25:37] Palsson: has joined #RubyOnRails
[20:26:12] ruurd: If you want to do that with simple_form you would have to refresh the whole form every time you want to add/remove a form field.
[20:26:22] Cache_Money: has joined #RubyOnRails
[20:26:52] laurenonthehill: ruurd: so you just have all the fields there and then switch them on/off with javascript? But I'm trying to create associations between two records, so wouldn't I potentially end up with one field for each record in my database?
[20:27:43] ruurd: if you have to take such drastic measures that's most of the times a design problem
[20:28:45] safety_cut: has joined #RubyOnRails
[20:28:45] stannard: has joined #RubyOnRails
[20:29:18] eyck: has joined #RubyOnRails
[20:29:40] RegulationD: has joined #RubyOnRails
[20:30:57] ruurd: what are you trying to achieve?
[20:32:51] macsteps: has joined #RubyOnRails
[20:33:10] tubbo: you don't have to refresh the whole form every time you want to add or remove a field.
[20:33:11] underplank: has joined #RubyOnRails
[20:33:57] tubbo: in theory, one could generate the html tags in a similar way to simple_form. but simple_form is just a form builder. as ruurd was saying, if you *do* have the power to not use simple_form in this case i would recommend doing so.
[20:34:15] hierbabuena: has joined #RubyOnRails
[20:34:49] ruurd: tubbo but you have to do a roundtrip every time with that solution.
[20:34:57] msyvich: has joined #RubyOnRails
[20:35:15] tubbo: not necessarily
[20:35:32] tubbo: you can render the "template html" on the server, then use JS to place that html inside your <form></form> so it gets submitted.
[20:35:45] tubbo: i didn't use simple_form but i did do this with rails' form_for, which SF uses under the hood.
[20:35:57] carlosd: has joined #RubyOnRails
[20:36:08] ruurd: you do if you want to do that using simple_form
[20:36:12] alaing: hi, how do i set individal data attributes on <option> i have this at the moment: = collection_select :claim, :case_type_id, @case_types, :id, :name, prompt: true, data: { 'is-fixed-fee': :is_fixed_fee?}
[20:36:27] tubbo: ruurd: i see no reason why you'd need to refresh the entire form for htat.
[20:36:38] sonOfRa: has joined #RubyOnRails
[20:37:01] gabeodess: dsimon: have you seen this error before? https://gist.github.com/gabeodess/41ea620d335fabd0a3d4
[20:37:04] tubbo: one could get rails to render the page with simple_form (view it in a browser), copy out the relevant HTML, then use JS to place that HTML inside the <form> tag when needed.
[20:37:22] gabeodess: dsimon: it keeps popping up whenever I try to use that .json.ruby extension
[20:37:23] tubbo: the caveat to this is if you're using some kind of accepts_nested_attributes_for nonsense here
[20:37:34] mhoungbo: has joined #RubyOnRails
[20:37:51] tubbo: you have to basically set the number at the end of each field name in the collection to an always-unique, always-incrementing number. we used Time.now.to_i to ensure this
[20:37:59] tubbo: dynamic nested attributes -> not easy.
[20:38:04] gabeodess: dsimon: something to do with the MD5 and etags
[20:38:24] laurenonthehill: ruurd: I'm trying to let a user search for a particular record before connecting it up to the record they are creating right now
[20:38:37] laurenonthehill: on the plus side, they can't create or destroy the things they are searching for
[20:38:43] ruurd: if your way isn't easy tubbo you're doing something wrong. KISS
[20:39:46] msyvich: has joined #RubyOnRails
[20:40:10] tubbo: ruurd: haha...i'm not saying it's the easiest approach, or the most elegant, or the least error-prone. but i got paid to do it. ;)
[20:40:15] goodcodeguy: has joined #RubyOnRails
[20:40:21] dsimon: gabeodess, what implements that extension?
[20:40:30] dsimon: i'm more familiar with the old-school .json.erb
[20:40:40] mdw: has joined #RubyOnRails
[20:40:41] dsimon: or doing it outside views entirely
[20:40:51] gabeodess: dsimon: yeah, the .ruby extension is newly supported in Rails 4 I think
[20:41:14] gabeodess: dsimon: but not very well I guess.
[20:41:19] Coldblackice: has joined #RubyOnRails
[20:42:44] ruurd: laurenonthehill how do you record the relationship?
[20:43:03] dsimon: gabeodess, i don't see docs for it anywhere, but it's hard to google
[20:43:07] pyemkey: I have a problem with designing associations. I would like to add multiple skills at once. Also, I would like to mark skills as visible or not. Visibility should be used per group not per unit. For example when i hit lock button, all skills shoud be invisible. I'm curious what do you think about this https://gist.github.com/pyemkey/49716fc68f9bd9e95f8e
[20:43:09] triptec: has joined #RubyOnRails
[20:43:19] tubbo: gabeodess: show me where you first heard about that.
[20:43:35] tubbo: same dsimon. it looks really awesome though! screw jbuilder.
[20:43:37] laurenonthehill: ruurd: it's as has_many/belongs_to relationship. I save it when I create the object
[20:44:02] gabeodess: tubbo: I think I saw it in a tutorial somewhere??? something about zombies??? I???ll see if I can dig it up.
[20:44:14] dsimon: tubbo, i'm using jsonapi anyways, i hate writing json templates because then i have to do the work all over again for every CRUD except R
[20:44:28] dsimon: well, i guess i don't need to for D either, but C and U are annoying enough
[20:44:30] baweaver: has joined #RubyOnRails
[20:44:33] claytonzaugg: has joined #RubyOnRails
[20:44:39] ruurd: laurenonthehill are the records you are creating on the has_many side or the belongs_to side?
[20:45:09] tubbo: gabeodess: i wish it worked like that, but i don't think that's the case unfortunately.
[20:45:20] laurenonthehill: ruurd: The form is for the record which is on the has_many side.
[20:45:26] stannard: has joined #RubyOnRails
[20:45:38] Synthead: dsimon: I say! I am not annoying!
[20:46:02] alaing: Here is a gist of what I'm trying to output in my views https://gist.github.com/aliuk2012/9b6b0b500e38680d32d8
[20:46:26] gabeodess: tubbo: dsimon: http://rails4.codeschool.com/videos
[20:46:36] gabeodess: Views and Vistas 2:47
[20:47:20] ruurd: laurenonthehill how is it possible that you have records on the belongs_to side if you do not have a record on the has_many side?
[20:47:24] greengriminal: has joined #RubyOnRails
[20:47:31] lemur: has joined #RubyOnRails
[20:47:53] dsimon: gabeodess, ah, i spotted the problem
[20:47:58] laurenonthehill: ruurd: they exist in the database, but they're not connected up. If you see what I mean.
[20:47:59] dsimon: it looks like you need to call .to_json at the end of your ruby view
[20:48:09] dsimon: see for example 2:45 timestamp in that video
[20:48:11] gabeodess: dsimon: yeah, just saw that
[20:48:18] ruurd: laurenonthehill so the foreign_key is null in that case
[20:48:27] gabeodess: dsimon: cool, I???ll try not to forget that next time :)
[20:49:23] dsimon: pyemkey, i'm not sure what you mean by "visibility should be used per group not per unit", but your skill.rb in your gist looks about right to me, except for some minor syntax stuff
[20:49:34] ruurd: laurenonthehill or is it some sort of look_up relationship?
[20:49:50] jscheel: has joined #RubyOnRails
[20:49:52] laurenonthehill: ruurd: Yeah, that's the one. It's basically a lookup
[20:50:03] DanKnox_: has joined #RubyOnRails
[20:50:05] DanKnox: has joined #RubyOnRails
[20:50:13] moeabdol: has joined #RubyOnRails
[20:50:33] ruurd: In that case approach it from the belongs_to side. Show the record, then allow the user to search for a list of possibilities and let him select one
[20:51:03] laurenonthehill: That's what I'm trying to do.
[20:51:04] ruurd: Basically create an extra form with one button per item that connects that item to the record you're editing.
[20:51:21] ruurd: And if the number of lookup items is low, you can use a drop down list.
[20:51:43] ruurd: how many lookup values are there?
[20:51:46] laurenonthehill: I feel like I'm doing something really common but I couldn't find any solutions to it when seraching around
[20:52:02] ruurd: Not good for a dropdown.
[20:52:08] laurenonthehill: I made a dropdown, it was real slow lol
[20:52:40] ruurd: Yes. How large do you think the HTML page will be when you create a dropdown with 40K items in it
[20:53:17] dsimon: laurenonthehill, so you need some kind of typeahead or autosuggest right?
[20:53:45] dsimon: i feel like i'm walking into this conversation too late
[20:53:52] ruurd: dsimon that could be a solution provided the user can determine from a single field which lookup value is the correct one
[20:54:01] baweaver: has joined #RubyOnRails
[20:54:34] dsimon: ruurd, some autosuggest widgets can display more complicated record structures
[20:54:38] laurenonthehill: Well, I've just managed to get a working solution. Can I just should you roughly what I've got
[20:54:46] laurenonthehill: http://pastie.org/10724658
[20:55:15] dsimon: 40k checkboxes? :-)
[20:55:37] hcnewsom: has joined #RubyOnRails
[20:55:39] dsimon: or is this partial just for a search result?
[20:55:49] laurenonthehill: It's just for the search result
[20:55:58] stannard: has joined #RubyOnRails
[20:56:42] laurenonthehill: words is all of the possible definition of words they entered in the search box, then they can choose one or more correct definitions from the checkboxes
[20:56:59] roamingdog: has joined #RubyOnRails
[20:57:21] dsimon: hm, does it refetch if the contents of the search box change?
[20:57:22] cpruitt: has joined #RubyOnRails
[20:57:47] laurenonthehill: No, you have to click a button to post it to the server
[20:58:33] stannard: has joined #RubyOnRails
[20:58:55] ruurd: ok did you put a cap on the number of words? and are you telling the user that they should add search lemmas if the number of results are too higj?
[20:59:09] ElFerna_: has joined #RubyOnRails
[20:59:27] ruurd: I think you can do this with a bit of Ajax...
[21:00:00] laurenonthehill: I didn't put a cap on the number of words, but it only returns exact matches. You type in a list of words, you get back the definitions to choose from. It doesn't seem overwhelming.
[21:00:17] sleungcy: has joined #RubyOnRails
[21:00:18] dsimon: makes sense to me, if i'm understanding the purpose of the app right
[21:00:39] ruurd: make sure the number of items is not too high - limit the number of results to 50 or so...
[21:01:46] laurenonthehill: this is the end result: http://speedy.sh/Yda9j/definition-matching-game60.pdf
[21:02:05] xploshioon: has joined #RubyOnRails
[21:02:08] laurenonthehill: ruurd: but if you limit the number of results you might not get the definition you need
[21:02:37] ruurd: correct so if you need to limit the number of results make sure you notify the user.
[21:04:31] xploshioon: i have a problem with a where statement
[21:04:33] drbayer: has joined #RubyOnRails
[21:04:37] xploshioon: @payments = Payment.where("pendiente >= ? AND user = ?", params[:monto], params[:user])
[21:04:42] FCser: has joined #RubyOnRails
[21:04:54] xploshioon: the user condition doesn't work
[21:05:12] xploshioon: i am using postgres
[21:05:13] dopie: has joined #RubyOnRails
[21:05:39] xploshioon: monto is an integer and user is string
[21:06:08] xploshioon: can someone tell me why the string condition don't work?
[21:06:31] xploshioon: if I make a where(:user => params[:user]) it works
[21:07:00] laurenonthehill: They're definitely the same case etc right?
[21:08:34] dsimon: xploshioon, just to be completely clear, 'user' is not any kind of association, just a plain string?
[21:08:47] edwinvdgraaf: has joined #RubyOnRails
[21:09:24] dsimon: also, does Payment.where(:user => params[:user], :monto => params[:monto]) work?
[21:09:46] ruurd: put quotes around the ? for user?
[21:09:47] six: hm, I register a $rootScope.$on event in my directive's controller. I remove it on $destroy ($scope.$on('$destroy') etc.). When that directive is re-initialized (i.e. user goes back to the same page, the listener doesn't get re-added
[21:09:51] six: I don't quite get why
[21:09:55] xploshioon: even using no the param, plain string, it doesn't work
[21:10:04] six: wrong channel, btw ;)
[21:10:07] dsimon: xploshioon, in the logs, can you see the SQL being generated and executed?
[21:10:08] nerium: has joined #RubyOnRails
[21:10:50] xploshioon: @dsimon let me do it again in the heroku console and paste the sql
[21:11:09] sonofdirt: has joined #RubyOnRails
[21:11:12] dsimon: six, take your accursed SPA elsewhere, foul demon ;-) also, are you sure your destroy handler is firing in the first place?
[21:12:36] dsimon: also, this sort of thing can happen if you're using e.g. ng-show or something else that merely hides the directive rather than actually getting rid of the element
[21:12:41] dsimon: ACTION is now done being off-topic
[21:14:31] ElFerna_: has joined #RubyOnRails
[21:15:49] smathy: has joined #RubyOnRails
[21:16:44] xploshioon: dsimon https://gist.github.com/xploshioOn/a7cb083eb477aedbfdd0
[21:17:57] dsimon: xploshioon, this is a long shot, but maybe a floating point rounding error?
[21:18:00] dsimon: try 299 instead of 300
[21:18:09] sandstrom: has joined #RubyOnRails
[21:18:29] sleungcy: has joined #RubyOnRails
[21:18:45] xploshioon: even this works ok
[21:18:46] xploshioon: Payment.where("pendiente >= ?", 300)
[21:18:52] xploshioon: the problem is the string part
[21:18:54] dsimon: oh, nvm then
[21:19:06] xploshioon: and i don't know why
[21:19:10] xploshioon: it's so simple xD
[21:19:37] xploshioon: Payment.where("user = ?", "SIRAMOSA01")
[21:19:42] dsimon: the two queries are checking different fields
[21:19:51] dsimon: that's weird, even if unrelated to your problem
[21:20:12] xploshioon: that gives me and empty collection
[21:20:24] alaing: hi, how do i set individal data attributes on <option> i have this at the moment: = collection_select :claim, :case_type_id, @case_types, :id, :name, prompt: true, data: { 'is-fixed-fee': :is_fixed_fee?}
[21:20:27] dsimon: can you show me the SQL for just .where(user: x) vs .where("user = ?", x)
[21:20:28] alaing: Here is a gist of what I'm trying to output in my views https://gist.github.com/aliuk2012/9b6b0b500e38680d32d8
[21:20:51] ryanRT: has joined #RubyOnRails
[21:21:04] spyd3r: has joined #RubyOnRails
[21:21:10] banisterfiend: has joined #RubyOnRails
[21:21:28] dsimon: xploshioon, oh, it might be a syntax thing
[21:21:34] dsimon: http://api.rubyonrails.org/classes/ActiveRecord/QueryMethods.html#method-i-where
[21:21:51] banisterfiend: Hi, i have a Job class that is invoked with perform_later, it internally iterates through a bunch of users and calls deliver_later on them -- is that some kind of anti-pattern? nesting background jobs inside background jobs? or it's fine? and if it's a bad approach, what's a superior one?
[21:21:57] dsimon: it wants an array for the syntax you're using
[21:22:07] dsimon: try Payment.where(["user = ?", x])
[21:22:14] baweaver: has joined #RubyOnRails
[21:23:03] edwinvdg_: has joined #RubyOnRails
[21:23:04] xploshioon: https://gist.github.com/xploshioOn/a7cb083eb477aedbfdd0
[21:23:11] dsimon: oh wait, it says "If where is called with multiple arguments, these are treated as if they were passed as the elements of a single array."
[21:23:16] benlieb: has joined #RubyOnRails
[21:23:16] dsimon: so my suggestion probably won't fix anything
[21:23:53] xploshioon: tha's so simple
[21:24:05] dsimon: if you execute that first SQL query manually, do you get any rows back?
[21:24:23] dsimon: like, at this point, it seems like Rails is generating a valid query, so maybe something weird is happening at the DB level?
[21:25:14] dsimon: wait, i got it! :-D
[21:25:20] dsimon: http://www.postgresql.org/docs/7.3/static/sql-keywords-appendix.html
[21:25:28] dsimon: in postgres, "user" is a reserved word
[21:25:32] dsimon: so it'll only work when quoted in the query
[21:26:07] dsimon: i'm a little surprised you didn't get a syntax error
[21:26:20] maesitos: has joined #RubyOnRails
[21:26:35] dsimon: Payment.where('"user" = ?', x)
[21:27:18] xploshioon: that did the trick :D
[21:27:35] xploshioon: i owe you a beer ;)
[21:27:53] dalpo: has joined #RubyOnRails
[21:27:56] dsimon: just pay it forward, that'll work for me :-)
[21:28:19] cac: has joined #RubyOnRails
[21:28:32] triptec: has joined #RubyOnRails
[21:28:39] xploshioon: ill try hehe
[21:31:02] maesitos: has joined #RubyOnRails
[21:31:02] ryanRT1: has joined #RubyOnRails
[21:40:03] rikkipitt: has joined #RubyOnRails
[21:40:27] rikkipitt: hey everyone, is it possible to write a scope that takes a variable to query a polymorphic association?
[21:43:23] triptec: has joined #RubyOnRails
[21:43:27] ryanRT1: has left #RubyOnRails: ()
[21:44:29] Devalo: has joined #RubyOnRails
[21:44:41] rikkipitt: figured it out, cheers anyway!
[21:45:45] mwcmitchell: has joined #RubyOnRails
[21:48:51] zackzorman: has joined #RubyOnRails
[21:48:52] trinaldi: has joined #RubyOnRails
[21:49:08] Pazician: has joined #RubyOnRails
[21:49:58] jarib: has joined #RubyOnRails
[21:50:40] jarib: has joined #RubyOnRails
[21:50:40] jarib: has joined #RubyOnRails
[21:50:41] bmalum: has joined #RubyOnRails
[21:54:41] cac: has joined #RubyOnRails
[21:56:18] Radar: -q diegoviola!*@*
[21:59:08] diegoviola: has joined #RubyOnRails
[21:59:17] chipotle_: has joined #RubyOnRails
[22:02:12] banister: has joined #RubyOnRails
[22:03:57] lacrymology: has joined #RubyOnRails
[22:08:47] triptec: has joined #RubyOnRails
[22:11:13] ElFerna: has joined #RubyOnRails
[22:11:19] carlosd: has joined #RubyOnRails
[22:18:19] fighella: has joined #RubyOnRails
[22:18:51] apotry: has joined #RubyOnRails
[22:19:18] openstruct: has joined #RubyOnRails
[22:21:15] htmldrum: has joined #RubyOnRails
[22:21:49] helpa-bot: has joined #RubyOnRails
[22:23:11] triptec: has joined #RubyOnRails
[22:23:16] rikkipitt: has joined #RubyOnRails
[22:23:28] pawnbox: has joined #RubyOnRails
[22:23:41] rikkipitt: Can anyone help me with a scope please? https://gist.github.com/rikkipitt/b57c8e6a9114ad306f3b
[22:23:48] rikkipitt: I want to get Projects by locale (but also include Projects with no locale set)
[22:26:14] rhizome: rikkipitt: use .includes not .joins
[22:26:58] rikkipitt: I usually do, was just checking it with polymorphism
[22:27:30] rikkipitt: countries is polymorphic so I can apply it to other models
[22:28:30] rikkipitt: rhizome: any idea how I can get projects that don't have a relationship or has the specified country_code?
[22:30:54] yfeldblum: has joined #RubyOnRails
[22:32:30] helpa: has joined #RubyOnRails
[22:32:55] bmalum: has joined #RubyOnRails
[22:32:57] safety_cut: has joined #RubyOnRails
[22:33:15] godzillaenlacasa: is there a trick to getting an environment variable to return? I have LOCATION_ID set in my ~/.profile, but `puts ENV["LOCATION_ID"] is not returning anything
[22:33:56] pyemkey: I have a problem with choosing way of managing visibility of skills for cv. I would like to manage visibility per group rather than unit. Can someone look into my code https://gist.github.com/pyemkey/91b428b8e5372d6722fc and say which one will choose.
[22:34:12] rhizome: rikkipitt: i don't understand
[22:34:12] rubyonrailed: has joined #RubyOnRails
[22:35:43] rubyonrailed: has joined #RubyOnRails
[22:36:33] spyd3r: has joined #RubyOnRails
[22:37:02] Technodrome: has joined #RubyOnRails
[22:37:32] soule: has joined #RubyOnRails
[22:38:37] Radar: godzillaenlacasa: Are you certain that ~/.profile is being evaluated?
[22:38:56] godzillaenlacasa: @Radar No, is there a way to check?
[22:39:01] Radar: godzillaenlacasa: get it to echo something
[22:39:36] crdpink: has joined #RubyOnRails
[22:39:58] godzillaenlacasa: @Radar in my Ruby script? `echo ENV["LOCATION_ID"]` ?
[22:40:06] Radar: godzillaenlacasa: in ~/.profile
[22:40:19] Radar: godzillaenlacasa: Also depends on how you're setting it in ~/.profile.
[22:40:55] godzillaenlacasa: @Radar in ~/.profile, it's `export LOCATION_ID=aaaabbbbbccccc`
[22:41:05] Radar: that's fine
[22:41:21] godzillaenlacasa: @Radar if I type `printenv` in my terminal it shows up
[22:42:23] Radar: godzillaenlacasa: then I'm not sure how it's broken, sorry
[22:44:51] mickey_mouse_3: has joined #RubyOnRails
[22:45:11] Devalo: has joined #RubyOnRails
[22:45:24] baweaver: has joined #RubyOnRails
[22:46:37] quazimodo: has joined #RubyOnRails
[22:48:42] triptec: has joined #RubyOnRails
[22:48:45] Cache_Money: has joined #RubyOnRails
[22:52:15] someish: has joined #RubyOnRails
[22:54:02] wldcordeiro: has joined #RubyOnRails
[22:55:16] railsForDaiz: has joined #RubyOnRails
[22:57:15] superlou: has joined #RubyOnRails
[23:03:52] manfrin: has joined #RubyOnRails
[23:04:24] shanemcd: has joined #RubyOnRails
[23:05:49] macsteps: has joined #RubyOnRails
[23:06:06] baweaver: has joined #RubyOnRails
[23:06:21] safety_cut: has joined #RubyOnRails
[23:06:32] stannard: has joined #RubyOnRails
[23:10:15] triptec: has joined #RubyOnRails
[23:10:24] stannard: has joined #RubyOnRails
[23:10:42] draig: has joined #RubyOnRails
[23:11:04] yfeldblum: has joined #RubyOnRails
[23:11:24] edwinvdgraaf: has joined #RubyOnRails
[23:11:32] draig: has joined #RubyOnRails
[23:12:25] roamingdog: has joined #RubyOnRails
[23:13:38] ryanRT: has joined #RubyOnRails
[23:14:14] ryanRT: has left #RubyOnRails: ()
[23:16:56] robbyoconnor: has joined #RubyOnRails
[23:16:58] robbyoconnor: has joined #RubyOnRails
[23:17:18] jscheel: has joined #RubyOnRails
[23:19:04] bronson: has joined #RubyOnRails
[23:21:38] shanemcd: has joined #RubyOnRails
[23:26:11] SteenJobs: has joined #RubyOnRails
[23:27:07] Technodrome: has joined #RubyOnRails
[23:27:53] pwnd_nsfw`: has joined #RubyOnRails
[23:28:09] adre: has joined #RubyOnRails
[23:28:18] Cohedrin_: has joined #RubyOnRails
[23:29:49] zeknox1: has joined #RubyOnRails
[23:30:25] jord_: has joined #RubyOnRails
[23:30:31] soule_: has joined #RubyOnRails
[23:30:31] netwoodle: has joined #RubyOnRails
[23:30:33] pfg_: has joined #RubyOnRails
[23:30:35] CornishPasty_: has joined #RubyOnRails
[23:30:41] machty_: has joined #RubyOnRails
[23:31:52] eml: has joined #RubyOnRails
[23:31:57] Sami345: has joined #RubyOnRails
[23:31:59] maesitos: has joined #RubyOnRails
[23:32:06] zenergi_: has joined #RubyOnRails
[23:32:27] jtdowney_: has joined #RubyOnRails
[23:32:49] hinbody_: has joined #RubyOnRails
[23:32:53] unreal_: has joined #RubyOnRails
[23:33:15] ebryn_: has joined #RubyOnRails
[23:33:20] Oliphaunte: has joined #RubyOnRails
[23:33:34] Somnius_: has joined #RubyOnRails
[23:33:37] dotty_: has joined #RubyOnRails
[23:33:59] meinside___: has joined #RubyOnRails
[23:34:04] gousuto_: has joined #RubyOnRails
[23:34:36] SuppliedRelic_: has joined #RubyOnRails
[23:34:51] BBHoss_: has joined #RubyOnRails
[23:35:01] camilasann: has joined #RubyOnRails
[23:35:27] Kilo`byte: has joined #RubyOnRails
[23:35:28] ziyadb_: has joined #RubyOnRails
[23:35:45] okdas_: has joined #RubyOnRails
[23:35:50] webdestroyaz: has joined #RubyOnRails
[23:35:55] srinidhi1: has joined #RubyOnRails
[23:35:56] urkle: has joined #RubyOnRails
[23:36:08] Plas: has joined #RubyOnRails
[23:36:22] mary5030: has joined #RubyOnRails
[23:36:25] carlosd: has joined #RubyOnRails
[23:36:41] ur5us_: has joined #RubyOnRails
[23:36:47] mattboll: has joined #RubyOnRails
[23:36:55] mattboll: hi, i'm going crazy… I've got a form_for with remote: true, processed as JS, everything is fine. but when I add an hidden field and set it with jquery, then the form is processed as html
[23:38:44] FCser: has joined #RubyOnRails
[23:38:44] manfrin_: has joined #RubyOnRails
[23:38:44] lele: has joined #RubyOnRails
[23:38:44] roamingdog: has joined #RubyOnRails
[23:38:44] null__: has joined #RubyOnRails
[23:38:44] null__: has joined #RubyOnRails
[23:38:44] Liothen: has joined #RubyOnRails
[23:38:44] algernop_k: has joined #RubyOnRails
[23:38:55] Isthar: has joined #RubyOnRails
[23:38:58] Liothen: has joined #RubyOnRails
[23:39:11] Majadon: has joined #RubyOnRails
[23:39:51] triptec: has joined #RubyOnRails
[23:40:44] amitchellbullard: has joined #RubyOnRails
[23:41:53] macsteps: has joined #RubyOnRails
[23:43:19] robbkidd: has joined #RubyOnRails
[23:43:44] iamdevnul: has joined #RubyOnRails
[23:45:16] magically: has joined #RubyOnRails
[23:46:00] one_zero: has joined #RubyOnRails
[23:46:37] nibbo: has joined #RubyOnRails
[23:46:59] AckZ: has joined #RubyOnRails
[23:47:04] baweaver: has joined #RubyOnRails
[23:47:58] cookiez: has joined #RubyOnRails
[23:47:58] toydestroyer: has joined #RubyOnRails
[23:47:58] arthropododo: has joined #RubyOnRails
[23:47:58] waldi_: has joined #RubyOnRails
[23:47:58] cjk101010: has joined #RubyOnRails
[23:49:22] Guest12896: has joined #RubyOnRails
[23:49:26] rhizome: mattboll: might be an order of operations thing
[23:49:32] SteenJobs: has joined #RubyOnRails
[23:49:36] atrius: has joined #RubyOnRails
[23:50:37] mattboll: rhizome: may I ask u to explain a little ?
[23:50:50] meinside: has joined #RubyOnRails
[23:52:17] c355E3B: has joined #RubyOnRails
[23:52:26] maesitos: has joined #RubyOnRails
[23:56:57] yfeldblum: has joined #RubyOnRails
[23:58:42] Radar: mattboll: !rule0
[23:58:42] helpa: mattboll: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us. Put the code on https://gist.github.com and then give us the HTTP link to the Gist.
[23:59:09] jbermudes: silly question time: If I plan on using google to send my emails for a rails app, do I need an MTA installed on the server?