« Back to channel list

#RubyOnRails - 26 October 2015

« Back 1 day Forward 1 day »
[00:00:37] bobbobbins: Radar: doesn't look like that worked
[00:00:57] Radar: bobbobbins: Ok, I am out of ideas.
[00:01:19] bobbobbins: thanks, I'll keep messing with it
[00:01:53] sevenseacat: has joined #RubyOnRails
[00:02:34] shibabu: has joined #RubyOnRails
[00:03:08] dopie: has joined #RubyOnRails
[00:03:39] sankaber: has joined #RubyOnRails
[00:04:07] dopie: I am trying to add a method to the devise create method which redirects the user after create to an external url what am I doing wrong?
[00:04:09] dopie: https://gist.github.com/staycreativedesign/9fda0c5ae21834552a40
[00:04:39] sevenseacat: create already does a redirect
[00:04:59] sevenseacat: you want to overwrite after_registration_path or something similar
[00:05:29] sevenseacat: https://github.com/plataformatec/devise/wiki/How-To:-Redirect-to-a-specific-page-on-successful-sign-up-%28registration%29
[00:05:38] bobbobbins: I might have just done it wrong though, because what you're saying appears to be correct, the helper is included somewhere later and it doesn't get patched
[00:06:01] dopie: sevenseacat, ahh thank you
[00:07:58] fp-: has joined #RubyOnRails
[00:08:20] fp-: has joined #RubyOnRails
[00:10:51] gambl0re: has joined #RubyOnRails
[00:11:39] kara_sweets: has joined #RubyOnRails
[00:12:53] beauby: Radar: The transformation I was talking about is this method: https://github.com/rails-api/active_model_serializers/pull/1248/files#diff-f98ece6d93144227601f95f68c75b1bdR32
[00:13:11] Radar: beauby: I don't have time to dissect that right now, sorry.
[00:15:07] ishikawa91: has joined #RubyOnRails
[00:15:35] oscarb92: has joined #RubyOnRails
[00:16:11] gambl0re: has joined #RubyOnRails
[00:16:56] oscarb92: hello, I'm getting this error for "undefined method `[]' for nil:NilClass" for this line of code "<%= simple_form_for @reprogramacion_citas, url: reprogramacion_citas_path do |f| %>"
[00:17:13] Radar: oscarb92: gist a stacktrace please
[00:17:23] crankharder: has joined #RubyOnRails
[00:17:44] oscarb92: in the controller new action I initialize that variable as "@reprogramacion_citas = ReprogramacionCita.new"
[00:18:17] oscarb92: But that object seems to be empty, not like other new model objects that contains keys with attrs names and nil values
[00:18:40] Radar: ACTION taps keyboard, is this thing on?
[00:18:56] montagesoftware: has joined #RubyOnRails
[00:19:03] Radar: > Radar says gist a stacktrace
[00:19:10] Radar: > Person trying to get help does something completely different
[00:19:13] Radar: and so the cycle continues
[00:19:15] Radar: for all time
[00:19:27] Aeyrix: "Ad Infinitum, by Radar"
[00:19:36] hephaestus_rg: has joined #RubyOnRails
[00:20:14] kara_sweets: hey guys I'm at my wits end with this error I keep getting from the following code
[00:20:15] kara_sweets: https://gist.github.com/anonymous/48419886c7c6d2e51ab7
[00:20:27] kara_sweets: undefined method `[]' for nil:NilClass
[00:20:36] Radar: kara_sweets you and oscarb92 are the same person probs
[00:20:50] Radar: no stacktrace?
[00:20:52] kara_sweets: lol i see similarity in our issue
[00:21:09] kara_sweets: however this one issue seems like a gotcha
[00:21:23] kara_sweets: due to the namespacing
[00:21:28] quazimodo: has joined #RubyOnRails
[00:21:54] Radar: kara_sweets: Gist a stacktrace please.
[00:23:18] kara_sweets: https://gist.github.com/anonymous/2700f0d909ad68be8bf8
[00:23:36] kara_sweets: (this is not a good example sorry)
[00:23:44] kara_sweets: let met re gist, theres an obvious error there
[00:23:49] Radar: Ok, people can't gist properly today.
[00:24:04] sevenseacat: thats different code, too
[00:24:39] wcalderipe: has joined #RubyOnRails
[00:24:46] kara_sweets: https://gist.github.com/anonymous/def4a4dc494661e9b83f
[00:25:11] oscarb92: Radar: https://gist.github.com/OscarBastardo/f31e3bbb2a1ac0bd63b0
[00:25:30] sevenseacat: without a proper backtrace, I'd say @current_company might be nil.
[00:25:31] workmad3: has joined #RubyOnRails
[00:26:07] sevenseacat: @reprogramacion_citas is also nil.
[00:26:08] Aeyrix: > c:/RailsInstaller/
[00:26:20] kara_sweets: sevenseacat: a valid insight, however it is not
[00:26:27] sevenseacat: kara_sweets: how do you know?
[00:26:48] Aeyrix: 20 questions tbh
[00:27:56] oscarb92: sevenseacat: I know, but why? I assign it a ReprogramacionCita.new
[00:27:56] kara_sweets: sevenseacat https://gist.github.com/anonymous/efa2ec7c0d6349ef0c91
[00:28:03] sevenseacat: oscarb92: no you don't
[00:28:06] sevenseacat: check the variable name
[00:28:36] Aeyrix: kara_sweets: so uh
[00:28:53] Aeyrix: company id 2
[00:29:01] oscarb92: sevenseacat: I fixed it. Still not working
[00:29:08] sevenseacat: kara_sweets: cool. thats not @current_company.
[00:29:20] kara_sweets: @current_company = Company.first ?
[00:29:41] willardg: has joined #RubyOnRails
[00:29:51] Aeyrix: kara_sweets: if that were the case, you wouldn't be having the issue you're having
[00:30:07] kara_sweets: Aeyrix: not true, i can pass in Company.new to form for and same error
[00:30:11] Ropeney: has anyone looked at writing a cancan model_adapter for elasticsearch?
[00:30:17] sevenseacat: show us what @current_company is.
[00:30:29] Aeyrix: I'm going to
[00:30:38] Aeyrix: actually never mind maybe that's not obvious
[00:30:41] Aeyrix: you can't pass in Company.new
[00:30:44] Aeyrix: to a view
[00:31:07] Aeyrix: don't do it that way
[00:31:17] Aeyrix: goddamn i have so many gist links open
[00:31:29] sevenseacat: because people post 40000 of them
[00:31:44] Aeyrix: Alright so the one with the code is 404 now
[00:32:05] robbyonrails: has joined #RubyOnRails
[00:32:55] oscarb92: sevenseacat: Any other idea? It's not the variable name, that was a typo when creating the gist
[00:33:12] sevenseacat: how the crap do you make typos when copying and pasting code?
[00:33:57] oscarb92: sevenseacat: by making it a bit more readable to english speakers such as yourself
[00:34:32] sevenseacat: it was less english-like before?
[00:35:13] oscarb92: sevenseacat: Not to be umpolite, but is this going anywhere?
[00:36:23] robbyonr1ils: has joined #RubyOnRails
[00:36:36] oscarb92: sevenseacat: I'm telling you it's not the variable name. Do you know what else could it be? If I check the variable it seems to be an object from the model, but it doesn't have the nil attributes as the other ones then I use the .new
[00:37:08] hephaestus_rg: has joined #RubyOnRails
[00:39:07] dan0034001: has joined #RubyOnRails
[00:40:09] rickmasta: has joined #RubyOnRails
[00:41:15] dopie: Can anyone tell me if this is the right way to do what I'm trying to do? it gets params and sets it as a instance variable @new_user than i find_user, than I get the member id from @new_user, and update_member_id if it is blank
[00:41:16] dopie: https://gist.github.com/staycreativedesign/370bccd4cc5d7b056fd6
[00:42:21] Palsson: has joined #RubyOnRails
[00:42:43] kara_sweets: dopie: id recommend using before_action
[00:42:53] kara_sweets: for find_user
[00:43:13] skiz: has joined #RubyOnRails
[00:43:26] kara_sweets: dopie: id maybe also recommend rewriting this controller cod
[00:43:33] kara_sweets: it looks a little overly difficuly
[00:43:47] george2: has joined #RubyOnRails
[00:44:14] darrencauthon: has joined #RubyOnRails
[00:45:06] dopie: kara_sweets, can you go gist and make how would you make it
[00:45:09] dopie: so i can analyze?
[00:46:16] kara_sweets: whats the purpose of status
[00:48:00] pontiki: has joined #RubyOnRails
[00:48:13] brt: has joined #RubyOnRails
[00:48:17] kara_sweets: dopie: code's sort of hard to follow you may need to read up on some stuff on rails guides / play around
[00:48:31] kara_sweets: not sure you're fundamental understanding of rails is quite there , I'm happy to help though
[00:48:50] dopie: the purpose of status is to see if the user status is approved from the post back
[00:48:58] dopie: "ans"=>"YGOODTEST|1844945224",
[00:49:19] dopie: it also creates the user
[00:49:31] kara_sweets: it creates the user?
[00:49:43] dopie: no sorry it doesn't
[00:50:02] hephaest1s_rg: has joined #RubyOnRails
[00:50:23] dopie: hey pontiki
[00:50:49] Or1on: has joined #RubyOnRails
[00:51:25] Jasaka: has joined #RubyOnRails
[00:51:45] craysiii: has joined #RubyOnRails
[00:53:23] dan0034001: has joined #RubyOnRails
[00:54:06] sarink: has joined #RubyOnRails
[00:55:30] jamto11: has joined #RubyOnRails
[00:55:51] VeryBewitching: pontiki: Hi pontiki.
[00:57:25] baweaver: has joined #RubyOnRails
[00:58:06] avemestr: has joined #RubyOnRails
[00:58:23] matthewd: oscarb92: What are you doing in your model? Are you overriding #initialize?
[00:59:52] arathald: cooking and coding again today
[00:59:56] arathald: seems to be a pattern
[01:00:32] tedstriker: has joined #RubyOnRails
[01:01:59] oscarb92: matthewd: nothing weird (added it to the gist) https://gist.github.com/OscarBastardo/f31e3bbb2a1ac0bd63b0/edit
[01:02:12] Cervajz_: has joined #RubyOnRails
[01:02:28] RegulationD: has joined #RubyOnRails
[01:03:04] oscarb92: matthewd: sorry wrong link https://gist.github.com/OscarBastardo/f31e3bbb2a1ac0bd63b0
[01:03:55] oscarb92: matthewd: I'm not overriding initialize (don't even know what that is in the model)
[01:03:57] jamto11: has joined #RubyOnRails
[01:04:41] SteenJobs: has joined #RubyOnRails
[01:07:23] d34th4ck3r: has joined #RubyOnRails
[01:08:37] arooni: has joined #RubyOnRails
[01:09:19] matthewd: oscarb92: Then I really don't see how `@column_types` is ending up nil :/
[01:09:32] dan0034001: has joined #RubyOnRails
[01:09:39] siddart: has joined #RubyOnRails
[01:09:52] sevenseacat: does this model actually have a db table?
[01:10:20] quazimodo: has joined #RubyOnRails
[01:10:58] oscarb92: sevenseacat: yes it does. Created it with migrations
[01:11:12] sevenseacat: did you run the migrations?
[01:11:14] atomical: has joined #RubyOnRails
[01:11:59] oscarb92: sevenseacat: yes, I can see the table in the database
[01:16:40] loc22: has joined #RubyOnRails
[01:16:51] loc22: has joined #RubyOnRails
[01:17:02] loc22: has joined #RubyOnRails
[01:17:23] loc22: has joined #RubyOnRails
[01:22:02] loc22: has joined #RubyOnRails
[01:23:43] loc22: Hi guys! Do you guys know if it is possible to use websockets in Rails, and send streaming data from a device to a Rails backend api?
[01:25:53] ElFerna: has joined #RubyOnRails
[01:26:47] sarink: has joined #RubyOnRails
[01:27:02] arathald: I'm close to shaving a yak here. Went from coding to website design and now I'm now processing photos from a shoot last week
[01:27:30] ElFerna: has joined #RubyOnRails
[01:29:21] roxtrongo: has joined #RubyOnRails
[01:29:23] AdaelRuiz: has joined #RubyOnRails
[01:30:52] ElFerna: has joined #RubyOnRails
[01:32:33] dan0034001: has joined #RubyOnRails
[01:32:33] h7br1x: has joined #RubyOnRails
[01:32:47] willardg: has joined #RubyOnRails
[01:33:13] pontiki: the tao de yak
[01:33:58] JusticeFries: has joined #RubyOnRails
[01:34:29] razieliyo: has joined #RubyOnRails
[01:36:11] robbyoconnor: has joined #RubyOnRails
[01:36:21] oscarb92: has joined #RubyOnRails
[01:38:10] rakm: has joined #RubyOnRails
[01:39:35] mrbubbles: has joined #RubyOnRails
[01:40:05] dopie: kara_sweets, would be ok if i move most of it to the user model?
[01:40:45] grambo: has joined #RubyOnRails
[01:42:32] workmad3: has joined #RubyOnRails
[01:44:59] darrencauthon: has joined #RubyOnRails
[01:46:34] bruno-: has joined #RubyOnRails
[01:49:03] pydave6367: has joined #RubyOnRails
[01:53:07] dan0034001: has joined #RubyOnRails
[01:55:42] chorgi: has joined #RubyOnRails
[01:59:58] nya: has joined #RubyOnRails
[02:00:33] pydave6367: has joined #RubyOnRails
[02:00:55] annlewis_: has joined #RubyOnRails
[02:01:02] pontiki_: has joined #RubyOnRails
[02:03:16] mices: has joined #RubyOnRails
[02:03:25] urkle: has joined #RubyOnRails
[02:03:38] mices: 'bundle exec rake' vs 'rake' ?
[02:04:11] sevenseacat: I would always use bundle exec.
[02:04:30] xcm: has joined #RubyOnRails
[02:04:42] mices: what's the difference?
[02:04:59] sevenseacat: one makes sure the rake command is scoped to your bundle.
[02:05:35] mices: tywhat about the modeltyx
[02:05:46] mices: o sorry disregard that
[02:06:22] shibabu: has joined #RubyOnRails
[02:07:21] gambl0re: can anyone help me out. my nested form isn't showing up. i'm using cocoonn gem and i followed the documentaion but still no luck.
[02:07:22] gambl0re: https://gist.github.com/anonymous/28ffb9f8439af6afa7bd
[02:08:46] kara_sweets: has left #RubyOnRails: ()
[02:09:34] sevenseacat: so whats going wrong? you press 'add location' and nothing happens?
[02:09:49] gambl0re: theres no input field
[02:09:59] gambl0re: the button shows
[02:10:10] sevenseacat: so is that a yes or no to my question?
[02:10:22] gambl0re: well yea obviously nothing happens
[02:10:33] sevenseacat: don't say 'obviously' when its not immediately obvious
[02:10:34] quazimodo: has joined #RubyOnRails
[02:11:00] sevenseacat: hooked up the cocoon js correctly?
[02:11:01] Ropeney: no errors, did you check the browser console output?
[02:12:06] unreal: has joined #RubyOnRails
[02:12:25] gambl0re: i added cocoon to js file
[02:13:16] siddart: has joined #RubyOnRails
[02:13:20] gambl0re: shit!!! i forgot to add the //=require cocoon to the js file
[02:13:20] Radar: Lunch consumed. Patience returning.
[02:13:36] gambl0re: it works now, thanks
[02:14:01] gambl0re: spent like an hour trying to fix it.
[02:14:06] sevenseacat: Radar: you're not you when you're hungry. wb.
[02:14:52] ElFerna: has joined #RubyOnRails
[02:16:01] rickmasta: has joined #RubyOnRails
[02:21:43] sevenseacat: Aeyrix: eat a snickers.
[02:23:59] brt: has joined #RubyOnRails
[02:25:30] Quintasan: has joined #RubyOnRails
[02:25:30] Quintasan: has joined #RubyOnRails
[02:33:42] rshetty: has joined #RubyOnRails
[02:34:12] avemestr: has joined #RubyOnRails
[02:34:25] dan0034001: has joined #RubyOnRails
[02:34:25] fifi-v: has joined #RubyOnRails
[02:34:26] h7br1x: has joined #RubyOnRails
[02:39:09] andrewperkins: has joined #RubyOnRails
[02:40:17] fifi-v: my User model has_one Biography. On the edit view of User, I'd like to use CKEditor to edit the content of Biography. The code I have now is: `<%= f.text_area :biography, :size => "30x4", :class => "text ckeditor", "data-width" => 580 %>` (some js which init this ckeditor), in controller I have `@biography = @user.biography.content` and the update logic.
[02:41:17] roxtrongo: has joined #RubyOnRails
[02:42:38] fifi-v: I can put some text in the ckeditor and saving does work (I can see this from the database), but on opening edit view, the text shown in the ckeditor is always a "#", I'm a bit confused here, any idea is welcome
[02:43:10] andrewperkins: G'day, does anyone know which part of devise to override to allow it to search and soft-restore soft-deleted (is_deleted) users when they attempt to recover their password?
[02:44:55] EminenceHC: has joined #RubyOnRails
[02:46:07] darrencauthon: has joined #RubyOnRails
[02:46:28] malcolmva: has joined #RubyOnRails
[02:48:04] baweaver: has joined #RubyOnRails
[02:48:45] bruno-: has joined #RubyOnRails
[02:50:31] Cervajz_: has joined #RubyOnRails
[02:51:41] lemur: has joined #RubyOnRails
[02:52:51] nemo_: has joined #RubyOnRails
[02:53:27] quazimodo: has joined #RubyOnRails
[02:54:24] siddart: has joined #RubyOnRails
[02:57:31] gambl0re: how do you add snippets of code in your blog like from a gist?
[02:57:31] allcentury: has joined #RubyOnRails
[02:57:44] gambl0re: instead of just copying/pasting code directly into your blog post
[02:58:12] Radar: gambl0re: Gist has an embed function.
[02:58:27] Radar: gambl0re: Look in the sidebar for a gist
[02:58:29] Radar: "Embed URL"
[02:59:44] gambl0re: i dont see any sidebar
[03:00:44] gambl0re: only 3 input boxes for description, filename, and the box to paste the code
[03:00:46] Radar: gambl0re: https://gist.github.com/radar/d9d24ebfede132ec8b4d
[03:00:55] Radar: gambl0re: that's on https://gist.github.com. You have to go to a gist to see how to embed that gist.
[03:01:22] gambl0re: oh i need to create the gist first...
[03:01:28] emptyflask: has joined #RubyOnRails
[03:03:21] RegulationD: has joined #RubyOnRails
[03:05:12] A124: has joined #RubyOnRails
[03:06:57] wcalderipe: has joined #RubyOnRails
[03:07:16] duncannz: has joined #RubyOnRails
[03:07:54] sankaber: has joined #RubyOnRails
[03:08:47] SteenJobs: has joined #RubyOnRails
[03:09:16] Motoservo: has joined #RubyOnRails
[03:11:46] wcalderipe: has joined #RubyOnRails
[03:14:15] seank_: has joined #RubyOnRails
[03:14:24] d34th4ck3r: has joined #RubyOnRails
[03:16:15] m3_del: has joined #RubyOnRails
[03:22:13] roxtrongo: has joined #RubyOnRails
[03:22:43] dopieee: has joined #RubyOnRails
[03:23:41] dan0034001: has joined #RubyOnRails
[03:29:41] rshetty: has joined #RubyOnRails
[03:30:40] workmad3: has joined #RubyOnRails
[03:34:31] modular: has joined #RubyOnRails
[03:34:34] benlieb: has joined #RubyOnRails
[03:35:28] Motoservo: has joined #RubyOnRails
[03:35:47] pontiki_: has left #RubyOnRails: ()
[03:36:04] pontiki: has joined #RubyOnRails
[03:37:57] modular: im sort of new to rails, can anyone tell me how to embed a swf file??
[03:40:06] h7br1x: has joined #RubyOnRails
[03:40:12] Aeyrix: Why would you want to do that?
[03:40:18] moeabdol: has joined #RubyOnRails
[03:40:20] Aeyrix: Mainly because Flash (SWF) is disgusting.
[03:40:21] modular: my boss wants a swf file on the homepage and ive never done that before
[03:40:48] pontiki: modular: that's got nothing to do with rails, really. it's done in html.
[03:40:59] dan0034001: has joined #RubyOnRails
[03:41:01] pontiki: comedy gold: adobe saying uninstall flash
[03:41:13] Aeyrix: Comedy gold: People still using Flash.
[03:41:30] pontiki: that's just plain comedy :)
[03:42:05] pontiki: g'day Radar
[03:42:09] modular: so just plain html?
[03:42:12] Radar: modular: I googled for it and this is what came up: http://stackoverflow.com/questions/137326/how-to-embed-a-swf-file-in-a-html-page
[03:42:27] Radar: modular: There's nothing special you have to do to embed an SWF file in Rails.
[03:42:43] Radar: modular: put the .swf inside public, and reference it as if it were at the root of the domain
[03:42:44] SteenJobs: has joined #RubyOnRails
[03:43:09] modular: alright then ill do that thanks i guess
[03:43:18] Radar: apologies for the jackals.
[03:44:10] Radar: That's the first Flash question I've heard in here in a looooong time.
[03:46:40] pontiki: i prefer jekyll to jackal
[03:46:46] dan0034001: has joined #RubyOnRails
[03:46:53] darrencauthon: has joined #RubyOnRails
[03:47:35] G: I swear we need a Web 3.0 moniker to describe a flash-less (i.e. HTTP2/HTMl5/etc) internet.
[03:48:05] Radar: Web x.0 is so Web 2.0
[03:48:07] Aeyrix: That's just Web.
[03:48:18] Aeyrix: I barely even use JS if I can get away with it.
[03:48:21] Aeyrix: CSS3 animations.
[03:49:16] bruno-: has joined #RubyOnRails
[03:49:29] mloy: Aeyrix do you have any neat CSS3 animation samples you could share? I'm curious to see some.
[03:51:34] Aeyrix: mloy: no animation unfortunately
[03:51:38] Aeyrix: i use a box-shadow trick on my website
[03:51:39] Aeyrix: that's about it
[03:51:42] Aeyrix: https://elliot.pro/
[03:52:25] d34th4ck3r: good afternoon everyone!
[03:54:24] stardiviner: has joined #RubyOnRails
[03:54:52] rshetty: has joined #RubyOnRails
[03:55:28] nemo_: has joined #RubyOnRails
[03:55:47] rshetty: has joined #RubyOnRails
[03:56:01] dan0034001: has joined #RubyOnRails
[03:56:55] h7br1x: has joined #RubyOnRails
[03:58:55] d34th4ck3r: I have been working on Test in Rails but stuck with following error: https://gist.github.com/d34th4ck3r/93c22da400fa79c5e7d2
[03:59:04] mmb: has joined #RubyOnRails
[03:59:54] Radar: d34th4ck3r: my guess is that you don't have fixtures enabled in your test_helper.rb, or you don't have fixtures in test/fixtures.
[04:01:03] d34th4ck3r: I have no idea what you meant by enabling fixtures in test_helper.rb
[04:01:34] Radar: d34th4ck3r: Show us test_helper.rb and I'll tell you :)
[04:02:16] d34th4ck3r: I added it, here: https://gist.github.com/d34th4ck3r/93c22da400fa79c5e7d2
[04:02:28] rshetty: has joined #RubyOnRails
[04:03:18] Radar: That's all in that file?
[04:03:23] Radar: Do you have test/fixtures/users.yml
[04:04:30] d34th4ck3r: Yup! Added users.yml too: https://gist.github.com/d34th4ck3r/93c22da400fa79c5e7d2
[04:07:39] dopie: has joined #RubyOnRails
[04:08:05] dopie: Radar, mind looking at my code and giving your thoughts on how I can improve it?
[04:08:06] dopie: https://gist.github.com/staycreativedesign/370bccd4cc5d7b056fd6
[04:08:20] dopie: new_users_controller.rb is the newer one and users_controller.rb is the old one
[04:08:23] shibabu: has joined #RubyOnRails
[04:08:41] d34th4ck3r: I guess he???s busy looking at my code right now haha
[04:08:43] Radar: d34th4ck3r: seems alright. I don't use Test::Unit so I don't know much about what it's doing.
[04:08:53] Radar: d34th4ck3r: RSpec is what I use, and I pair that with FactoryGirl instead of fixtures too
[04:09:06] sevenseacat: i dont really like either of those controllers.
[04:09:17] dopie: sevenseacat, what would you suggest to improve?
[04:09:31] Radar: sevenseacat: this one's youres
[04:09:37] Aeyrix: payment_valid should be private
[04:09:38] Radar: Where DID that e come from? geez
[04:09:40] sevenseacat: why have you extracted out all of these methods?
[04:09:44] Aeyrix: private is all the way up there
[04:09:46] Aeyrix: disregard me
[04:10:26] dopie: sevenseacat, so my status won't be loaded
[04:10:29] sevenseacat: forked and typing, be right there
[04:10:31] braincrash: has joined #RubyOnRails
[04:10:36] dopie: sevenseacat, ok
[04:10:46] avemestr: has joined #RubyOnRails
[04:11:04] dopie: Since I would consider sevenseacat, Radar at the top of the ror food chain
[04:11:04] d34th4ck3r: Radar: I just don???t seem to understand why do I get ???undefined method??? error for ???users??? when it???s an inbuilt function
[04:11:30] Radar: d34th4ck3r: It's not an inbuilt function. It's magically defined by some Rails helper depending on what fixtures are loaded.
[04:12:09] Radar: d34th4ck3r: You're missing "fixtures :all" from test_helper.rb, actually.
[04:12:19] Radar: d34th4ck3r: Add that inside the TestCase class, without the quotes
[04:12:21] Radar: try it again
[04:13:06] sevenseacat: https://gist.github.com/sevenseacat/a71bf8667f10aaa4f87a think i got everything
[04:13:27] sevenseacat: ooh nope missed one
[04:13:28] d34th4ck3r: Radar, undefined method ???fixtures??? :p
[04:13:56] sevenseacat: though to be fair if this was my code, I'd probably move the stuff to do with the external service into a service object
[04:14:54] seank_: has joined #RubyOnRails
[04:14:59] dopie: sevenseacat, cool thank you
[04:15:11] dopie: man you just pretty much sliced in half everything
[04:15:29] sevenseacat: theres no need to overcomplicate things with heaps of tiny methods, all they do is require more mental fortitude to see whats actually going on
[04:15:45] sevenseacat: looking at your original controllers, i had no idea what they actually did
[04:16:28] h7br1x: has joined #RubyOnRails
[04:16:32] sevenseacat: you may want to move the member_id stuff to the model
[04:17:15] sevenseacat: and the video stuff to a service, so it could just be like service = VideoService.new(params), if service.payment_successful? #do stuff
[04:18:15] d34th4ck3r: Radar: btw, for the same reason I started using RSpec and FactoryGirl but I getting error like ???undefined method??? for ???build??? and ???create???etc.
[04:19:23] Radar: d34th4ck3r: That's because the DSL wasn't included.
[04:19:28] Radar: d34th4ck3r: Gist test_helper.rb again
[04:19:47] rshetty: has joined #RubyOnRails
[04:20:11] trosborn: has joined #RubyOnRails
[04:21:53] d34th4ck3r: Radar: I haven???t changed much besides adding the line you told me, but here you are: https://gist.github.com/d34th4ck3r/93c22da400fa79c5e7d2
[04:22:05] dopie: sevenseacat, whats the difference between params[:ans] and params["and"]
[04:22:27] dopie: is there a specific reason you chose to do that?
[04:23:21] Radar: d34th4ck3r: Why are you redefining that class.
[04:23:35] rshetty: has joined #RubyOnRails
[04:23:40] Radar: Oh, that's what mine has too..
[04:23:46] Radar: Well, works on my machine :D
[04:24:00] Radar: bbl need to do stuff
[04:24:12] sevenseacat: https://gist.github.com/sevenseacat/c914e3445899bce97fdc because I am in an exceptionally good mood
[04:24:14] Radar: dopie: parameter access in Rails is typically done with symbols, not strings.
[04:25:23] sevenseacat: thats how I would do it.
[04:25:41] sevenseacat: without any other information on what you're doing or why
[04:26:02] d34th4ck3r: Radar: can you gist your code real quick?
[04:26:18] sevenseacat: though why you're redirecting to a login page when the user has already been found and identified, i dont know
[04:26:19] Radar: d34th4ck3r: generate a new rails app
[04:26:20] Radar: that is my code
[04:26:23] Radar: bye for now
[04:26:30] sarink: has joined #RubyOnRails
[04:28:33] baweaver: has joined #RubyOnRails
[04:32:29] m3_del: has joined #RubyOnRails
[04:32:44] rshetty: has joined #RubyOnRails
[04:33:46] m3_del: has joined #RubyOnRails
[04:33:48] chipotle: has joined #RubyOnRails
[04:35:29] sarink: has joined #RubyOnRails
[04:35:45] dopie: sevenseacat, thats just a temp redirect
[04:36:14] jamto11: has joined #RubyOnRails
[04:38:50] Cervajz_: has joined #RubyOnRails
[04:39:03] HANJIN: has joined #RubyOnRails
[04:43:27] h7br1x: has joined #RubyOnRails
[04:44:00] pontiki: dopie: params method returns an instance of ActionController::Parameters, which inherits from HashWithIndifferentAccess that lets you refer to the same object with either string or symbol keys, as long as thos stings and symbols can be converted back and forth. it's a bit controversial.
[04:44:38] pontiki: dopie so params[:ans] and params["ans"] both point to the *same* object
[04:44:52] dopie: but :ans is preferred
[04:45:13] pontiki: sorry, i'm have laggy network problems
[04:45:32] pontiki: i meant "yes, :ans is quite preferred"
[04:45:42] dopie: pontiki, thanks :)
[04:45:55] pontiki: but there are time this will come back and bite you in the ass.
[04:46:29] sevenseacat: if you're not dealing with a HWIA, yeah
[04:46:58] pawnbox: has joined #RubyOnRails
[04:47:01] dopie: I was just returning what the params gave
[04:47:39] darrencauthon: has joined #RubyOnRails
[04:49:01] shinenelson: has joined #RubyOnRails
[04:50:01] bruno-: has joined #RubyOnRails
[04:50:01] dan0034001: has joined #RubyOnRails
[04:50:46] pawnbox_: has joined #RubyOnRails
[04:50:48] sarink: has joined #RubyOnRails
[04:51:46] pontiki: well, sorry, i thought you might like some deeper explanation. no worries.
[04:51:56] krz: has joined #RubyOnRails
[04:52:06] dopie: pontiki, no that was great explanation :)
[04:52:40] dopie: I meant to say that I just returned the params in string form because thats what they came in
[04:53:46] LateralOctober: has joined #RubyOnRails
[04:57:20] speaking1ode: has joined #RubyOnRails
[04:57:27] lytol_: has joined #RubyOnRails
[04:58:59] nemo_: has joined #RubyOnRails
[05:03:08] IFrank00: has joined #RubyOnRails
[05:04:10] RegulationD: has joined #RubyOnRails
[05:04:46] pontiki: krainboltgreene: just read your part 2 of rails dev on docker. will there be a part 3?
[05:07:03] IFrank00: need some help with this code https://gist.github.com/Frank004/f03b33b2297d84881c34 Im adding a class to the form if it has the error_validation class but. the code that I have runs only on click event how can I convert it to on present of the class validation error
[05:09:17] sevenseacat: IFrank00: seems unrelated to rails
[05:09:33] pontiki: also: seems like you're adding that event listener to every div in the page
[05:10:54] IFrank00: what is the right code to listen to only the div with the error class that rails puts
[05:12:15] pontiki: you could just select $(".field_with_errors")
[05:12:27] rshetty: has joined #RubyOnRails
[05:13:31] IFrank00: https://gist.github.com/Frank004/f03b33b2297d84881c34 I add the view render to the gist
[05:13:57] pontiki: try this: https://gist.github.com/Frank004/f03b33b2297d84881c34#gistcomment-1604653
[05:14:28] pontiki: but i'm not quite sure about the parents bit. nevertheless, this isn't the channel to ask jQuery questions on
[05:15:19] IFrank00: pontiki thank you
[05:15:26] xcm: has joined #RubyOnRails
[05:15:29] pawnbox: has joined #RubyOnRails
[05:15:47] h7br1x: has joined #RubyOnRails
[05:17:00] pawnbox: has joined #RubyOnRails
[05:17:12] IFrank00: pontiki, works just add it a ); to your code and work like a charm
[05:17:34] IFrank00: pontiki, thank you for taking the time
[05:17:52] pontiki: do you understand what it does and why?
[05:17:58] pontiki: meanwhile, i'm off to bed
[05:18:04] IFrank00: sevenseacat, thnks as always
[05:18:36] IFrank00: yes I was looking for the syntax
[05:18:42] arup_r: has joined #RubyOnRails
[05:18:43] workmad3: has joined #RubyOnRails
[05:20:54] jamto11: has joined #RubyOnRails
[05:21:53] sarink: has joined #RubyOnRails
[05:25:26] lxsameer: has joined #RubyOnRails
[05:25:26] lxsameer: has joined #RubyOnRails
[05:28:39] Cervajz_: has joined #RubyOnRails
[05:30:04] moeabdol: has joined #RubyOnRails
[05:34:10] toy: has joined #RubyOnRails
[05:34:23] m3_del: has joined #RubyOnRails
[05:36:41] EminenceHC: has joined #RubyOnRails
[05:36:47] quazimodo: has joined #RubyOnRails
[05:39:06] jenrzzz: has joined #RubyOnRails
[05:39:22] Wiserlander: has joined #RubyOnRails
[05:40:00] arup_r: has joined #RubyOnRails
[05:42:27] kp666: has joined #RubyOnRails
[05:43:28] Contigi: has joined #RubyOnRails
[05:43:53] pawnbox: has joined #RubyOnRails
[05:45:03] yogeshrt: has joined #RubyOnRails
[05:45:23] avemestr: has joined #RubyOnRails
[05:46:17] pydave6367: has joined #RubyOnRails
[05:47:17] seank_: has joined #RubyOnRails
[05:48:39] darrencauthon: has joined #RubyOnRails
[05:51:48] bruno-: has joined #RubyOnRails
[05:53:39] jenrzzz: has joined #RubyOnRails
[05:56:04] shibabu: has joined #RubyOnRails
[05:59:02] trosborn: has joined #RubyOnRails
[06:00:11] nya: has joined #RubyOnRails
[06:00:56] krz: has joined #RubyOnRails
[06:03:43] sameerynho: has joined #RubyOnRails
[06:05:43] marcoceppi: has joined #RubyOnRails
[06:06:05] bobbobbins: has joined #RubyOnRails
[06:06:31] Maletor: has joined #RubyOnRails
[06:09:14] brt: has joined #RubyOnRails
[06:10:34] dhjondoh: has joined #RubyOnRails
[06:13:14] ja: what's the deal with having to both specify column limit in migrations but also validates_length_of in models?
[06:13:23] chipotle: has joined #RubyOnRails
[06:13:24] quazimodo: has joined #RubyOnRails
[06:13:28] ivanyk: has joined #RubyOnRails
[06:13:39] sevenseacat: one is for the database. one is for the model?
[06:14:00] ja: yeah, but why doesn't it just default to validate the length of the column?
[06:14:05] ja: column limit*
[06:14:16] dan0034001: has joined #RubyOnRails
[06:14:35] avemestr: has joined #RubyOnRails
[06:14:57] sevenseacat: what is 'it'?
[06:17:26] ja: active record
[06:17:43] pawnbox: has joined #RubyOnRails
[06:18:00] sevenseacat: activerecord doesn't write validations for you, ever.
[06:19:42] ja: right. I'm just sorta dumb sometimes :D
[06:19:48] ja: but I really hate repeating myself
[06:19:58] arup_r: ja there is some reasoning http://stackoverflow.com/questions/13122791/rails-validation-in-model-vs-migration
[06:20:07] sevenseacat: so don't. why do you need to specify a length in the db?
[06:20:09] ja: and I can't think of a single scenario where I would want it not to validate the length maximum equal to the column limit
[06:20:25] ja: thanks, arup_r
[06:20:37] ja: sevenseacat: because there's only a default with MySQL, it seems (255)
[06:20:45] ja: with other adapters it seems undefined
[06:21:02] sevenseacat: its not, but even if it was, whats the problem?
[06:21:13] sevenseacat: you're validating it in the model so invalid data never gets to your db
[06:21:34] ja: hrm??? I guess that's true
[06:21:41] lxsameer_: has joined #RubyOnRails
[06:21:50] arup_r: ja sometimes if you store say an OTP which should be say exactly 10 chars long, then AR validation helps ?
[06:22:47] ja: OTP? one-time password?
[06:23:05] ja: I guess it wouldn't help, no
[06:23:09] ja: in that case
[06:23:17] ja: so... yeah... :D thanks!
[06:23:21] pledgeshield: has joined #RubyOnRails
[06:24:04] dideler: has joined #RubyOnRails
[06:24:41] arup_r: ja but go through the reasoning from the linked SO answer which is helpful to know.. I am also reading lol
[06:25:01] dan0034001: has joined #RubyOnRails
[06:25:44] ja: yeah, arup_r
[06:26:24] chrissonar: has joined #RubyOnRails
[06:26:24] ja: sometimes I edit my database with an SQL client, so also having DB constraints is probably a good idea after all
[06:26:34] d34th4ck3r: has joined #RubyOnRails
[06:27:34] sevenseacat: don't ever manipulate the structure of the db of a rails app with an sql client. always use migrations.
[06:28:40] ja: >.> I know, I know
[06:29:17] ja: unless it's an existing database used by other things than my Rails app, I guess
[06:29:35] sevenseacat: your Rails app still needs to know about structural changes, which are done via migrations.
[06:29:47] ja: oh, you said the structure
[06:29:49] ja: of course not
[06:29:52] ja: I only edit the data
[06:30:13] ja: wouldn't dream of editing the structure through anything but migrations
[06:30:52] moeabdol: has joined #RubyOnRails
[06:30:57] ja: from the answer on http://stackoverflow.com/questions/13122791/rails-validation-in-model-vs-migration it sounds like his three reasons are really one and the same: ensuring uniqueness, hm
[06:33:04] qejk: has joined #RubyOnRails
[06:33:25] arup_r: has joined #RubyOnRails
[06:35:17] alistair: has joined #RubyOnRails
[06:35:23] m3_del: has joined #RubyOnRails
[06:36:16] lxsameer_: has joined #RubyOnRails
[06:37:43] alistair: has left #RubyOnRails: ()
[06:37:55] arup_r: has joined #RubyOnRails
[06:39:00] arup_r: has joined #RubyOnRails
[06:39:34] arup_r: has joined #RubyOnRails
[06:46:31] yogeshrt: has joined #RubyOnRails
[06:46:59] rvanlieshout: has joined #RubyOnRails
[06:47:42] srinidhi: has joined #RubyOnRails
[06:49:12] MartinElvar: has joined #RubyOnRails
[06:49:22] darrencauthon: has joined #RubyOnRails
[06:49:39] tagrudev: has joined #RubyOnRails
[06:52:58] djbkd: has joined #RubyOnRails
[06:54:26] oscarb92: hey people, I'm using jquery ui autocomplete gem https://github.com/peterwillcn/rails4-autocomplete. It's working but the results are showing like unformatted li elements
[06:55:00] oscarb92: what could possibly cause this?
[06:55:03] sevenseacat: you havent included the CSS?
[06:55:25] Jasaka: has joined #RubyOnRails
[06:56:44] oscarb92: sevenseacat: :o totally forgot, thanks
[06:57:04] sevenseacat: oscarb92: the instructions state to make sure jquery ui is configured first - that includes css
[06:57:36] oscarb92: sevenseacat: you're right, I missed the css
[06:59:47] sarink: has joined #RubyOnRails
[06:59:49] SteenJobs: has joined #RubyOnRails
[07:01:08] kerunaru: has joined #RubyOnRails
[07:01:34] benlieb: has joined #RubyOnRails
[07:02:55] trosborn: has joined #RubyOnRails
[07:05:06] RegulationD: has joined #RubyOnRails
[07:06:50] workmad3: has joined #RubyOnRails
[07:06:57] trautwein: has joined #RubyOnRails
[07:10:10] aganov: has joined #RubyOnRails
[07:18:05] moeabdol: has joined #RubyOnRails
[07:19:14] nya: has joined #RubyOnRails
[07:21:21] sl33k: has joined #RubyOnRails
[07:22:42] dan0034001: has joined #RubyOnRails
[07:24:36] d34th4ck3r: What???s a good way for testing Rails application with MongoId backed as fixtures doesn???t work?
[07:25:31] FailBit: d34th4ck3r: fixtures very well do work, thank you very much
[07:25:40] sevenseacat: they do work, but factories are a viable alternative.
[07:25:42] FailBit: they work fine on mongoid
[07:26:22] FailBit: if this is your first project
[07:26:30] FailBit: please consider not using mongodb
[07:26:50] krz: has joined #RubyOnRails
[07:26:51] FailBit: it has made my life miserable over the past few months
[07:27:05] d34th4ck3r: https://groups.google.com/forum/?fromgroups=#!topic/mongoid/tqlx3j88Lqw
[07:27:19] d34th4ck3r: FailBit: Naah. I have worked with Rails a bit.
[07:27:24] sevenseacat: d34th4ck3r: did you check the date on that post?
[07:27:38] d34th4ck3r: but I???m new to Rails 4.2
[07:27:44] FailBit: mongoid has changed a lot over the years
[07:27:52] sevenseacat: a lot since 2010.
[07:27:56] FailBit: these days it basically copies AR to a point
[07:28:11] FailBit: the query syntax is different but that's about it
[07:30:00] relix: has joined #RubyOnRails
[07:30:29] chipotle: has joined #RubyOnRails
[07:31:13] jerry_tao: has joined #RubyOnRails
[07:31:59] d34th4ck3r: Argh. When I add line ???fixtures :all??? to my test_helper.rb it gives me undefined method ???fixtures??? and I have no idea why, except for going with the post saying it???s not supported.
[07:33:01] d34th4ck3r: just a moment
[07:33:36] d34th4ck3r: https://gist.github.com/d34th4ck3r/93c22da400fa79c5e7d2
[07:33:43] d34th4ck3r: ^: here you are
[07:33:58] sevenseacat: oh i saw that post on stackoverflow today
[07:34:26] sevenseacat: it didnt mention mongoid though from memory
[07:34:56] d34th4ck3r: sevenseacat: That probably was me. I reached to that conclusion because of this link: http://stackoverflow.com/questions/8640802/undefined-method-fixtures-for-activesupporttestcaseclass-while-testing-wi
[07:36:07] m3_del: has joined #RubyOnRails
[07:36:14] sevenseacat: looks like you need a gem to include support for fixtures in mongoid
[07:37:03] d34th4ck3r: Yup! That???s why I asked the question in the first place. Is it better to go with that gem or is there better to just use Rspec/FactoryGirl. :)
[07:37:25] george2: has left #RubyOnRails: ()
[07:37:35] sevenseacat: and there are a couple out there that do it
[07:37:39] sevenseacat: no, you never asked that question
[07:37:49] sevenseacat: you came in boldly and arrogantly stating that fixtures didnt work
[07:38:00] sevenseacat: which is incorrect
[07:38:02] d34th4ck3r: ah! My bad. Should have been more verbose.
[07:38:34] d34th4ck3r: Didn???t mean to come out as arrogant for sure.
[07:39:35] czerasz: has joined #RubyOnRails
[07:40:10] arup_r: d34th4ck3r: cool bro! move on haha
[07:41:43] d34th4ck3r: I wish I could! haha I???m still confused with which choice will be better in the long run.
[07:42:06] sevenseacat: between rspec and minitest? either
[07:42:18] comrad: has joined #RubyOnRails
[07:43:21] d34th4ck3r: and between fixtures and FactoryGirl?
[07:43:59] sevenseacat: we've been telling you that for days.
[07:45:57] d34th4ck3r: Noted. Thanks!
[07:46:46] jas02: has joined #RubyOnRails
[07:47:55] seank_: has joined #RubyOnRails
[07:48:05] dan0034001: has joined #RubyOnRails
[07:49:59] dan0034001: has joined #RubyOnRails
[07:50:22] darrencauthon: has joined #RubyOnRails
[07:50:40] Macaveli: has joined #RubyOnRails
[07:52:31] artto: has joined #RubyOnRails
[07:53:33] matcouto: has joined #RubyOnRails
[07:54:10] beauby: has joined #RubyOnRails
[07:55:39] n008f4g_: has joined #RubyOnRails
[07:57:48] sdwrage: has joined #RubyOnRails
[07:58:22] srinidhi: has joined #RubyOnRails
[08:00:56] zpe: has joined #RubyOnRails
[08:01:30] arathald: hooray, I've got a website up!
[08:01:40] arathald: didn't code it, but it's a website
[08:01:44] AzaToth: has joined #RubyOnRails
[08:02:17] jerry_tao: has joined #RubyOnRails
[08:03:10] krz: has joined #RubyOnRails
[08:04:08] spijet: Good day guys! What's the 'good' way to code a stop behaviour in ActiveJob? At the moment I have a worker which connects to PgSQL server, issues a query, waits for data and sends it over an e-mail. The queue is managed by sidekiq. Sometimes queries take far too much time and I want to kill this 'stalled' workers. If I just click 'stop' in sidekiq Web UI, the worker gets kicked from the queue, but sidekiq
[08:04:10] spijet: waits until the worker stops (and query is completed).
[08:06:59] yardenbar: has joined #RubyOnRails
[08:08:29] CatMartyn: has joined #RubyOnRails
[08:10:43] ruurd: has joined #RubyOnRails
[08:11:30] MartinElvar: has joined #RubyOnRails
[08:14:22] futilegames: has joined #RubyOnRails
[08:15:00] darutoko: has joined #RubyOnRails
[08:16:19] sdwrage: has joined #RubyOnRails
[08:17:23] kimegede: has joined #RubyOnRails
[08:22:06] sl33k: has joined #RubyOnRails
[08:23:29] norc: has joined #RubyOnRails
[08:23:53] norc: Hi. Given a simple_form_for @object, how do I add input fields that do not respond to any attribute in my model?
[08:24:52] nemo_: has joined #RubyOnRails
[08:24:56] arup_r: norc: input_field_tag helper ?
[08:26:07] jas02: has joined #RubyOnRails
[08:26:19] sarink: has joined #RubyOnRails
[08:26:33] Lightsword: has joined #RubyOnRails
[08:28:11] gavit: has joined #RubyOnRails
[08:28:52] arup_r: norc: Better is some non persistent field like using attr_accessor macro
[08:29:01] rvanlieshout: norc: = text_field_tag
[08:29:14] arup_r: or use *_tag helper
[08:29:35] arup_r: norc: There you go: http://stackoverflow.com/a/13259454/2767755
[08:29:59] norc: arup_r: Ahh. Thanks for spoonfeeding.
[08:30:14] kerunaru: has joined #RubyOnRails
[08:30:30] arup_r: But, when I don't have direct model field, I use attr_* to define it and use form_for happily
[08:30:36] norc: arup_r: But yeah, the comment alone suggests an attr_accessor in my model would be the cleaner way.
[08:30:40] arup_r: That is so easy
[08:30:42] nfk|laptop: has joined #RubyOnRails
[08:30:59] Pumukel: has joined #RubyOnRails
[08:31:04] norc: Sure, just wanted to make sure there wasnt a more elegant way.
[08:31:16] goldbug: has joined #RubyOnRails
[08:31:22] norc: (My model really should not care for arguments that dont make it past my controller)
[08:31:44] norc: But I guess that is the price for being lazy and using simple_form
[08:32:19] arup_r: norc: I never felt any other form objects to use. I am happy with form_for and form_tag
[08:32:46] rvanlieshout: norc: it all depends on if that form attribute has any relationship to your model instance
[08:33:29] jas02: has left #RubyOnRails: ()
[08:33:45] arup_r: norc: read this guy http://stackoverflow.com/a/12622896/2767755
[08:34:15] goldbug: Hi folks, I'm still getting a 'Stack level too deep' error message when trying to create or update records via my rudimentary webform. The model, controller and view files are here along with the console error message I'm getting: https://gist.github.com/anonymous/e00073961443368e9791
[08:37:28] sevenseacat: the globalize stuff looks kinda sketchy to me. i'd look at tweaking that.
[08:37:36] sevenseacat: or at least investigating that
[08:39:24] dhjondoh: has joined #RubyOnRails
[08:40:07] arup_r: goldbug: Try to create a Person from `rails console` and see from where it is coming. I am sure something is wrong inside the model
[08:40:50] sevenseacat: i'm not sure how that would give a different error message, but it's worth a shot
[08:41:03] goldbug: I can create and edit the Person in the console without any problems. This seems just to be related to the webform.
[08:41:20] goldbug: (Which is not to say I'm rejecting the possibility that something *is* going wrong in the model.)
[08:41:21] sevenseacat: with the exact same params?
[08:41:31] sevenseacat: show us that?
[08:41:57] arup_r: goldbug: web form is posting to controller and from controller I am seeing rollback..
[08:42:08] arup_r: So I am suspecting it as model error
[08:42:15] arup_r: show what sevenseacat asked
[08:42:38] futilegames: has joined #RubyOnRails
[08:45:29] Linuus: has joined #RubyOnRails
[08:45:40] Ergo: has joined #RubyOnRails
[08:46:12] czerasz: has joined #RubyOnRails
[08:46:45] arup_r: seems error is from here: https://gist.github.com/anonymous/e00073961443368e9791#file-person-rb-L22
[08:47:25] hfp_work: has joined #RubyOnRails
[08:47:30] arup_r: because using before_validation you already capitalized, and using before_save you again tried to capitalize and due to use of `!` version, it return nil
[08:47:50] arup_r: and the callback cancelled ?
[08:48:04] arup_r: the commit
[08:48:19] arup_r: can you comment the line I mentioned and try to create again
[08:48:25] arup_r: goldbug: ^
[08:48:31] goldbug: Here's the console output: https://gist.github.com/anonymous/fe3b3dcf0dfc8f322360
[08:48:34] goldbug: Let me just try that, arup_r.
[08:48:52] sevenseacat: goldbug: you didnt save the record there
[08:48:56] sevenseacat: you also left out half the parameters
[08:49:07] arup_r: but that don't raise SystemStackError (stack level too deep)
[08:49:11] arup_r: so I am not sure
[08:49:25] arup_r: there should be some recursive endless call happened
[08:50:01] seank_: has joined #RubyOnRails
[08:50:18] arup_r: well.. got it
[08:50:26] arup_r: before_save run validation and
[08:51:07] darrencauthon: has joined #RubyOnRails
[08:51:22] CheckYourSix: has joined #RubyOnRails
[08:51:53] goldbug: sevenseacat: The other params are empty, so shouldn't make a difference I wouldn't have thought. Here's me saving it: https://gist.github.com/anonymous/56a650aa9c42e48ee4f8
[08:52:15] goldbug: arup_r: I did try and comment out L22 but no joy.
[08:52:56] mark3: has joined #RubyOnRails
[08:53:00] sevenseacat: ok, thats a good fifteen minutes and no answers. good luck
[08:53:41] m3_del: has joined #RubyOnRails
[08:54:16] goldbug: Is there any way I can get a useful backtrace on this error?
[08:54:20] lipoqil: has joined #RubyOnRails
[08:54:24] FailBit: In 1987, printers overtook dogs as the number one pet in America (about 50 million printers resided in 24 million homes in 1986). About 37% of American homes today have at least one printer.
[08:54:33] FailBit: Some notable people who disliked printers: Napoleon Bonaparte, Dwight D. Eisenhower, Hitler.
[08:55:02] workmad3: has joined #RubyOnRails
[08:55:41] FailBit: goldbug: you are declaring a constant?
[08:56:01] norc: arup_r: I guess I actually have to figure out, what advantages I get by passing an AR instance instead of a symbol to simple_form_for, or whether it just uses it for url guessing.
[08:56:01] goldbug: Not on purpose. . .
[08:56:10] goldbug: (I should point out, I am very new to all this.)
[08:56:18] goldbug: (In case not already patently obvious.)
[08:56:18] FailBit: anything starting with a capital is a Constant
[08:56:55] FailBit: Constants are not truly constant, but ruby will bug you if you try to change its value
[08:57:10] kitsuneyo: has joined #RubyOnRails
[08:57:12] FailBit: (ruby will not bug you if you try to change the reference, which is why you normally freeze stuff that goes into them)
[08:57:19] goldbug: I can confirm that the console's behaviour is the same even if I use lvb (:
[08:58:20] krz: has joined #RubyOnRails
[09:00:04] poikon: has joined #RubyOnRails
[09:00:49] arBmind: has joined #RubyOnRails
[09:03:12] bennysan: has joined #RubyOnRails
[09:04:26] fifi-v: has joined #RubyOnRails
[09:04:54] fifi-v: has left #RubyOnRails: ()
[09:05:28] tedstriker: has joined #RubyOnRails
[09:05:56] RegulationD: has joined #RubyOnRails
[09:06:13] jsrn_: has joined #RubyOnRails
[09:07:58] k1i: has joined #RubyOnRails
[09:08:55] jahbrewski: has joined #RubyOnRails
[09:09:42] atrius: has joined #RubyOnRails
[09:10:05] skiz: has left #RubyOnRails: ()
[09:10:06] artto: has joined #RubyOnRails
[09:10:16] Peg-leg: has joined #RubyOnRails
[09:10:47] adre: has joined #RubyOnRails
[09:10:52] trosborn: has joined #RubyOnRails
[09:12:48] quazimodo: has joined #RubyOnRails
[09:14:01] emilkarl: has joined #RubyOnRails
[09:19:33] stamina: has joined #RubyOnRails
[09:20:04] saimancroy: has joined #RubyOnRails
[09:23:38] DefV: has joined #RubyOnRails
[09:23:42] d34th4ck3r: I keep getting ???ArgumentError: Factory not register??? for this test function: https://gist.github.com/d34th4ck3r/93c22da400fa79c5e7d2 I???m giving a try to FactoryGirl with Mongoid now.
[09:24:38] FailBit: your stuff needs to be either all in spec/ or all in test/
[09:25:06] futilegames: has left #RubyOnRails: ()
[09:25:13] ngr: has joined #RubyOnRails
[09:25:21] sevenseacat: d34th4ck3r: you also need to show the updated test, not just the updated error
[09:26:04] vigintas: has joined #RubyOnRails
[09:26:05] yogeshrt: has joined #RubyOnRails
[09:26:36] d34th4ck3r: ah right! I missed out on updating test. https://gist.github.com/d34th4ck3r/93c22da400fa79c5e7d2
[09:26:56] sevenseacat: you're not using factory girl correctly.
[09:27:07] sevenseacat: why are you generating attributes, then passing those attributes back to factory girl?
[09:27:54] raunicolae: has joined #RubyOnRails
[09:28:17] raunicolae: has left #RubyOnRails: ()
[09:29:12] nettoweb: has joined #RubyOnRails
[09:29:41] d34th4ck3r: sevenseacat: no reason. Why is that a bad idea?
[09:29:48] sevenseacat: its not how it works
[09:29:54] sevenseacat: its quite pointless, also
[09:30:00] sevenseacat: doing two steps instead of one
[09:30:12] herbst: has joined #RubyOnRails
[09:30:50] norc: d34th4ck3r: I recommend a quick read just at the getting started bit: https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md :)
[09:31:01] sevenseacat: https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md#using-factories
[09:31:11] gingray: has joined #RubyOnRails
[09:31:42] norc: sevenseacat: Just argue that your internet connection is based on RFC 1149.
[09:31:52] WhereIsMySpoon_: has joined #RubyOnRails
[09:32:13] n1ck7: has joined #RubyOnRails
[09:33:52] d34th4ck3r: I am reading that link haha But never realized that generating attributes will create problem.
[09:34:51] sevenseacat: but passing those attributes to a create call is not how FG works.
[09:34:53] norc: d34th4ck3r: It does not create a problem, you are using it for something its not designed for.
[09:35:58] norc: sevenseacat: Now I was too slow.
[09:38:54] vigintas: has joined #RubyOnRails
[09:39:49] norc: d34th4ck3r: To give you a perspective, attributes_for can be useful for generating a set of valid attributes to pass to a controller, request or whatever.
[09:41:24] Ropeney: has joined #RubyOnRails
[09:43:22] jahbrewski: has joined #RubyOnRails
[09:43:44] nfk|laptop: has joined #RubyOnRails
[09:45:07] mikecmpbll: has joined #RubyOnRails
[09:48:52] simi: has joined #RubyOnRails
[09:49:18] marr: has joined #RubyOnRails
[09:50:58] blackmesa: has joined #RubyOnRails
[09:51:54] darrencauthon: has joined #RubyOnRails
[09:53:40] bruno-: has joined #RubyOnRails
[09:54:57] bonemind: has joined #RubyOnRails
[09:55:36] trautwein: has joined #RubyOnRails
[09:56:18] pwnd_nsfw: has joined #RubyOnRails
[09:56:32] beauby: has joined #RubyOnRails
[09:56:34] sarink: has joined #RubyOnRails
[10:02:53] m3_del: has joined #RubyOnRails
[10:07:51] rodfersou: has joined #RubyOnRails
[10:08:22] ibouvousaime: has joined #RubyOnRails
[10:09:17] n1ck7: has joined #RubyOnRails
[10:09:24] newmacuser: has joined #RubyOnRails
[10:11:48] newmacuser: hey, I'm trying to set up a dev environment using thoughbots laptop script on my new macbook, Can anyone help me what went wrong?
[10:12:00] newmacuser: https://github.com/thoughtbot/laptop
[10:12:27] newmacuser: should I paste those lines one by one ?
[10:14:16] mytrile: has joined #RubyOnRails
[10:14:26] workmad3: has joined #RubyOnRails
[10:14:41] siddart: has joined #RubyOnRails
[10:15:18] newmacuser: yea, homebrew
[10:16:18] futilegames: has joined #RubyOnRails
[10:16:18] Pumukel: has joined #RubyOnRails
[10:17:03] jgt: has joined #RubyOnRails
[10:17:56] goldbug: Here's the backtrace for this "stack level too deep" error I keep getting. Can anyone more experienced see where the problem might be coming from? https://gist.github.com/anonymous/009d8b4fcae028dcbed7
[10:18:43] krainboltgreene: goldbug: Tell you what, I've done a lot of Ruby and a lot of Rails, I have never seen anything like that.
[10:19:13] razieliyo: has joined #RubyOnRails
[10:19:15] FailBit: stack too deep?
[10:19:15] krainboltgreene: That's an entirely foreign format for me.
[10:19:28] krainboltgreene: FailBit: No, the gist.
[10:19:46] FailBit: correct me if I'm wrong, but I believe that's a native exception dump for a non-MRI interpreter
[10:19:57] goldbug: krainboltgreene: I pulled it out of byebug.
[10:20:31] krainboltgreene: goldbug: Huh, well look the top line leads me to believe you've got a wild nil going around.
[10:20:35] rickmasta: has joined #RubyOnRails
[10:20:41] krainboltgreene: `action#NilClass, *args#Array`
[10:20:48] FailBit: check your routes
[10:21:06] krainboltgreene: It's displaying the class by each, where action is a NilClass (aka nil) and args is an Array (*, so makes sense)
[10:21:43] krainboltgreene: Why that gives you a SLTD I have no idea.
[10:22:04] krainboltgreene: Oh, maybe you defined a variable that has the same name as a AD method?
[10:22:07] goldbug: FailBit: My routes consist only of "resources :people"
[10:22:27] krainboltgreene: It might then be in the metamagic of the controller.
[10:22:43] krainboltgreene: I've never fully read the Routes source.
[10:23:10] krainboltgreene: goldbug: Any chance you can gist the routes + people controller?
[10:23:27] pwnd_nsfw: has joined #RubyOnRails
[10:23:43] goldbug: The controller (and model + view) are here: https://gist.github.com/anonymous/e00073961443368e9791
[10:24:22] goldbug: As I say, routes.rb consists of Rails.application.routes.draw do resources :people end and that's it.
[10:26:42] goldbug: I hate hearing that q:
[10:26:43] krainboltgreene: Well as a side note http://www.w3.org/International/questions/qa-personal-names
[10:28:18] goldbug: Thankfully I don't need to account for such complexities in my db!
[10:28:24] rhizome: what's this "translates" business?
[10:28:59] krainboltgreene: goldbug: Well, that's the genius of their suggestion: Accounting for that complexity results in a single, length unspecified, text column.
[10:29:17] krainboltgreene: In regards to your problem, I don't see any specific issues.
[10:29:31] krainboltgreene: Nothing is eyeball wrong with your controller or routes.
[10:29:43] krainboltgreene: Your view doesn't even come into play.
[10:30:07] krainboltgreene: So either I'm wrong about the controller, you're not telling us everything about the routes, or something strange is going on in that model code.
[10:30:37] krainboltgreene: Likely to do with translates, globalize_accessors, or globalize_attribute_names
[10:30:45] goldbug: rhizome: Have a look at the Globalize gem. Very useful for multi-lingual data.
[10:31:14] rhizome: sure. i was just wondering. can you comment that out?
[10:31:39] goldbug: krainboltgreene: But you'd think that if there was a problem in the model, I wouldn't be able to create / update at the console level.
[10:32:45] goldbug: rhizome: Good idea, will see what happens.
[10:33:12] xcm: has joined #RubyOnRails
[10:33:36] ldnunes: has joined #RubyOnRails
[10:35:04] dionysus69: has joined #RubyOnRails
[10:35:22] goldbug: Oh yeah. No, I can't comment them out because they are integral to the db structure.
[10:39:40] n1ck7: has joined #RubyOnRails
[10:39:49] goldbug: But I wouldn't at all be surprised if Globalize was the culprit.
[10:40:02] arBmind: has joined #RubyOnRails
[10:41:27] dionysus69: I installed a new environment and I am hesitant to go back to sublime text. what are best choices for rails coding except of vim?
[10:42:01] trautwein: has joined #RubyOnRails
[10:42:05] rvanlieshout: sublime text :)
[10:42:13] rvanlieshout: how much work is installing a new environment?
[10:42:14] dionysus69: omg not emacs vs vim not again
[10:42:23] rvanlieshout: for me it's just sublime, virtualbox, vagrant and *go*
[10:42:37] dionysus69: installing a new env for me is lots of work, I switched from ubuntu to debian
[10:42:57] rhizome: ubuntu is debian
[10:43:06] dionysus69: ye but still I prefer vanilla :)
[10:43:17] dionysus69: I turned out to prefer I guess
[10:43:28] dionysus69: ok so nothing else except of sublime, vim or emacs?
[10:43:45] dionysus69: vim &&|| emacs == too much work
[10:43:53] rhizome: well, there's also the world of text editors in general
[10:44:41] dionysus69: well damn it :D I will give vim or emacs one more shot, its like 5th shot probably
[10:44:47] dionysus69: thanks for input xD
[10:44:49] goldbug: I note that one thing that happens just before the error is thrown is this: Person::Translation Load (0.3ms) SELECT "person_translations".* FROM "person_translations" WHERE "person_translations"."person_id" = ? [["person_id", 3]]
[10:44:53] rvanlieshout: dionysus69: what's wrong with sticking to sublime?
[10:44:56] rhizome: it's just typing man
[10:45:30] dionysus69: rvanlieshout: dunno it doesnt Even have proper syntax highlighting. not too many addons for rails
[10:45:43] rvanlieshout: dionysus69: how many addons do you need?
[10:45:44] dionysus69: rvanlieshout: btw can you list me like all the packages for sublime that you are using?
[10:45:48] rhizome: ooh you haven't been looking in the right place
[10:45:56] dionysus69: list me all addons that help with rails env
[10:46:22] dionysus69: last time I had 2-3 installed and didnt feel like I was using more than a notepad
[10:47:07] hfp_work: has joined #RubyOnRails
[10:47:08] dionysus69: rvanlieshout: ok now I have to brb I will check response when I am back. thanks in advance!
[10:47:26] rvanlieshout: dionysus69: ApacheConf.tmLanguage, Base16, CoffeeScript, Format SQL, Indent XML, Less, Pretty JSON, Puppet, SCSS, Slim, SublimeLinter, SublimeLinter-coffee, SublimeLinter-haml, SubmlimeLinter-ruby, TrailingSpaces
[10:47:45] rhizome: sublime erb is good
[10:47:47] weihan: has joined #RubyOnRails
[10:48:06] dionysus69: rvanlieshout: thanks allot sounds good will install all of them.
[10:48:12] dionysus69: rhizome: you too thx xD
[10:48:27] rvanlieshout: dionysus69: i don't use them all.. that lint thing is awesome
[10:48:34] alotofnoodles: has joined #RubyOnRails
[10:48:49] dionysus69: kk will keep in mind
[10:49:23] alotofno_: has joined #RubyOnRails
[10:49:47] DoubleMalt: has joined #RubyOnRails
[10:50:37] yashinbasement: has joined #RubyOnRails
[10:50:43] seank_: has joined #RubyOnRails
[10:52:06] jgt: has joined #RubyOnRails
[10:52:36] darrencauthon: has joined #RubyOnRails
[10:53:34] lacrymology: has joined #RubyOnRails
[10:54:06] trautwein: has joined #RubyOnRails
[10:54:38] TPBallbag: has joined #RubyOnRails
[10:54:49] chills42: has joined #RubyOnRails
[10:55:34] xcm: has joined #RubyOnRails
[11:01:37] goldbug: I think I'm getting closer to the answer here. It seems that when I create/update or otherwise do anything to a Person object in the console, Globalize correctly addresses the translation table it generates. But not through the webserver. It seems to be passing nil values to the translation table. See here: https://gist.github.com/anonymous/6c91ca3ef60342d2d744
[11:03:31] goldbug: My first thought was because the controller wasn't allowing locale to be passed as a parameter, but adding it doesn't seem to have made a difference (and anyway, locale should default to "en" if nothing is specified).
[11:03:40] m3_del: has joined #RubyOnRails
[11:04:34] adre: has joined #RubyOnRails
[11:05:33] goldbug: It looks like the web server version is not joining the person_translations table to the people table, so when it is trying to select something from person_translations, it's coming up blank.
[11:05:44] quazimodo: has joined #RubyOnRails
[11:06:08] ElFerna: has joined #RubyOnRails
[11:06:51] RegulationD: has joined #RubyOnRails
[11:07:17] TPBallbag: has joined #RubyOnRails
[11:07:34] kitsuneyo: i'm using apple reminders to manage a development checklist for my app, but it doesn't save the ones i've completed. they just disappear. what do you guys use to record your development tasks?
[11:07:59] rvanlieshout: they don't just disappear
[11:08:00] rvanlieshout: they are kept
[11:08:13] rvanlieshout: scroll that list down
[11:08:18] rvanlieshout: and click 'show' for the completed
[11:08:20] rvanlieshout: and we use gitlab here
[11:08:22] Ergo^: has joined #RubyOnRails
[11:08:34] kitsuneyo: lol, thanks rvanlieshout
[11:08:48] kitsuneyo: gitlab huh, is that web-based?
[11:09:03] d34th4ck3r: has joined #RubyOnRails
[11:09:05] rvanlieshout: and self hosted in our case
[11:09:10] yardenbar: has joined #RubyOnRails
[11:09:44] norc: (-> {}).is_a? Proc
[11:09:51] norc: Ops, wrong channel
[11:09:58] rvanlieshout: and related to code, so we can use code reviews for merge requests, kitsuneyo
[11:10:23] kitsuneyo: looking at https://about.gitlab.com/downloads/, it doesn't seem to have a mac os version
[11:10:35] rvanlieshout: kitsuneyo: we don't host it locally
[11:10:49] rvanlieshout: we use it with the complete team. you host that on a centos machine somewhere
[11:10:54] kitsuneyo: and since you solved my idiotic question, apple reminders will do for me
[11:10:57] rvanlieshout: cause i prefer centos :) but any taste is ok i guess
[11:11:30] kitsuneyo: ah ok rvanlieshout, as a lone wolf gitlab is beyond my needs :)
[11:11:49] dhjondoh: has joined #RubyOnRails
[11:12:27] goldbug: Is *anyone* here familiar with Globalize?
[11:12:35] rvanlieshout: kitsuneyo: it would also help with communicating with your customer
[11:12:55] kitsuneyo: rvanlieshout, i don't have any customers yet!
[11:13:08] yogeshrt: has joined #RubyOnRails
[11:13:28] darrencauthon: has joined #RubyOnRails
[11:13:40] kitsuneyo: rvanlieshout, what apps do you work on?
[11:15:02] kitsuneyo: secretive eh
[11:15:17] rvanlieshout: well.. they are for our customers
[11:15:24] kitsuneyo: fair enough :)
[11:15:32] kitsuneyo: ta for the help, bbl
[11:15:33] rvanlieshout: and in quite some cases only used for internal purposes
[11:15:57] rvanlieshout: we have an app that is used by representatives of almost all large beverage company out there
[11:16:22] pydave6367: has joined #RubyOnRails
[11:17:06] mikecmpbll: i went to the heineken factory once.
[11:17:19] rvanlieshout: it's like 'how it's made' :)
[11:17:51] Dbugger: has joined #RubyOnRails
[11:17:56] goldbug: Is it wrong that I want a beer now?
[11:18:01] goldbug: It's 11:17am.
[11:18:05] arup_r: has joined #RubyOnRails
[11:18:36] mikecmpbll: go fix that globalize issue then you can have a beer.
[11:18:49] goldbug: I think I might fix it more easily *after* a beer. . .
[11:19:10] rhizome: ballmer peak
[11:19:25] Dbugger: Hello guys. I have a doubt. I have made a "rails g scaffold Story", and I notice on the generated _form.html.erb" there is a simple "<%= f.submit %>", but when I create a new Model I see "Create Story", but when I edit "Update Story". Where is controlled, the text of this button???
[11:20:00] mikecmpbll: dbugger: magic
[11:20:10] seank_: has joined #RubyOnRails
[11:20:25] mikecmpbll: dbugger: it uses obj.persisted? (or obj.new_record?, i can't remember which) to determine what to display
[11:20:34] mikecmpbll: also the same way it knows whether to POST or PUT :)
[11:20:51] Dbugger: mikecmpbll, but where is the logic written? I dont see it in the controller
[11:21:03] mikecmpbll: it's in rails. look at the code for f.submit
[11:21:16] Dbugger: Ah, really? I did not know that... thanks!
[11:23:28] gregf_: has joined #RubyOnRails
[11:29:44] jas02: has joined #RubyOnRails
[11:31:50] herbst: has joined #RubyOnRails
[11:31:54] Ropeney: has joined #RubyOnRails
[11:31:56] ferr: has joined #RubyOnRails
[11:35:23] yogeshrt: has joined #RubyOnRails
[11:35:47] mrbubbles: has joined #RubyOnRails
[11:39:33] dionysus69: has joined #RubyOnRails
[11:41:27] trautwein: has joined #RubyOnRails
[11:41:37] alaing: has joined #RubyOnRails
[11:41:41] poikon_: has joined #RubyOnRails
[11:42:10] poikon_: has left #RubyOnRails: ()
[11:42:31] poikon: has joined #RubyOnRails
[11:42:57] alaing: has joined #RubyOnRails
[11:43:01] alaing: hi, is it possible to customise simple_form radio buttons?
[11:43:05] gregf_: has joined #RubyOnRails
[11:43:06] alaing: ATM i have f.input :rating, label:false, :collection => Feedback::RATING.map {|k,v| [v,k]}, :as => :radio_buttons
[11:44:09] poikon: o/ hi all
[11:44:27] atrius_: has joined #RubyOnRails
[11:44:35] alaing: I'm hoping to add a class to the label and have the label wrap itself about the radio button and the label text itself (for a larger hitting area for users with disablities)
[11:45:14] sarink: has joined #RubyOnRails
[11:48:39] norc: alaing: Sure. Edit your simple_form.rb initializer accordingly.
[11:48:42] TPBallbag: has joined #RubyOnRails
[11:49:12] norc: alaing: https://github.com/plataformatec/simple_form/wiki/Custom-Wrappers
[11:49:13] TPBallbag: has joined #RubyOnRails
[11:49:55] alaing: norc: thanks I'll give that a try
[11:50:32] kitsuneyo: has joined #RubyOnRails
[11:50:52] mynamepickle: has joined #RubyOnRails
[11:51:19] Icey: has joined #RubyOnRails
[11:53:38] kitsuneyo: has joined #RubyOnRails
[11:53:57] Linuus: has joined #RubyOnRails
[11:54:38] syath: has joined #RubyOnRails
[11:57:31] artto: has joined #RubyOnRails
[12:03:21] Rinzlit: has joined #RubyOnRails
[12:05:42] m3_del: has joined #RubyOnRails
[12:08:58] chrislotix: has joined #RubyOnRails
[12:10:06] adamholt: has joined #RubyOnRails
[12:11:24] Pupeno: has joined #RubyOnRails
[12:11:24] Pupeno: has joined #RubyOnRails
[12:12:56] diegorv: has joined #RubyOnRails
[12:13:38] tknz: has joined #RubyOnRails
[12:14:43] rshetty: has joined #RubyOnRails
[12:18:05] kitsuneyo: has joined #RubyOnRails
[12:18:13] sadaf2606: has joined #RubyOnRails
[12:18:14] herbst: has joined #RubyOnRails
[12:18:40] TPBallbag: has joined #RubyOnRails
[12:18:41] dionysus69: has joined #RubyOnRails
[12:19:25] renews: has joined #RubyOnRails
[12:21:25] MartinEl_: has joined #RubyOnRails
[12:21:44] atomical: has joined #RubyOnRails
[12:21:56] artto: has joined #RubyOnRails
[12:22:30] Macaveli: has joined #RubyOnRails
[12:22:48] Linuus: has joined #RubyOnRails
[12:23:06] jkamenik: has joined #RubyOnRails
[12:26:57] vigintas: has joined #RubyOnRails
[12:29:17] nfk|laptop: has joined #RubyOnRails
[12:31:00] vigintas1: has joined #RubyOnRails
[12:31:26] MartinElvar: has joined #RubyOnRails
[12:32:46] nya: has joined #RubyOnRails
[12:33:02] dici: has joined #RubyOnRails
[12:35:45] closer: has joined #RubyOnRails
[12:36:13] brt: has joined #RubyOnRails
[12:38:46] IFrank00: has joined #RubyOnRails
[12:40:07] sadaf2606: has joined #RubyOnRails
[12:42:38] big|bad|wolf: has joined #RubyOnRails
[12:43:44] newmacuser: has joined #RubyOnRails
[12:44:21] sdwrage: has joined #RubyOnRails
[12:45:48] blackmesa: has joined #RubyOnRails
[12:46:02] sarink: has joined #RubyOnRails
[12:47:53] avash: has joined #RubyOnRails
[12:49:18] quazimodo: has joined #RubyOnRails
[12:49:47] dionysus69: has joined #RubyOnRails
[12:51:36] jgt: has joined #RubyOnRails
[12:52:50] youngbaks: has joined #RubyOnRails
[12:53:48] youngbaks: has joined #RubyOnRails
[12:54:41] youngbaks: has joined #RubyOnRails
[12:56:49] braincrash: has joined #RubyOnRails
[12:59:56] mag42c: has joined #RubyOnRails
[13:00:24] quazimodo: has joined #RubyOnRails
[13:01:09] juhoh: has joined #RubyOnRails
[13:03:59] juhoh: hi, I'm testing my AMS. I've declared a has_many assoc and overridden the association method. how can I test this in rspec? I tried: `expect(subject.association).to receive(:merge).with(Relation.scope)`
[13:05:09] pcpanic: has joined #RubyOnRails
[13:05:28] dionysus69: has joined #RubyOnRails
[13:05:44] pcpanic: Hello peoples - How do I go about saving a random token string for each existing user?
[13:06:17] dionysus69: has joined #RubyOnRails
[13:06:28] m3_del: has joined #RubyOnRails
[13:06:58] arup_r: pcpanic: You can use AR callbacks
[13:07:00] big|bad|wolf: has joined #RubyOnRails
[13:07:30] arup_r: like before_save :create_token and then inside the method do assign the token
[13:07:40] pcpanic: arup_r: thanks, investigating what means...
[13:07:44] RegulationD: has joined #RubyOnRails
[13:08:41] n1lo: has joined #RubyOnRails
[13:08:49] shinnya: has joined #RubyOnRails
[13:09:09] kitsuneyo: has joined #RubyOnRails
[13:09:21] arup_r: pcpanic: One example https://gist.github.com/aruprakshit/dad080a84cf011f99a26
[13:09:53] arup_r: So, if you want to build those token while creating users then use before_create instead of before_save
[13:10:56] pcpanic: arup_r: the users are created, i want to update the existing users
[13:11:34] arup_r: Ok use the right callback then... But AR callbacks are one way to go
[13:12:06] pcpanic: arup_r: I am looking for a simple 1 line to do something like: User.each.update(token: RandomString)
[13:12:25] pcpanic: in the console
[13:12:33] arup_r: use update_all method
[13:12:45] orolo: has joined #RubyOnRails
[13:12:51] pcpanic: arup_r: does that allow different values for each record?
[13:13:16] arup_r: Is it a one time activity ?
[13:13:33] newmacuser: mac user, can anyone help me to setup the dev env in a new macbook using laptop script? https://github.com/thoughtbot/laptop log https://paste.ee/p/Wfwao
[13:14:42] pcpanic: arup_r: yes
[13:14:48] arup_r: pcpanic: User.find_each { |u| u.update(token: RandomString) }
[13:15:04] pcpanic: arup_r: you are da main man :D
[13:15:20] arup_r: No I am the the not :)
[13:15:29] Zarthus: has left #RubyOnRails: ()
[13:15:44] ramortegui: has joined #RubyOnRails
[13:16:35] bratsche: has joined #RubyOnRails
[13:20:06] dhjondoh: has joined #RubyOnRails
[13:21:27] ruurd: has joined #RubyOnRails
[13:23:23] trautwein: has joined #RubyOnRails
[13:23:51] sankaber: has joined #RubyOnRails
[13:24:33] sararegan: has joined #RubyOnRails
[13:24:54] RegulationD: has joined #RubyOnRails
[13:25:11] mary5030: has joined #RubyOnRails
[13:25:45] SeanLazer: has joined #RubyOnRails
[13:25:54] mary5030: has joined #RubyOnRails
[13:27:17] mary5030_: has joined #RubyOnRails
[13:28:11] TPBallbag: has joined #RubyOnRails
[13:29:24] rshetty: has joined #RubyOnRails
[13:29:24] tlarevo: has joined #RubyOnRails
[13:30:27] rshetty_: has joined #RubyOnRails
[13:31:26] artto: has joined #RubyOnRails
[13:31:48] jamto11: has joined #RubyOnRails
[13:31:52] kitsuneyo: has joined #RubyOnRails
[13:36:21] matthewd: newmacuser: Do you have XCode installed?
[13:37:23] rshetty: has joined #RubyOnRails
[13:38:03] sevenseacat: has joined #RubyOnRails
[13:39:19] newmacuser: matthewd: no, it is new pc, I haven't installed anything.
[13:40:13] sankaber: has joined #RubyOnRails
[13:41:12] surrealanalysis: has joined #RubyOnRails
[13:42:48] darrencauthon: has joined #RubyOnRails
[13:43:03] matthewd: newmacuser: Well, I don't specifically recall, but given the command it's trying to run, it sounds like it expect XCode to already be there
[13:43:45] dionysus69: has joined #RubyOnRails
[13:44:52] newmacuser: matthewd: I thought I can install the xcode command line tool without installing xcode, could have installed gentoo instead of mac :D
[13:45:18] sharkman: has joined #RubyOnRails
[13:46:02] ruurd: has joined #RubyOnRails
[13:46:05] sharkman: is there a way to have git manage the database that is on the server? can that be included with add/commit/push commands?
[13:46:14] sharkman: (postgres db)
[13:46:49] dionysus69: has joined #RubyOnRails
[13:47:53] allcentury: has joined #RubyOnRails
[13:48:18] FailBit: that's part of your deploy process
[13:49:07] ldnunes_: has joined #RubyOnRails
[13:49:37] newmacuser: sharkman: why do you need a version control for the db? don't you have the schema and migration files for that?
[13:50:21] sharkman: i have a website that will display articles. and i want to add the articles o my computer, look at what the website would be like, adjust, and deploy
[13:50:30] blackmesa: has joined #RubyOnRails
[13:50:40] sharkman: if its all on the server then when i fiddle around with adding content it would show up right on the webpage
[13:51:11] mikecmpbll: you should build controls to add content and then do it on your live app
[13:51:44] mikecmpbll: how would you do it on your local computer anyways?
[13:53:37] sharkman: what do you mean by control? like a form i can use?
[13:54:07] sharkman: i plan to do that, but what if i add a an article on the server, using a form, and i dont like it
[13:54:12] sharkman: then i can delete it
[13:54:18] sharkman: but it will have been on the server for a few moments
[13:54:25] mikecmpbll: build some draft functionality or something
[13:54:35] sharkman: what does that mean
[13:54:35] mikecmpbll: add_column :posts, :published, :boolean
[13:54:49] mikecmpbll: render @posts.published
[13:55:10] sharkman: like a separate web page which i can use to look things over before marking as published
[13:55:26] sharkman: okay thanks
[13:55:47] mikecmpbll: but the answer anyway is no, applications and data are separate.
[13:56:03] mikecmpbll: you can always use DB tools to dump/load data if you want.
[14:03:20] dionysus69: has joined #RubyOnRails
[14:04:18] bufferino: has joined #RubyOnRails
[14:04:45] dionysus69: has joined #RubyOnRails
[14:07:36] treehug88: has joined #RubyOnRails
[14:08:01] chopin: has joined #RubyOnRails
[14:08:12] nemo_: has joined #RubyOnRails
[14:08:56] rickmasta: has joined #RubyOnRails
[14:12:08] umgrosscol: has joined #RubyOnRails
[14:13:55] chills42: has joined #RubyOnRails
[14:16:50] dopamean_: has joined #RubyOnRails
[14:17:34] mynamepickle: has joined #RubyOnRails
[14:19:39] siddart: has joined #RubyOnRails
[14:20:05] udiudi: has joined #RubyOnRails
[14:20:32] centrx: has joined #RubyOnRails
[14:21:02] rails338: has joined #RubyOnRails
[14:21:04] mary5030: has joined #RubyOnRails
[14:21:11] chopin: has joined #RubyOnRails
[14:22:41] nfk|laptop: has joined #RubyOnRails
[14:24:23] thecyclone: has joined #RubyOnRails
[14:26:37] sarink: has joined #RubyOnRails
[14:27:56] nertzy: has joined #RubyOnRails
[14:28:12] sararegan: has joined #RubyOnRails
[14:29:00] avash: has joined #RubyOnRails
[14:32:44] hephaestus_rg: has joined #RubyOnRails
[14:33:05] mordocai: has joined #RubyOnRails
[14:33:48] xcm: has joined #RubyOnRails
[14:35:25] DarkBushido: has joined #RubyOnRails
[14:36:53] bruno-: has joined #RubyOnRails
[14:37:26] Motoservo: has joined #RubyOnRails
[14:40:15] Cervajz: has joined #RubyOnRails
[14:42:07] mag42c: has joined #RubyOnRails
[14:42:07] pawnbox_: has joined #RubyOnRails
[14:42:38] nemo_: has joined #RubyOnRails
[14:46:01] kies^: has joined #RubyOnRails
[14:46:27] i: has joined #RubyOnRails
[14:47:30] dionysus69: has joined #RubyOnRails
[14:48:43] momomomomo: has joined #RubyOnRails
[14:49:00] atomical: has joined #RubyOnRails
[14:50:14] dionysus69: has joined #RubyOnRails
[14:50:27] TPBallbag: has joined #RubyOnRails
[14:53:30] jgt: has joined #RubyOnRails
[14:54:19] ruurd: has joined #RubyOnRails
[14:55:41] Pupeno: has joined #RubyOnRails
[14:56:35] rickmasta: has joined #RubyOnRails
[14:57:29] pawnbox: has joined #RubyOnRails
[14:59:39] tubbo: sharkman: fwiw if you are doing a kind of blog thing, there are a lot better tools than a database-backed rails app to do the job. but if you want to learn rails, stick with the blog app and make it as good as you can.
[15:00:35] Dbugger: has joined #RubyOnRails
[15:00:41] sharkman: i dont particularly want to learn rails for this. i just figured i would have more control over it if i do it myself
[15:01:09] gregf_: has joined #RubyOnRails
[15:01:37] Dbugger: Hi guys. I have a model with `has_one :start, class_name: "Page", foreign_key: "start_id"`. If I have on one hand an object @story and on the other an object @page, how can I set the start page as @page?
[15:01:51] roxtrongo: has joined #RubyOnRails
[15:02:10] sharkman: i have a specific design i want for my site. and i dont want to force the interface to look someway to fit into some tools already developd
[15:02:20] capin: sharkman: i wrote a basic blogging platform written in rails from scratch FWIW ...serves me well
[15:02:31] sharkman: how long did it take you capin
[15:02:58] sharkman: now that i have the server set up (i think), i think it will only take me a day or two to get a basic form up to add content, and to dynamically generate the page from the db
[15:03:00] capin: ohhh off / on a couple months, but it was my first rails app
[15:03:05] matthewd: sharkman: You might want to look at, e.g., Jekyll
[15:04:18] Lytol: has joined #RubyOnRails
[15:05:49] capin: so if I have an API written in rails, and want to manage the files / attachments via a web browser do i need to create a separate controller and view template for a "web interface"? or am I totally looking at this wrong way?
[15:06:19] P0w3r3d: has joined #RubyOnRails
[15:06:57] corioliss: has joined #RubyOnRails
[15:07:04] baweaver: has joined #RubyOnRails
[15:07:22] MartinElvar: has joined #RubyOnRails
[15:07:54] Rinzlit1: has joined #RubyOnRails
[15:08:04] MartinElvar: has joined #RubyOnRails
[15:08:49] tubbo: sharkman: makes sense. you ever hear of jekyll?
[15:08:54] tubbo: oh sorry :D
[15:08:57] tubbo: matthewd beat me to the punch
[15:09:22] sharkman: ill check that out now i guess. i havent heard of it
[15:09:30] juhoh: has joined #RubyOnRails
[15:10:34] Cervajz: has joined #RubyOnRails
[15:10:35] tubbo: sharkman: it's pretty simple...just a way to compile markdown/"yaml front matter" templates into static HTML. github pages uses it.
[15:10:52] s2013: has joined #RubyOnRails
[15:11:00] EminenceHC: has joined #RubyOnRails
[15:11:12] chouhoulis: has joined #RubyOnRails
[15:11:28] mary5030: has joined #RubyOnRails
[15:11:36] s2013: How do i turn this into haml? <div id="code_field" data-code-present=<%= session[:code].present? %>></div>
[15:12:23] s2013: nevermind
[15:13:13] mary5030: has joined #RubyOnRails
[15:13:59] mary5030: has joined #RubyOnRails
[15:14:47] tubbo: s2013: echo '<div id="code_field" data-code-present=<%= session[:code].present? %>></div>' > file.html; bundle exec html2haml file.html > file.haml
[15:14:52] tubbo: s2013: for future reference
[15:15:32] goldbug: Hey folks, I've located where this 'Stack level too deep' issue is being triggered from. It seems to be something to do with this validation in the model: https://gist.github.com/anonymous/eb66e16314194c2576aa#file-person-rb-L25
[15:16:17] goldbug: Anyone got any idea what might be wrong?
[15:16:43] tubbo: goldbug: not until we know where `globalize_attribute_names` is being defined
[15:16:47] tubbo: where/how*
[15:17:17] matthewd: goldbug: "something to do with" is potentially a little vague
[15:17:55] tubbo: oh that's from globalize n/m :D
[15:17:56] goldbug: It comes from globalize-accessors, tubbo: https://github.com/globalize/globalize-accessors
[15:17:58] jahbrewski: has joined #RubyOnRails
[15:18:09] goldbug: matthewd: A little vague is all I've got (;
[15:18:35] s2013: tubbo the issue was the "" actually
[15:18:39] tubbo: goldbug: a 'stack level too deep' error is (a lot of the time) caused by some kind of infinite loop
[15:18:43] s2013: cause i was getting an output of <haml loud or something
[15:18:46] tubbo: s2013: haha yeah
[15:18:56] tubbo: s2013: html-tidy ftw
[15:19:03] s2013: so thats why i was confusd then i noticed i was missing the ""
[15:19:13] arup_r: has joined #RubyOnRails
[15:19:15] tubbo: you lint your ruby, you lint your JS, you lint your CSS. why not lint your HTML?
[15:19:37] goldbug: Perhaps another approach is just to replace that validation with something that will do the same job? Essentially I want to ensure that validations are performed on each of the translated attributes if there is indeed a translation (provided by Globalize).
[15:20:17] goldbug: globalize-accessors is meant to make any potential attribute available with a locale tag at the end (e.g. surname would have surname_en or surname_fr).
[15:20:18] MartinEl_: has joined #RubyOnRails
[15:20:42] matthewd: goldbug: Well, you pointed to the .each, not the actual validation. Is that true?
[15:20:58] workmad3: has joined #RubyOnRails
[15:21:10] tubbo: goldbug: so the issue here is that `globalize_accessors` is defined to actually *create* that globalize_attribute_names class attribute.. https://github.com/globalize/globalize-accessors/blob/a2f0c64e2ebed980cce4d2b34a3a3e27b009d083/lib/globalize-accessors.rb#L4-L16
[15:21:13] matthewd: (also, please assume I know/recall no context from more than 15 minutes ago)
[15:22:20] tubbo: goldbug: rather than iterating over that whole loop, could you potentially turn that whole thing into a custom validation method?
[15:22:23] gabeodess: has joined #RubyOnRails
[15:22:24] ruurd: has joined #RubyOnRails
[15:22:37] goldbug: tubbo: Ah, so if I test whether the globalized_attribute exists, the answer is always going to be yes?
[15:22:53] goldbug: tubbo: I'm sure I could if I knew what the hell I was doing q:
[15:22:54] siddart: has joined #RubyOnRails
[15:22:56] udiudi: has joined #RubyOnRails
[15:23:46] tubbo: goldbug: https://gist.github.com/tubbo/3286509f904701b8befe
[15:24:11] tubbo: goldbug: no, i think your issue is you're doing too much in the class scope
[15:25:24] goldbug: tubbo: I can buy that, even if I'm not 100% sure what it means.
[15:25:26] gabeodess: Hey all. I am trying to use singlton definitions to help stub out certain methods in my tests. In the past I???ve been able to stub a class method like this `def MyClass.find(id); ???; end` But now I???m trying to do the same thing for a nested class `def Cropster::Lot.find(id)` and I am getting a syntax error. What am I missing here?
[15:26:06] nettoweb: has joined #RubyOnRails
[15:28:18] TPBallbag: has joined #RubyOnRails
[15:28:36] roxtrongo: has joined #RubyOnRails
[15:29:55] goldbug: tubbo: What is send doing in your solution?
[15:29:57] tubbo: gabeodess: that's now how you "stub out" a class method.
[15:29:58] arup_r: gabeodess: Gist please
[15:30:29] towski_: has joined #RubyOnRails
[15:30:41] tubbo: gabeodess: your methods should always be defined `def whatever`. not `def TheClass.whatever`. not `def Whatever::TheClass.whatever`. all that does is make your code unintelligible. and unintelligible code is written by unintelligent people.
[15:31:04] kitsuneyo: has joined #RubyOnRails
[15:31:04] bronson: has joined #RubyOnRails
[15:31:08] tubbo: gabeodess: rspec-mocks and mocha are two great choices for stubbing out methods on both the class and instance leve.
[15:31:29] disgrntld: has joined #RubyOnRails
[15:31:51] dionysus69: has joined #RubyOnRails
[15:32:10] gabeodess: tubbo: yeah, I usually use mocha, but I haven???t found a solution with mocha that allows me to stub my methods and respond conditionally based on the input arguments.
[15:32:18] gabeodess: tubbo: is that something that mocha supports?
[15:32:56] bobbobbins: has joined #RubyOnRails
[15:33:00] sharkman: in an erb, how come this doesnt make an html link, instead it shows the link as text, <%= "#{article.headline} <a href='af'>k</a>" %>
[15:33:40] gabeodess: tubbo, arup_r : here is what I???m trying to do: https://gist.github.com/gabeodess/0d1c3d14e7a9c160489d
[15:34:49] goldbug: tubbo: Nearly there, but your code throws an "undefined method `length' for nil:NilClass" error at the line "errors.add globalize_attribute, 'is too long' unless send(globalize_attribute).length <= 45"
[15:34:50] tubbo: gabeodess: yeah definitely. you can stub out methods based on the arguments given to the method. in rspec-mocks, you do it like allow(my_object).to receive(:some_method).with(argument: 'value').and_return(result)
[15:35:29] tubbo: goldbug: i bet you can figure that one out. i mean, if the attribute is nil...do you want to know about it? if so, it should add an error. otherwise, just ignore it.
[15:35:35] gabeodess: okay, I???m using minitest, so I???m sure there is some equivalent. Thanks for the tip, I???ll readup more on that.
[15:35:52] tubbo: gabeodess: mocha is typically what people use to stub stuff in minitest, and it *definitely* works like that.
[15:36:07] gabeodess: tubbo: great, thanks
[15:36:33] goldbug: tubbo: Some sort of presence check then?
[15:37:03] tubbo: sharkman: all strings output in a rails view are automatically cleaned and escaped to help prevent against cross-site scripting attacks. http://yehudakatz.com/2010/02/01/safebuffers-and-rails-3-0/
[15:37:34] tubbo: sharkman: it's why i can't make a comment on your site that's just <script src="http://tubbo.com/steal-passwords-from-sharkman.js"> :)(
[15:37:47] sharkman: that would be a cool attack
[15:38:35] tubbo: it's also the reason why you're encouraged to use hash-based syntax in where(), and not raw SQL queries if you can help it. also you should *never* interpolate into a where()
[15:39:10] tubbo: WRONG: where("attr = #{params[:something]}"), RIGHT: where(attr: params[:something]), RIGHT: where('attr = ?', params[:something])
[15:39:22] tubbo: that last special syntax actually does allow you to safely interpolate params into the queyr
[15:39:53] adaedra: Never trust user input.
[15:40:59] woods: has joined #RubyOnRails
[15:41:44] jinish: has joined #RubyOnRails
[15:41:45] kitsuneyo: has joined #RubyOnRails
[15:41:45] PaulePanter: has joined #RubyOnRails
[15:42:18] PaulePanter: Hi. I want to create a setting in an initializer, which is nested one more level.
[15:42:38] PaulePanter: MyApp::Application.config.payment.account_id
[15:42:42] dici: has joined #RubyOnRails
[15:42:47] willardg: has joined #RubyOnRails
[15:42:57] PaulePanter: The ???namespace??? MyApp::Application.config.payment does not exist yet.
[15:43:19] PaulePanter: How can I do that in Rails 3.2?
[15:43:42] goldbug: tubbo: My extremely clever solution was to put in 'if globalize_attribute', but that seems not to work. Shouldn't that only process non-nil objects?
[15:43:56] tubbo: goldbug: define "that seems not to work"
[15:44:03] stannard: has joined #RubyOnRails
[15:44:09] goldbug: = Same error message.
[15:44:33] goldbug: i.e. undefined method `length' for nil:NilClass
[15:44:39] tubbo: PaulePanter: you have to define config.payment as ActiveSupport::OrderedOptions.new
[15:45:04] smathy: has joined #RubyOnRails
[15:45:11] tubbo: goldbug: you can try appending '.compact' before you do the '.each' and that should get rid of all nil values from the collection.
[15:45:15] n1ck7: has joined #RubyOnRails
[15:45:23] PaulePanter: tubbo: Thank you. I???ll try that.
[15:45:34] Linuus: has joined #RubyOnRails
[15:46:16] meoblast001: has joined #RubyOnRails
[15:47:18] goldbug: tubbo: Same error again /:
[15:47:20] i: has joined #RubyOnRails
[15:47:59] tubbo: goldbug: oh yeah, you see what i'm doing with send()? it's actually taking the name of your attribute and running that as a method against the instance of your model.
[15:48:05] PaulePanter: tubbo: You are my hero. It worked like a charm! Thanks.
[15:48:14] goldbug: And I'm noticing that it's trying to test first_name_prefix_ch_it (i.e. Svizzera italiana) which is *definitely* nil!
[15:48:35] tubbo: goldbug: so let's say your model has an attribute called :foo, but its value is nil. the collection you're iterating over [:foo] is checking whether :foo is nil, not send(:foo)
[15:48:46] smathy: has joined #RubyOnRails
[15:48:49] goldbug: tubbo: Ah, gotcha.
[15:48:55] tubbo: goldbug: so you need to actually be checking if send(attr) is nil before adding validations
[15:49:05] bricker: has joined #RubyOnRails
[15:49:06] northfurr: has joined #RubyOnRails
[15:50:21] DoubleMalt: has joined #RubyOnRails
[15:50:43] goldbug: tubbo: Awesome, that fixed it.
[15:51:32] goldbug: tubbo: Again, I've just put in a line that says 'if send(globalize_attribute)' (and an 'end'). Is that the Ruby-est way to do it?
[15:52:46] Motoservo: has joined #RubyOnRails
[15:52:59] goldbug: Also, seeing as I'm going to want to run this validation on globalized attributes in other models, is there a way to add this code at a higher level? I've no idea where or how.
[15:53:17] alotofnoodles: has joined #RubyOnRails
[15:54:03] udiudi: has left #RubyOnRails: ()
[15:54:42] sharkman: how do i make a URL with erb? i cant even find this
[15:55:44] tubbo: goldbug: i don't believe so.
[15:55:53] tubbo: goldbug: on the first question
[15:55:58] tubbo: the second question, i'm not sure what you're talking about
[15:56:50] quazimodo: has joined #RubyOnRails
[15:59:05] seank_: has joined #RubyOnRails
[15:59:19] goldbug: tubbo: On second question, as pretty much every text field in my database has a translation table attached, I'm going to be using that custom validation a lot. I think what I mean is: should I be writing an extension to ActiveModel::Validator?
[16:00:30] nya: has joined #RubyOnRails
[16:01:40] smathy: sharkman, usually using the route helpers, but occasionally with `url_for`
[16:01:46] TheNet: has joined #RubyOnRails
[16:02:05] [Butch]: has joined #RubyOnRails
[16:02:40] sharkman: this all seems complicated. i just want to link off my page somewhere else
[16:02:59] beauby: has joined #RubyOnRails
[16:03:06] smathy: sharkman, helping you is getting too complicated, I'm opting out too.
[16:04:15] goldbug: tubbo: At any rate, the immediate problem is fixed so thank you very much. Have been struggling for two afternoons and a morning with that one.
[16:04:17] atomical: has joined #RubyOnRails
[16:04:47] siddart: has joined #RubyOnRails
[16:05:19] weckl: has joined #RubyOnRails
[16:05:58] smathy: sharkman, sorry too, nothing wrong with that question - I'm bringing some other context into this.
[16:06:23] smathy: sharkman, you can't possibly not know how to make a link by this point though.
[16:06:59] smathy: sharkman, nor could you possibly not know how to look up the docs for something like this.
[16:07:21] sharkman: okay sorry ill look in docs more
[16:07:23] mrtomme: has joined #RubyOnRails
[16:08:57] voker57: has joined #RubyOnRails
[16:08:58] capin: sharkman: i suggest you find a sample rails rails app to reference, the proof is always in the pudding ;)
[16:09:28] weckl: has joined #RubyOnRails
[16:10:03] ror15: has joined #RubyOnRails
[16:10:46] sharkman: okay i got it, its just <%= link_to textToDescribeUrl, pathToUrl %>
[16:10:47] hephaestus_rg: has joined #RubyOnRails
[16:11:29] kitsuneyo: has joined #RubyOnRails
[16:11:42] lindii_: has joined #RubyOnRails
[16:11:54] smathy: sharkman, as capin says, or just use the rails scaffold generators and take a look at how Rails does these sorts of basic things.
[16:12:00] Maletor: has joined #RubyOnRails
[16:12:17] smathy: sharkman, or, as I suspect you've done, try searching the docs for likely method names like `link` ;)
[16:12:40] Maletor: has joined #RubyOnRails
[16:14:50] acti0nman: has joined #RubyOnRails
[16:21:03] smathy: has joined #RubyOnRails
[16:21:09] pawnbox: has joined #RubyOnRails
[16:23:12] Cervajz: has joined #RubyOnRails
[16:23:46] momomomomo: has joined #RubyOnRails
[16:23:47] Cervajz_: has joined #RubyOnRails
[16:24:20] s2013: sharkman <%= link_to "Blah", "http://blah.com" %>
[16:24:24] s2013: thats if you want to link externally
[16:24:33] s2013: for internal you need to look at rails routes
[16:24:40] blackmesa: has joined #RubyOnRails
[16:25:09] s2013: so there are routes helpers which will replace the second argument with the path to the page
[16:26:23] djbkd: has joined #RubyOnRails
[16:26:52] sharkman: thanks s2013, i got it working with the link_to
[16:28:21] towski_: has joined #RubyOnRails
[16:28:34] shine_irssi: has joined #RubyOnRails
[16:28:42] linocisco: has joined #RubyOnRails
[16:29:16] shinenelson: has joined #RubyOnRails
[16:32:11] TPBallbag: has joined #RubyOnRails
[16:32:46] alaing: has joined #RubyOnRails
[16:33:15] alaing: = f.collection_radio_buttons(:rating, Feedback::RATING.map {|k,v| [v,k]}, :to_s, :to_s) do |b|
[16:33:15] alaing: - b.label(class: 'block-label') { b.radio_button + b.value }
[16:33:18] alaing: Hi, how do i output the value part of my hash ?
[16:33:45] alaing: b.value is just outputing ["Good", 1]
[16:34:28] xtagon: has joined #RubyOnRails
[16:35:14] atomical: has joined #RubyOnRails
[16:35:22] smathy: alaing, that's just a two element array.
[16:36:10] alaing: Feedback::rating is a hash
[16:36:14] momomomomo: alaing: !ask
[16:36:14] helpa: alaing: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
[16:36:50] alaing: is the .map turning it into a 2 element array then?
[16:37:02] ldnunes_: has joined #RubyOnRails
[16:37:19] pawnbox_: has joined #RubyOnRails
[16:38:24] rshetty: has joined #RubyOnRails
[16:38:44] arup_r: can't we use Product.increment(:price, 2)..? Or what is the equivalent one ?
[16:38:47] kitsuneyo: has joined #RubyOnRails
[16:39:21] Macaveli: has joined #RubyOnRails
[16:39:22] smathy: alaing, look at the docs http://devdocs.io/rails/actionview/helpers/formbuilder#method-i-collection_radio_buttons - you're using collection_radio_buttons as if it was some other method.
[16:39:24] gabeodess: arup_r: Product.increment_counter
[16:39:51] arup_r: gabeodess: That is different thing
[16:39:53] smathy: arup_r, yes, you can use that.
[16:40:00] arup_r: it is used for counter_cache
[16:40:04] Macaveli: has joined #RubyOnRails
[16:40:10] alaing: ACTION runs off to read more into the docs
[16:40:29] ruurd: has joined #RubyOnRails
[16:40:44] arup_r: smathy: #increment don't run validation and callback
[16:40:59] arup_r: increment! does
[16:41:04] EminenceHC: has joined #RubyOnRails
[16:41:51] tubbo: alaing: yes
[16:44:26] konrath: has joined #RubyOnRails
[16:45:15] smathy: arup_r, the bang version still won't run validations.
[16:45:20] FooTek: has joined #RubyOnRails
[16:45:27] arup_r: The doc says it is
[16:45:35] arup_r: only don't run callbacks
[16:45:46] bricker: arup_r: you have that backwards
[16:46:15] arup_r: ahh. yes it is not. I read it backward
[16:46:18] tubbo: put the thing down flip it and reverse it
[16:46:37] arup_r: Well we don't have any then
[16:46:58] chills42_: has joined #RubyOnRails
[16:47:48] arup_r: What did it mean then by passing through setter or not. What benefits it brings into the table?
[16:48:01] voker57: has joined #RubyOnRails
[16:49:04] kitsuneyo: has joined #RubyOnRails
[16:49:54] tubbo: arup_r: not sure what you're talking about
[16:49:56] EminenceHC: has joined #RubyOnRails
[16:50:55] tubbo: i thought increment was an instance method though
[16:54:58] baweaver: has joined #RubyOnRails
[16:55:04] pawnbox: has joined #RubyOnRails
[16:55:16] cpruitt: has joined #RubyOnRails
[16:56:32] northfurr: has joined #RubyOnRails
[16:56:55] ruurd: has joined #RubyOnRails
[16:57:12] nickenchuggets__: has joined #RubyOnRails
[16:57:14] rakm: has joined #RubyOnRails
[16:57:25] workmad3_: has joined #RubyOnRails
[16:57:32] tercenya_: has joined #RubyOnRails
[16:58:04] momomomomo_: has joined #RubyOnRails
[16:58:16] crdpink2: has joined #RubyOnRails
[16:59:21] h7br1x: has joined #RubyOnRails
[17:00:15] LambdaSource: has joined #RubyOnRails
[17:00:54] brt: has joined #RubyOnRails
[17:02:04] jgt: has joined #RubyOnRails
[17:02:27] leehambley: has joined #RubyOnRails
[17:02:38] siddart: has joined #RubyOnRails
[17:04:20] dionysus69: has joined #RubyOnRails
[17:04:44] moty66: has joined #RubyOnRails
[17:06:21] lacuna: has joined #RubyOnRails
[17:07:31] ruurd: has joined #RubyOnRails
[17:08:00] lacuna: has joined #RubyOnRails
[17:09:24] rshetty: has joined #RubyOnRails
[17:09:44] jkamenik1: has joined #RubyOnRails
[17:11:55] lacuna: has joined #RubyOnRails
[17:11:55] lacuna: has joined #RubyOnRails
[17:13:33] User458764: has joined #RubyOnRails
[17:13:40] hahuang65: has joined #RubyOnRails
[17:15:13] RegulationD: has joined #RubyOnRails
[17:15:19] h7br1x: has joined #RubyOnRails
[17:15:37] ruurd: has joined #RubyOnRails
[17:15:37] moty66: I want to localize an array inside a model, what is the best way to do that? right now I am calling I18n.t for each item, is that correct?
[17:16:43] moty66: http://paste.debian.net/318197/
[17:17:01] AckZ: has joined #RubyOnRails
[17:17:27] hephaestus_rg: has joined #RubyOnRails
[17:18:18] snockerton: has joined #RubyOnRails
[17:18:58] RegulationD: has joined #RubyOnRails
[17:19:07] Fire-Dragon-DoL: has joined #RubyOnRails
[17:19:09] nemo_: has joined #RubyOnRails
[17:20:18] snockerton: has joined #RubyOnRails
[17:20:23] srinidhi: has joined #RubyOnRails
[17:20:34] tubbo: moty66: if you do I18n.t('resources.form.description').values i think you'd get the same result
[17:21:35] moty66: you mean PRODUCT_DESCRIPTIONS = I18n.t('resources.form.description').values
[17:22:29] moty66: you are right :)
[17:22:39] moty66: this can save me lot of time, thanks again
[17:23:35] n1ck7: has joined #RubyOnRails
[17:24:49] pawnbox_: has joined #RubyOnRails
[17:24:53] safety_cut: has joined #RubyOnRails
[17:25:11] sniperhaxor: has joined #RubyOnRails
[17:25:22] moty66: oops, I wrote too fast
[17:25:23] moty66: undefined method `values' for "translation missing: it.resources.form.description":String
[17:25:30] sniperhaxor: Hey, anyone here familiar with digital ocean?
[17:26:01] yogeshrt: has joined #RubyOnRails
[17:26:18] h7br1x: has joined #RubyOnRails
[17:26:33] ahegyi: has joined #RubyOnRails
[17:27:25] shock_one: has joined #RubyOnRails
[17:28:20] n00bDev: has joined #RubyOnRails
[17:29:01] TheNet: has joined #RubyOnRails
[17:29:29] northfurr: has joined #RubyOnRails
[17:29:36] jkamenik: has joined #RubyOnRails
[17:29:54] bonemind: has joined #RubyOnRails
[17:30:08] sharkman: sniperhaxor i used digital ocean before
[17:30:15] sharkman: not sure i can help you but ive paid them for services
[17:30:21] n00bDev: does anyone know how to configure devise_invitable views particularly when devise renders the error page showing which fields are missing data?
[17:31:19] sniperhaxor: nvm, i just went to their irc.
[17:31:23] tubbo: sniperhaxor: !used
[17:31:23] helpa: sniperhaxor: Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
[17:31:47] big|bad|wolf: has joined #RubyOnRails
[17:33:55] pwnd_nfsw: has joined #RubyOnRails
[17:34:00] snockerton: has left #RubyOnRails: ()
[17:34:09] lacuna: has joined #RubyOnRails
[17:34:29] smathy: has joined #RubyOnRails
[17:35:12] Lightsword: has joined #RubyOnRails
[17:36:27] ischwartz: has joined #RubyOnRails
[17:37:27] simi: has joined #RubyOnRails
[17:38:21] nemo__: has joined #RubyOnRails
[17:38:42] lacuna: has joined #RubyOnRails
[17:41:27] Or1on: has joined #RubyOnRails
[17:41:28] Or1on: has joined #RubyOnRails
[17:42:57] lacuna: has joined #RubyOnRails
[17:45:45] draken: Where do i edit the login page that devise creates? So i can add a username para
[17:46:28] lacuna: has joined #RubyOnRails
[17:46:28] lacuna: has joined #RubyOnRails
[17:48:04] pawnbox: has joined #RubyOnRails
[17:48:15] ruurd: has joined #RubyOnRails
[17:48:40] nemo_: has joined #RubyOnRails
[17:49:25] SteenJobs: has joined #RubyOnRails
[17:50:35] ruurd: has joined #RubyOnRails
[17:50:43] lacuna: has joined #RubyOnRails
[17:50:48] troyready: has joined #RubyOnRails
[17:51:56] judetucker: has joined #RubyOnRails
[17:52:52] jkamenik: has joined #RubyOnRails
[17:53:14] dionysus69: does anyone have logs of this channel for past 5-6 hours?
[17:53:31] dionysus69: can you gist it please ? :)
[17:53:49] smathy: dionysus69, look in the /TOPIC
[17:54:08] dionysus69: thanks, you have been continuously online or you have other ways of history recovery ?
[17:54:24] smathy: dionysus69, look in the /TOPIC
[17:54:34] dionysus69: smathy: oh haha thanks :D
[17:54:45] thither: Alright nevermind then
[17:55:02] dionysus69: yep never noticed that sorry :) first time I needed it
[17:55:45] thither: So for a repeated task (through cron-like behavior) I keep seeing the option of using rake tasks. Isn't rake like make - used for setup?
[17:56:04] nickenchuggets: has joined #RubyOnRails
[17:56:24] jgpawletko: has joined #RubyOnRails
[17:56:27] smathy: draken, you gotta read the README for gems, here's the section on customizing the views: https://github.com/plataformatec/devise#configuring-views
[17:56:36] thither: https://github.com/plashchynski/crono - Like in this Gem.
[17:57:11] gingray: has joined #RubyOnRails
[17:57:22] smathy: thither, kinda, but the key part of it that's appealing for use in this context is that it handles loading your Rails environment.
[17:57:38] smathy: thither, so you can write your script/recipe as if you're in a rails console
[17:57:44] thither: Okay. Would it be better to try to use an ActiveJob?
[17:57:56] thither: That's seems like it would be the "Rails way (tm)"
[17:58:38] kitsuneyo: smathy, i just used the logs to see your suggestion from my Q the other night about capitalizing the first letter of a string. i don't think titleize is what i want, as that would capitalise the first letter of every word i think
[17:59:04] IFrank00: has joined #RubyOnRails
[17:59:10] smathy: thither, depends, active job is more for running jobs asynchronously, not on a schedule.
[17:59:45] thither: string.lower.map{|c| c.upper if (some condition to tell if c is the first)} - kitsuneyo
[18:00:00] thither: smathy: Okay. Thanks for your help.
[18:00:14] thither: Actually can you map strings? :P
[18:00:23] lacuna: has joined #RubyOnRails
[18:00:54] kitsuneyo: thither, this works: string.slice(0,1).capitalize + string.slice(1..-1)
[18:01:25] kitsuneyo: i was thinking of defining this as a method in the string class for my app
[18:01:25] thither: Yeah. I was hoping to avoid concatonation
[18:01:38] Fire-Dragon-DoL: has joined #RubyOnRails
[18:01:51] kitsuneyo: i dunno what the danger of that would nbe
[18:02:05] matthewd: "Returns a copy of str with the first character converted to uppercase and the remainder to lowercase"
[18:02:53] kitsuneyo: well matthewd, i don't want to mess with the rest of the string
[18:03:06] ischwartz: Why can't you use the built in rails captialize method?
[18:03:48] kitsuneyo: ischwartz... yes
[18:03:52] rhizome: "fooBarBaz".capitalize => "Foobarbaz"
[18:04:23] kitsuneyo: oh wait, no
[18:04:35] kitsuneyo: yeah that messes with the rest of the string
[18:04:46] IFrank00: has joined #RubyOnRails
[18:05:04] alotofnoodles: has joined #RubyOnRails
[18:05:19] rhizome: "fooBarBaz".gsub(/^[a-z]/, &:upcase)
[18:06:04] kitsuneyo: that seems to work rhizome
[18:06:07] jxs_: has joined #RubyOnRails
[18:06:15] djbkd: has joined #RubyOnRails
[18:06:30] erichu: has joined #RubyOnRails
[18:06:36] kitsuneyo: so is there any danger in adding that as a method to String? or not?
[18:07:28] kitsuneyo: where would i even locate that code in my rails app??
[18:07:38] `based_pdev`: has joined #RubyOnRails
[18:07:44] cnk: has joined #RubyOnRails
[18:07:58] lacuna: has joined #RubyOnRails
[18:07:59] lacuna: has joined #RubyOnRails
[18:08:37] sharkman: is ths gonna have a route "add_article"? <%= form_for("add_article") do |f
[18:08:38] rhizome: depends on it's purpose
[18:08:54] tds5016: has joined #RubyOnRails
[18:09:09] kitsuneyo: i'm gonna call it on strings that belong to a few different models
[18:09:29] rhizome: for what purpose?
[18:09:30] hephaestus_rg: has joined #RubyOnRails
[18:09:33] pawnbox: has joined #RubyOnRails
[18:09:41] tds5016: hi all. I have what should be a simple question... if I use the connection_pool gem in ror; what is the best way to store the viable locally?
[18:09:52] mag42c: has joined #RubyOnRails
[18:10:00] kitsuneyo: i guess to show text the right way in views
[18:10:21] rhizome: kitsuneyo: use a helper
[18:10:24] kitsuneyo: so maybe it belongs in application helper
[18:10:32] bojanuana: has joined #RubyOnRails
[18:10:36] woods: has left #RubyOnRails: ("Leaving")
[18:10:44] moeabdol: has joined #RubyOnRails
[18:11:20] kitsuneyo: i prefer string.method to method(string)
[18:11:31] northfurr: has joined #RubyOnRails
[18:11:42] kitsuneyo: that's my only motivation for putting it in String
[18:11:51] bruno-: has joined #RubyOnRails
[18:12:41] roxtrongo: has joined #RubyOnRails
[18:13:07] smathy: tds5016, the variable referring to the connection pool itself? That's usually a global.
[18:13:13] manfrin: has joined #RubyOnRails
[18:13:26] willardg: has joined #RubyOnRails
[18:14:57] maxx88: has joined #RubyOnRails
[18:16:14] smathy: kitsuneyo, if you were adding it to String then simplest would be to do that in an initializer
[18:17:39] kitsuneyo: smathy, but i only want to call it on certain objects, i thought initializers run every time you make a new object of the class
[18:18:00] tds5016: smathy: how would I make a global for a rails application?
[18:18:11] smathy: kitsuneyo, config/initializers not whatever you're thinking of.
[18:19:28] kitsuneyo: does everything in those files get run automatically when i start rails server? so i could put a class.rb in that folder?
[18:19:41] kitsuneyo: i meant string.rb
[18:20:18] smathy: tds5016, set the pool up in an initializer assign to a global, that will then be give to each forked process or thread/fiber.
[18:20:37] tds5016: $my_variable?
[18:20:51] tds5016: or does rails have a special version of global I should be using?
[18:21:19] smathy: kitsuneyo, yes.
[18:21:38] kitsuneyo: awesome, i might just try it and see what happens, thanks smathy
[18:21:39] smathy: tds5016, no, just that, as it suggests in the README: https://github.com/mperham/connection_pool#usage
[18:22:03] smathy: kitsuneyo, I would still recommend using a decorator or helper or something, but if you're hell bent on adding to String then that's where to do it.
[18:22:45] razieliyo: has joined #RubyOnRails
[18:22:47] kitsuneyo: right now i have a helper smathy, i just wanna try this and see what happens, mainly curiousity
[18:23:09] tds5016: $memcached = ConnectionPool.new(size: 5, timeout: 5) { Dalli::Client.new }
[18:23:20] tds5016: so with that example it would be available to my controllers as $memcached?
[18:23:43] qejk: has joined #RubyOnRails
[18:24:03] jkamenik: has joined #RubyOnRails
[18:24:04] northfurr: has joined #RubyOnRails
[18:24:11] smathy: tds5016, yep, that's how global variables work :)
[18:24:25] smathy: tds5016, it's available to everything as $memcached
[18:24:30] tds5016: awesome. sorry for the dumb question :-)
[18:25:20] smathy: tds5016, it's ok, global variables aren't a terrible thing to not know about ;)
[18:26:12] tds5016: lol. yeah, I feel like it might not be a great idea but I think it's the right thing to do here.
[18:26:27] renews: has joined #RubyOnRails
[18:27:02] Sceko: has joined #RubyOnRails
[18:27:14] MartinElvar: has joined #RubyOnRails
[18:27:52] MartinElvar: has joined #RubyOnRails
[18:28:00] IFrank00: has joined #RubyOnRails
[18:28:12] brt: has joined #RubyOnRails
[18:28:29] nertzy: has joined #RubyOnRails
[18:28:34] ror15: Trying to allow an administrator to reorder a list of products on a display in admin/custom_starter/showProduct. No idea where to start and the docs are missing for this particular feature
[18:28:47] ror15: Using ActiveAdmin
[18:28:48] djbkd: has joined #RubyOnRails
[18:29:29] djbkd: has joined #RubyOnRails
[18:30:04] smathy: ror15, maybe try #activeadmin
[18:30:12] ror15: Trying to allow an administrator to reorder a list of products on a display in admin/custom_starter/showProduct. No idea where to start and the docs are missing for this particular feature
[18:30:13] ror15: Trying to allow an administrator to reorder a list of products on a display in admin/custom_starter/showProduct. No idea where to start and the docs are missing for this particular feature
[18:30:13] ror15: Trying to allow an administrator to reorder a list of products on a display in admin/custom_starter/showProduct. No idea where to start and the docs are missing for this particular feature
[18:30:13] ror15: Trying to allow an administrator to reorder a list of products on a display in admin/custom_starter/showProduct. No idea where to start and the docs are missing for this particular feature
[18:30:13] ror15: Just jumped on
[18:30:19] ror15: Ugh what... sorry
[18:30:25] mikecmpbll: has joined #RubyOnRails
[18:30:46] jgt: has joined #RubyOnRails
[18:32:08] sl33k: has joined #RubyOnRails
[18:32:32] danneu: has joined #RubyOnRails
[18:33:09] User458764: has joined #RubyOnRails
[18:33:40] joshkovach: has joined #RubyOnRails
[18:35:06] livando: has joined #RubyOnRails
[18:35:13] big|bad|wolf: has joined #RubyOnRails
[18:36:01] Coldblackice: has joined #RubyOnRails
[18:36:28] linocisco: has joined #RubyOnRails
[18:36:33] northfurr: has joined #RubyOnRails
[18:36:59] linocisco: I love all users from this channel. It is supportive
[18:37:42] arup_r: Is it really not good to use HTML data_* attributes to store data which can be used by JS later? Like this I suggested: http://stackoverflow.com/a/33350399/2767755 . I am asking because other answer went complete against with mine. The other answer some good points though. I want know because if data-* is really bad choice, I might start coding different way
[18:37:44] smathy: Except tubbo, he's a jerk.
[18:37:51] momomomomo: has joined #RubyOnRails
[18:38:06] Lytol: has joined #RubyOnRails
[18:38:16] craysiii: has joined #RubyOnRails
[18:38:29] sl33k: has joined #RubyOnRails
[18:38:33] Aherin: has joined #RubyOnRails
[18:38:43] linocisco: hi all, what is the best forum where there are many active users/helpful response?
[18:38:56] centrx: For what?
[18:38:58] arup_r: The Gem he suggested looks like to address the issue he keep repeating over there
[18:38:59] smathy: arup_r, you worry too much.
[18:39:08] linocisco: centrx, ruby on rails/ruby and rails
[18:39:13] linocisco: centrx, ruby on rails
[18:39:19] netzfisch: has joined #RubyOnRails
[18:39:27] centrx: linocisco, Here and StackOverflow
[18:39:29] arup_r: smathy: data-* approach is acceptable right?
[18:39:32] centrx: linocisco, Also #ruby
[18:39:39] arup_r: Because I use it here and there if I needed.
[18:39:42] smathy: arup_r, you're still worrying too much.
[18:39:46] northfurr: has joined #RubyOnRails
[18:39:52] smathy: arup_r, when you're 10 apps in, make up your own mind.
[18:39:56] dionysus69: has joined #RubyOnRails
[18:40:16] arup_r: thanks smathy
[18:40:40] linocisco: centrx, ok. thanks.. can we develop rails apps using without basic ruby knowledge?
[18:40:49] sl33k: has joined #RubyOnRails
[18:40:51] arup_r: linocisco: NO
[18:40:57] linocisco: centrx, ok. thanks.. can we develop rails apps without having basic ruby knowledge?
[18:41:07] arup_r: linocisco: NO. NEVER
[18:41:16] linocisco: arup_r, to what level, should we learn ruby for rails?
[18:41:22] centrx: linocisco, You'll need to at least pick up some ruby along the way
[18:41:27] lacuna: has joined #RubyOnRails
[18:41:31] arup_r: Ruby is all over the places in Rails
[18:41:46] linocisco: arup_r, so learn ruby first?
[18:42:06] linocisco: arup_r, it might be a long journey
[18:42:22] linocisco: arup_r, like journey to the West
[18:42:24] arup_r: Otherwise you will go crazy when you see like ->() { #shit }
[18:42:48] arup_r: when you will see like find_by_name_and_email
[18:42:56] arup_r: You will go again crazy
[18:43:06] arup_r: so learn Ruby to save your time
[18:43:32] linocisco: arup_r, I have no constant internet. what ruby book is enough for learning rails?
[18:43:50] dionysus69: has joined #RubyOnRails
[18:43:55] arup_r: Daviad A Black well grounded Rubyist
[18:44:02] arup_r: enough you to get start
[18:44:29] livando: has left #RubyOnRails: ()
[18:44:31] podman: has joined #RubyOnRails
[18:44:48] arup_r: You need to read the book thoroughly ..
[18:44:57] livando: has joined #RubyOnRails
[18:45:05] K3VA: has joined #RubyOnRails
[18:45:39] linocisco: arup_r, thanks
[18:45:44] arup_r: linocisco: Learn from the book and ask from #ruby .. they are awesome.
[18:45:45] K3VA: Anyone know of an open source Rails price comparison engine app?
[18:46:30] linocisco: arup_r, thanks indeed for kind suggestion. japanese language is first to learn
[18:47:03] dionysus69: has joined #RubyOnRails
[18:47:39] smathy: I hope you're not learning Japanese to understand ruby better.
[18:48:51] tubbo: smathy: i'm learning japanese so i can troll the core team better
[18:48:59] snurfery: has joined #RubyOnRails
[18:49:20] atomical: has joined #RubyOnRails
[18:49:39] manfrin_: has joined #RubyOnRails
[18:50:28] hansss: has joined #RubyOnRails
[18:51:38] dionysus69: has joined #RubyOnRails
[18:52:52] srinidhi: has joined #RubyOnRails
[18:53:13] ischwartz: would anybody be willing to look at my code and just give me some feedback? I'm pretty new to all this stuff and I do all my coding in a vacuum
[18:53:55] ischwartz: code: https://github.com/ianschwartz/inspire
[18:54:00] ischwartz: app: inspira.herokuapp.com
[18:54:13] User458764: has joined #RubyOnRails
[18:54:25] momomomomo: ischwartz: !ask
[18:54:25] helpa: ischwartz: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
[18:54:36] momomomomo: ischwartz: feedback on which specific parts?
[18:54:56] ruurd: has joined #RubyOnRails
[18:54:57] cnk: linocisco: The Well-Grounded Rubyist is good but I also really liked Russ Olsen's Eloquent Ruby.
[18:55:00] thither: Is it possible to do Model.where(property: [option1, option2, option3])? Where there must exist an option such that that model's property is the same as the option
[18:55:31] thither: I know about where("foo = ? OR foo = ?", blah, blah)
[18:55:44] thither: But I want to account for n options, not 2
[18:55:50] dionysus69: has joined #RubyOnRails
[18:55:51] aarkerio: has joined #RubyOnRails
[18:56:02] momomomomo: thither: http://www.postgresqltutorial.com/postgresql-in/
[18:56:06] ischwartz: momomomo: I'm not even sure what to ask. I've been self-teaching for months
[18:56:39] momomomomo: ischwartz: typically people here will help specific questions or areas to code review - you might get lucky and find someone who will look over your entire codebase, though
[18:56:44] tubbo: ischwartz: haha is this a fake inspirational poster maker?
[18:56:45] linocisco: cnk, as long as it is explained using Linux and no need for live internet connection, I would appreciate any good ruby book
[18:56:46] thither: momomomomo: can it be done without writing a stored procedure though?
[18:57:09] ischwartz: momomo, well I guess the bulk of the active code is in app/models/scrape.rb
[18:57:09] momomomomo: thither: did you read the article? It's just an operator
[18:57:12] tubbo: nice that you're teaching yourself ischwartz
[18:57:40] cnk: linocisco: It
[18:57:43] tubbo: ischwartz: i have a functional bit of feedback for you...how would i share this poster with my friends?
[18:57:53] cnk: s a paper book so no internet required
[18:57:58] thither: monoprotic: but I'd be writing something like where("property IN (?,?,?,?)", a, b, c, d) right?
[18:58:03] thither: That's got the same problem
[18:58:03] tubbo: oh wait never mind it's just a reddit reader, i thought it actually generated the posters
[18:58:05] tubbo: still nice
[18:58:14] based_pdev_: has joined #RubyOnRails
[18:58:41] tubbo: thither: you can also do where(property: [a,b,c,d])
[18:58:51] safety_cut: has joined #RubyOnRails
[18:58:53] ischwartz: tubbo: eventually I'll use html2canvas to create a sharable image, but my javascript is still pretty rough
[18:58:53] tubbo: sorry didn't see your question :D the answer is "yes".
[18:58:54] pixelhandler: has joined #RubyOnRails
[18:58:57] danneu: http://guides.rubyonrails.org/active_record_querying.html#subset-conditions
[18:59:03] marahin: has joined #RubyOnRails
[18:59:04] danneu: it's in the examples
[18:59:15] tubbo: ischwartz: you might not need to do that. ever hear of imagemagick? http://www.imagemagick.org/script/index.php
[18:59:24] zpe: has joined #RubyOnRails
[18:59:40] dionysus69: has joined #RubyOnRails
[18:59:51] marahin: Hello. Trying to open(url).read() returns HTTP Error 400, however I can clearly open the link in the browser. The url is http://steamcommunity.com/market/pricehistory/?country=US&currency=3&appid=730&market_hash_name=Shadow%20Case
[18:59:52] yfeldblum: has joined #RubyOnRails
[19:00:02] ischwartz: tubbo: i have, but i didn't know it could do that.
[19:00:16] pwnd_nfsw: has joined #RubyOnRails
[19:00:56] djbkd: has joined #RubyOnRails
[19:00:59] danneu: marahin: make the request look like it's coming from a browser
[19:01:35] marahin: danneu: I see. Can you point me anything that would help to solve it?
[19:02:06] marahin: (also another Steam API link works just fine eh :'()
[19:02:44] TheNet: has joined #RubyOnRails
[19:02:59] danneu: marahin: open up the page in Chrome, open up the devtool's network tab, right click the request and "Copy as curl command". it'll show you the headers your browser sent. you can see which ones the steam website wants
[19:03:01] Jasaka: has joined #RubyOnRails
[19:04:55] diegorv: has joined #RubyOnRails
[19:05:13] IFrank00: has joined #RubyOnRails
[19:05:22] danneu: actually, i'm getting a 400 Bad Request in the browser too. it just has a body `[]`
[19:05:45] marahin: danneu: i just noticed that... :P
[19:05:50] moeabdol: does anyone here uses SweetAlert to show flash messages in Rails?
[19:06:06] danneu: marahin: been a while since i've used Ruby, but you may want to use an actual Ruby http client instead of `open()` so that you have more control
[19:06:11] moeabdol: I can't seem to disable the default ok button shown in the alerts
[19:06:14] arthurix: has joined #RubyOnRails
[19:06:25] moeabdol: when I showConfirmButton: false
[19:06:25] marahin: danneu: I see. Thank you very much for your answers!
[19:06:25] jwaldrip: has joined #RubyOnRails
[19:06:33] moeabdol: and showCancelButton: false
[19:06:42] moeabdol: it still shows the confirm button
[19:07:21] arthurix_: has joined #RubyOnRails
[19:07:29] danneu: marahin: often `open()` style stuff in languages is for super trivial things and you'll outgrow it (need to upgrade to an actual http client) once you need things like error handling, custom headers, etc. https://www.ruby-toolbox.com/categories/http_clients
[19:08:04] marahin: Well my problem doesn't seem any difficult, it's just that I'm working on not-really-stable API servers
[19:08:12] marahin: but I'll look into it. Thanks :)
[19:09:16] nettoweb: has joined #RubyOnRails
[19:09:17] tubbo: ischwartz: yeah it can add text to images and do some editing...so you could theoretically make a big image that's black, then superimpose your custom image in the center, then superimpose the custom text below. after all, that's how meme generators are made.
[19:09:27] Derasi: has left #RubyOnRails: ()
[19:10:15] willardg: has joined #RubyOnRails
[19:10:29] tubbo: marahin: could be a million things that cause your issue, but here's an explanation of HTTP 400 errors: http://www.checkupdown.com/status/E400.html
[19:10:30] momomomomo: has joined #RubyOnRails
[19:10:41] tubbo: marahin: so you probably aren't sending the correct headers like Accept, Content-Type, etc.
[19:12:16] sharkman: where should images be stored for a rails project? in the views folder? in public?
[19:12:25] n008f4g_: has joined #RubyOnRails
[19:12:32] baweaver: has joined #RubyOnRails
[19:13:04] tubbo: sharkman: app/assets/images/ if you need them for your app or for some other reason they need to be in the asset pipeline. most uploader gems have a convention for storing stuff in public/
[19:14:20] sharkman: okay thanks
[19:17:00] based_pdev: has joined #RubyOnRails
[19:17:58] kadoppe: has joined #RubyOnRails
[19:18:06] arthurix: has joined #RubyOnRails
[19:18:54] nertzy: has joined #RubyOnRails
[19:20:36] netzfisch: has joined #RubyOnRails
[19:20:37] lacuna: has joined #RubyOnRails
[19:21:11] nogic: has joined #RubyOnRails
[19:22:54] Linuus: has joined #RubyOnRails
[19:25:14] ritic: has joined #RubyOnRails
[19:25:55] baweaver: has joined #RubyOnRails
[19:26:40] losvedir: has joined #RubyOnRails
[19:27:30] barttenbrinke: What is easiest way to do Ajax filling of a collection select field?
[19:28:18] atomical: has joined #RubyOnRails
[19:28:32] EminenceHC: has joined #RubyOnRails
[19:28:47] losvedir: has anyone tried or thought about gradually transitioning to a new secret_key_base?
[19:29:44] losvedir: where you, e.g., try decrypting the cookie with the new secret_key_base, and if that fails, try with the old, but then you encrypt with the new
[19:30:08] losvedir: let it run for a month or so, and you'll transition most of your users to the new secret_key_base, and then you can remove the old one
[19:30:30] ruurd: has joined #RubyOnRails
[19:31:07] crankharder: does anyone know where paperclip defines what the "#," "!", ">" etc.. are in the default post processor? I know they come from imagemagick, but it's a bit hard to track down exactly what's available
[19:31:28] arthurix_: has joined #RubyOnRails
[19:31:38] momomomomo_: has joined #RubyOnRails
[19:33:11] matthewd: losvedir: Maybe relevant: https://github.com/rails/rails/pull/18772
[19:33:42] ritic: has joined #RubyOnRails
[19:34:10] losvedir: matthewd: whoooooaaa, that looks highly relevant. thanks!
[19:34:47] lxsameer: has joined #RubyOnRails
[19:34:51] jwaldrip: has joined #RubyOnRails
[19:35:25] northfurr: has joined #RubyOnRails
[19:35:43] matthewd: losvedir: A student started on it at OpenAcademy, but I think it stalled... if you want to pick it up & turn it into something mergable, go for it :)
[19:36:35] losvedir: matthewd: thanks, it does look like a good start!
[19:38:30] VeryBewitching: has joined #RubyOnRails
[19:39:12] willardg: has joined #RubyOnRails
[19:39:28] gabeodess: has joined #RubyOnRails
[19:39:32] willardg: has joined #RubyOnRails
[19:44:15] JohnHirbour: has joined #RubyOnRails
[19:44:22] arup_r: barttenbrinke: Can you elaborate more ?
[19:45:05] JohnHirbour: does anyone know to test that a model publishes an event to ActiveSupport::Notifications ?
[19:45:17] barttenbrinke: arup_r: I have a form with a two selectboxes. The first one province, the second one city. I want to fill the cities when somebody selects a provence
[19:46:09] arup_r: barttenbrinke: Ok, you can handle it using JS
[19:46:19] nettoweb: has joined #RubyOnRails
[19:46:20] smathy: crankharder, you say you know they come from imagemagick and then ask where paperclip defines them :) Paperclip doesn't define them, they come from imagemagick, ie. it's a geometry string passed to IM: http://www.imagemagick.org/script/command-line-processing.php#geometry
[19:47:06] arup_r: barttenbrinke: You want to know how? Ping me back again :D
[19:47:19] barttenbrinke: arup_r: Following http://tigefa4u.bitbucket.org/articles/cascading-selects-with-ajax-in-rails.html atm
[19:47:37] smathy: JohnHirbour, people generally mock out the method on AS:Notifications and test that it was called.
[19:47:55] aarkerio: barttenbrinke, you would need capybara to do that
[19:48:13] lacuna: has joined #RubyOnRails
[19:48:19] barttenbrinke: aarkerio: Eeh, no :)
[19:48:37] JohnHirbour: smathy: ah ok cool that's what I was finding on google. wasn't sure if it was best practice.
[19:48:44] arup_r: aarkerio: barttenbrinke not asking for any test help AFAIK
[19:49:05] arup_r: he wants to have dependent select list
[19:49:06] aarkerio: oh! sorry, I read "to test" somehow
[19:49:08] smathy: JohnHirbour, it's a decent test.
[19:49:26] bricker: has joined #RubyOnRails
[19:49:53] arup_r: barttenbrinke: I don't need any gems to do that really, but it is me. You can use jquery-ujs or without ajax
[19:52:36] aarkerio: barttenbrinke, I think you need a jQuery ajax call, but at that tutorial, they are using coffescript code, you just need a vanilla ajax call
[19:56:02] SteenJobs: has joined #RubyOnRails
[19:56:08] beauby: has joined #RubyOnRails
[19:56:17] barttenbrinke: arup_r: I like the unobtrusive approach of that one, so I guess I'll build my own based on that one
[19:56:43] arup_r: barttenbrinke: that is a good idea indeed
[19:56:52] ritic: got a question for you
[19:58:10] ritic: i'm using webmock in my app for tests, but when i try to access a particular page outside of tests (i.e. browser), i'm getting the following error: WebMock::NetConnectNotAllowedError
[19:58:25] youngbaks: has joined #RubyOnRails
[19:58:34] ritic: at first, i thought perhaps spring was messing with me, but i've since killed it
[19:58:40] ritic: any ideas?
[19:59:21] ritic: nevermind
[19:59:21] momomomomo: has joined #RubyOnRails
[19:59:48] cnk: has joined #RubyOnRails
[20:00:00] ritic: apparently in your gemfile if you have webmock in the :development, :test group, it hijacks ALL dev traffic as well
[20:00:55] blackmesa: has joined #RubyOnRails
[20:01:10] safety_cut: has joined #RubyOnRails
[20:01:50] mag42c: has joined #RubyOnRails
[20:02:20] EminenceHC: has joined #RubyOnRails
[20:02:56] Synthead: Using Sidekiq, if I run a rails console, require 'sidekiq/api', and run Sidekiq::Queue.new.size, I always get 0. This is supposed to show how many jobs are running (https://github.com/mperham/sidekiq/wiki/API), and I'm sure that more than 0 jobs are running as Sidekiq's console output show otherwise. Am I doing something wrong?
[20:03:34] tbuehlmann: Synthead, you might want to get the right queue, as in Sidekiq::Queue.all.first or something
[20:04:01] sniperhaxor: Hey guys, I want to remake my wordpress blog in rails since I figured my blog can use an update and this would help me understand rails more. I'm afraid remaking a blog in rails will take a while since I can't seem to find a straight forward guide online with rails 4. Does anyone know of a step by step guide that can get me setup with the fundamentals of a blog?
[20:04:46] bricker: sniperhaxor: http://guides.rubyonrails.org/getting_started.html explains how to make a simple blog application
[20:05:21] jwaldrip: has joined #RubyOnRails
[20:05:22] sniperhaxor: bricker: Hey briker, I've actually done that guide already
[20:05:24] smathy: Synthead, are you sure there aren't zero jobs currently running?
[20:05:27] jkamenik: has joined #RubyOnRails
[20:05:29] smathy: Jobs are usually pretty quick.
[20:05:33] sniperhaxor: I should really get back into the rails guides though they are rather straight forward
[20:05:44] annlewis: has joined #RubyOnRails
[20:05:46] Synthead: tbuehlmann: this still returns 0. I think .new without any arguments is synonymous to .new("default"), which should be able to communicate with the default queue
[20:06:01] lacuna: has joined #RubyOnRails
[20:06:08] sniperhaxor: but to my knowledge that is a blog app that does not have a user login, so any random people who access my site will be able to CRUD any of my posts
[20:06:15] Synthead: smathy: yes, absolutely. I see "start" and "done" messages in sidekiq's console and I see CPU time being used as well
[20:06:28] smathy: Synthead, I mean at the time you're making the query.
[20:07:03] smathy: Synthead, sidekiq is blindingly fast, you wouldn't be the first person surprised by how quickly a queue was emptied.
[20:07:18] Synthead: smathy: the job takes about 8 seconds to run
[20:07:30] smathy: Synthead, ok, not relevant at all to the queue.
[20:07:44] smathy: Synthead, a job is not in the queue WHILE it's running.
[20:07:57] Synthead: smathy: oooh, I see. ok :)
[20:08:00] ecmacoder: has joined #RubyOnRails
[20:08:12] cnk: sniperhaxor: Look at the example apps at http://railsapps.github.io/ for how to add authentication and roles to your app
[20:08:18] Synthead: smathy: is there any way I can cancel a running job?
[20:09:26] bricker: sniperhaxor: you can start with this: http://guides.rubyonrails.org/action_controller_overview.html#http-authentications
[20:09:26] smathy: Synthead, scroll down that page to Processes.
[20:11:29] ewilliam: hi, how do you strong params permit nested attributes for a form object? this is my code, with screenshot https://gist.github.com/ewilliam/105debb228c2834d4610
[20:12:00] ewilliam: ive tried :dob, :dob_attrs => [], etc, no go
[20:12:05] Synthead: smathy: ahh, right! thanks!
[20:14:05] Motoservo: has joined #RubyOnRails
[20:15:48] spellbook_: has joined #RubyOnRails
[20:15:49] smathy: Synthead, you're welcome.
[20:16:49] alotofnoodles: has joined #RubyOnRails
[20:17:30] smathy: ewilliam, add the log output to your gist, the one showing the Parameters: line.
[20:17:38] ritic: has joined #RubyOnRails
[20:17:52] northfurr: has joined #RubyOnRails
[20:18:56] poikon: has joined #RubyOnRails
[20:19:53] kitsuneyo: has joined #RubyOnRails
[20:19:54] jgpawletko: has joined #RubyOnRails
[20:20:21] Aherin_: has joined #RubyOnRails
[20:20:47] baweaver: has joined #RubyOnRails
[20:21:31] crdpink: has joined #RubyOnRails
[20:21:50] spellbook_: hi. i have a question and i'm not sure if this is the right place to ask it. i am writing an app in rails with react on the front end. i want to use a javascript library (highcharts) to help me make graphs. i have confusion about how to go about doing this. there is a gem for this library (highcharts-rails), an npm? (react-highcharts), and straight source-code for highcharts (packaged as one .js file i could put in rails as
[20:22:50] moei: has joined #RubyOnRails
[20:23:18] safety_cut: has joined #RubyOnRails
[20:23:46] momomomomo: spellbook_: It just depends on how you want to integrate it. I've typically just used javascript for highcharts, and not used a gem for that
[20:24:59] ibouvousaime: has joined #RubyOnRails
[20:24:59] crankharder: ditto that ^. download highcharts, extact and copy the releavant js and css files to vendor/assets/[javascripts|stylesheets] - then just load them up in your application.[js|css] files
[20:25:22] Limix: has joined #RubyOnRails
[20:25:43] ror15: has joined #RubyOnRails
[20:26:12] rhizome: which is probably what happens when you use highcharts-rails
[20:26:25] northfurr: has joined #RubyOnRails
[20:27:03] yashinbasement: has joined #RubyOnRails
[20:29:49] NBarnes: has joined #RubyOnRails
[20:30:46] NBarnes: I'm having trouble running 'brew install gcc46' so that I can then install Ruby 1.9.3 via rvm. Whe I try to brew install gcc46 I get a 500 error trying to download https://trac.macports.org/export/126996/trunk/dports/lang/gcc48/files/patch-10.10.diff
[20:31:24] NBarnes: There doesn't appear to be anything at that URL, but is that because macports is having some sort of trouble?
[20:31:29] NBarnes: (which seems weird)
[20:31:36] NBarnes: Or is there something I'm missiing?
[20:31:54] axl_: has joined #RubyOnRails
[20:32:17] avash: has joined #RubyOnRails
[20:33:48] JohnHirbour: has left #RubyOnRails: ()
[20:34:43] stamina: has joined #RubyOnRails
[20:35:28] tubbo: nbarnes: what version of OS X are you running?
[20:35:46] Radar: GOOD MORNING
[20:35:46] Synthead: Is there a good way to communicate to async jobs (scheduled via sidekiq)? Something like Python's Threading.Event() would be ideal
[20:35:49] ivanskie: has joined #RubyOnRails
[20:35:52] tubbo: i'm pretty sure ruby-1.9.3 works with llvm too
[20:36:05] tubbo: Synthead: what do you mean, like a job already running?
[20:36:11] arthurix: has joined #RubyOnRails
[20:37:34] n1ck7: has joined #RubyOnRails
[20:37:39] Synthead: tubbo: yeah. In Python, as an example, if I fire off a job with an "accessor" to a Threading.Event() object, I can safely write to that object and have the job safely read from it
[20:38:11] Synthead: tubbo: a use case could be to tell the job to terminate itself
[20:38:18] rhizome: or workflow status
[20:38:46] tubbo: Synthead: with sidekiq there seems to be a way to get this done with middleware: https://github.com/utgarda/sidekiq-status
[20:39:37] livando: has joined #RubyOnRails
[20:39:38] willardg: has joined #RubyOnRails
[20:39:46] baweaver: has joined #RubyOnRails
[20:40:32] siddart: has joined #RubyOnRails
[20:41:01] mag42c: has joined #RubyOnRails
[20:41:10] lacuna: has joined #RubyOnRails
[20:41:10] lacuna: has joined #RubyOnRails
[20:41:53] Synthead: tubbo: here's what I'm thinking: store a latest "valid" job ID somewhere, possibly in redis (or maybe a sidekiq or rails way I'm unaware of). The job does about 20,000 loops, and takes about 8 seconds. After every 200 loops or so, it'd check if its job ID is still "valid." If it isn't, break the loop and end gracefully. If it is, complete normally (including writing to cache, which is what it'll eventually be doing).
[20:42:27] Synthead: tubbo: would I need to use SidekiqStatus for something like this (that you know of)?
[20:42:38] tubbo: Synthead: why not use two jobs?
[20:43:13] Synthead: tubbo: they are CPU and database intensive. Without invalidating jobs, I could DoS my own app :p
[20:43:17] tubbo: the initial job would basically enqueue the other job 20,000 times in groups of 200, and before enqueuing the other job(s) it would test validity
[20:43:38] tubbo: Synthead: only if you have 20,000 workers, which you don't :P
[20:43:38] Synthead: tubbo: oh interesting!
[20:43:42] tubbo: you have like 1 or 2 probably
[20:43:52] tubbo: Synthead: cancelling jobs are cheap, you'll see it happen relatively quickly
[20:44:09] tubbo: but this allows you to break apart each iteration of the loop. you can still use sidekiq-status to test whether each individual job failed or passed
[20:44:23] OyoKooN: has joined #RubyOnRails
[20:44:47] Synthead: tubbo: that's really interesting. I
[20:46:05] Synthead: tubbo: I'm not sure if it'll work for my case, though, cause that 8-second job will be generating a single string value for memcached. I'd need to take all the individual results and aggregate them somehow, and I'd still need to invalidate the job if another one of these jobs come in
[20:47:07] Synthead: tubbo: the goal is to have the server always generating the latest cache. If a job starts, and another one starts two seconds later, the goal is to drop what it's doing and work with the newer data instead.
[20:47:14] ewilliam: smathy: ok updated here: https://gist.github.com/ewilliam/105debb228c2834d4610
[20:47:40] Synthead: sidekiq seems really great by the way
[20:47:46] Radar: nbarnes: Did you get your Ruby issues fixed?
[20:48:27] leeky: has joined #RubyOnRails
[20:48:32] skullcrasher: has joined #RubyOnRails
[20:48:38] smathy: Synthead, all of his software is very well written.
[20:49:03] nettoweb: has joined #RubyOnRails
[20:49:14] toydestroyer: has joined #RubyOnRails
[20:49:45] smathy: ewilliam, the fields are called dob not dob_attributes
[20:51:29] ewilliam: smathy: yes i tried that. i put dob_attrs in there too for illustration
[20:51:48] EminenceHC: has joined #RubyOnRails
[20:51:57] smathy: ewilliam, but dob_attributes is the only one you're setting the nested fields on.
[20:52:08] smathy: Not on dob for example: https://gist.github.com/ewilliam/105debb228c2834d4610#file-bank_accounts_controller-rb-L20
[20:52:48] NBarnes: tubbo; 10.8.5. Sorry for the delay, got called away from the laptop.
[20:52:51] otherj: has joined #RubyOnRails
[20:52:52] ewilliam: smathy: i updated the gist to clarify. there's only :dob in the params method
[20:53:00] greengriminal: has joined #RubyOnRails
[20:53:16] smathy: ewilliam, right, so there's your problem.
[20:53:34] SteenJobs: has joined #RubyOnRails
[20:53:54] Radar: nbarnes: Have you tried using ruby-install/chruby instead of RVM?
[20:54:02] Radar: nbarnes: and why do you want an old version of Ruby?
[20:54:07] tubbo: Synthead: what's "the latest cache" mean?
[20:54:39] sharkman: has joined #RubyOnRails
[20:54:55] otherj: does chruby have the same purpose as rbenv?
[20:55:43] ewilliam: smathy: i tested it again to be extra sure. the problem persists.
[20:56:10] SteenJobs: has joined #RubyOnRails
[20:56:32] smathy: ewilliam, of course the problem exists, your :dob element has no nested values. How are you not seeing this?
[20:56:38] djbkd: has joined #RubyOnRails
[20:56:52] lacuna: has joined #RubyOnRails
[20:57:01] alotofnoodles: has joined #RubyOnRails
[20:58:19] otherj: wow, chruby looks pretty baller
[20:59:20] Synthead: tubbo: cache that reflects the database. If the user writes to the DB via the rails app, the cache is out-of-date now. It takes about 8 seconds to generate said cache, so if the user writes data (and triggers a cache update job), then writes more data 3 seconds later, there would then be two jobs running. The first one would now generate cache for obsolete data, while the second one will generate cache that reflects the current data. The
[20:59:20] Synthead: second job would generate the latest cache.
[20:59:43] NBarnes: Radar; Work's codebase is locked to Ruby 1.9.3. This doesn't thrill me, but it is what it is.
[20:59:54] Radar: Ok, have fun.
[21:00:06] Radar: 2.0.0 will work just as well iirc
[21:00:54] smathy: ACTION skipped 1.9 entirely
[21:01:10] DoubleMalt: has joined #RubyOnRails
[21:01:13] NBarnes: Probably so.
[21:01:22] NBarnes: We have a lot of locked versions due to tech debt creep.
[21:01:29] NBarnes: I'll try 2.0.0, though.
[21:01:32] brahman: has joined #RubyOnRails
[21:02:08] tubbo: Synthead: you know rails comes with this kind of stuff baked in right?
[21:02:10] tubbo: Synthead: !caching
[21:02:10] helpa: Synthead: Caching with Rails Guide - http://guides.rubyonrails.org/caching_with_rails.html - by Aditya Chadha
[21:02:33] djbkd: has joined #RubyOnRails
[21:02:52] momomomomo: has joined #RubyOnRails
[21:03:10] ewilliam: smathy: thanks
[21:03:32] Synthead: tubbo: oh, yeah, for sure. I'm leveraging that already. I'm writing a one-page app with a lot of AJAX calls, and it doesn't make sense for the user to wait 8 seconds for the call to return (hence jobs).
[21:03:54] smathy: ewilliam, you're welcome.
[21:03:55] tubbo: Synthead: well let's just think about that for a second. none of my requests take 8 seconds.
[21:04:00] tubbo: Synthead: so why does yours?
[21:04:24] brahman: Hi, I am trying to sort out an active record association. It all seems to work fine when using rails console ie task = Task.create(:title => 'task_title') and task.subtask.create(:title => 'subtask_title'). When I try and fetch the task in a new rails console by using the task id ie task = Task.where(:id => id) the association is not present and all the collection methods are not added. Any ideas?
[21:04:49] momomomomo: brahman: !code
[21:04:49] helpa: brahman: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[21:04:59] momomomomo: put the models up on gist.github.com
[21:05:03] brahman: momomomomo: will do.
[21:05:12] Synthead: tubbo: I don't understand what you're getting at
[21:05:14] tubbo: Synthead: also, do you have rack-cache working or some other kind of http caching solution?
[21:05:20] NBarnes: Yeah, an AJAX request to the server should be... roughly as fast as a normal request, if not faster.
[21:05:22] ibouvousaime: has joined #RubyOnRails
[21:05:29] rromanch_: has joined #RubyOnRails
[21:05:31] smathy: brahman, where() does not return a single record.
[21:05:39] tubbo: Synthead: i think your request takes too long and there might be a better way to optimize it, e.g. by optimizing a SQL query.
[21:05:45] tubbo: not sure if that's what you're doing here
[21:06:07] smathy: brahman, !finders
[21:06:07] helpa: brahman: http://guides.rubyonrails.org/active_record_querying.html - ActiveRecord Querying Guide by Ryan Bigg
[21:06:10] NBarnes: If your AJAX calls are taking 8 seconds to return, it might be that your problem isn't something caching or jobs will fix.
[21:06:16] momomomomo: smathy: good catch. brahman '.where' returns an array, not an arel
[21:06:28] Synthead: tubbo: oh no, the queries and such are very fast. But if the user refreshes the font-end, I don't want them to wait 8 seconds for rails to turn tons of objects into a string every time.
[21:06:45] Synthead: tubbo: the JSON string contains about 3 MiB of data
[21:06:51] nogic: has joined #RubyOnRails
[21:06:59] NBarnes: 0_o That's a lot of JSON.
[21:07:06] momomomomo: Synthead: 3MB?
[21:07:09] Synthead: nbarnes: yeah for sure.
[21:07:13] momomomomo: what and why
[21:07:15] tubbo: Synthead: but the cache being out of date is not something you should be dealing with in bg jobs, it's something that should be dealt with in the view
[21:07:28] northfurr: has joined #RubyOnRails
[21:07:54] arBmind: has joined #RubyOnRails
[21:08:12] lacuna: has joined #RubyOnRails
[21:08:15] tubbo: Synthead: the other question is will your user be able to comprehend 20,000xN bits of data?
[21:08:20] Synthead: tubbo: that's how it is currently. if the user updates data, that string cache is deleted and re-generated on the next request. The first request takes ~8 seconds, then the subsequent requests are very fast
[21:08:44] smathy: momomomomo, where doesn't return an array.
[21:08:47] Synthead: tubbo: oh sure, yeah, it's going into slickgrid
[21:09:20] tubbo: Synthead: i see. so how were you thinking of solving for that "cache write" scenario? i mean, if the user updates data they need to wait for the response, right? how would you do the incremental updates?
[21:09:24] Synthead: tubbo: I'd rather have the cache generated as a bg job after the update, have it complete, and when a refresh happens, it's already done ahead of time
[21:09:29] momomomomo: smathy: does it not? it's been a while since I've used rails, but I thought itw as an array
[21:09:40] Linuus: has joined #RubyOnRails
[21:09:47] smathy: momomomomo, it's never been an array :)
[21:09:51] momomomomo: ah it is an arel
[21:10:01] momomomomo: activerecord::relation*
[21:10:31] Synthead: tubbo: nah, the user doesn't get the entire ~3 MiB JSON blob back. just a row from the db as JSON. As it is, it's negligible amounts of latency (milliseconds).
[21:10:33] tubbo: Synthead: so you're assuming the user is going to refresh.
[21:10:55] tubbo: how is that any different from just making them wait?
[21:11:12] brahman: smathy: Thanks. That was my problem... now using where().take
[21:11:18] Synthead: tubbo: I don't understand
[21:11:24] brahman: ACTION walks away in shame...
[21:11:27] tubbo: Synthead: you see what i'm going for here though? if it takes 8sec to get the results the user needs to see, then that's just how long it takes and no amount of background jobs is going to fix that.
[21:11:41] brahman: momomomomo: thanks also
[21:11:46] Synthead: tubbo: oh no, it doesn't take 8 seconds for the AJAX response
[21:11:59] Synthead: tubbo: just the entire blob of data (whenever a user loads the page)
[21:12:00] tubbo: Synthead: the only way this works is if the user doesn't immediately need to see results, but it kinda seems like they do
[21:12:14] tubbo: Synthead: oh so this whole discussion is bullshit then
[21:12:24] Synthead: tubbo: the server returns only the affected rows, and it gets updated via JS on the page
[21:12:39] tubbo: Synthead: i don't understand what your issue is and why you need jobs at all then
[21:12:43] tubbo: if all of these requests don't take very long
[21:13:08] smathy: ACTION has no idea how anyone can come away from reading the query guide thinking where(id: id).take is the way to go
[21:14:09] tubbo: Synthead: what you are talking about can be accomplished by using Rails.cache.fetch in your models (or wherever the request takes the most time to get through)
[21:14:12] VeryBewitching: smathy: For those who *really* one that single record they specified?
[21:15:00] nettoweb: has joined #RubyOnRails
[21:15:20] Synthead: tubbo: oh sure, the app uses Rails.cache methods liberally
[21:15:31] SamGerber: has joined #RubyOnRails
[21:15:31] lacuna: has joined #RubyOnRails
[21:15:31] lacuna: has joined #RubyOnRails
[21:15:32] smathy: VeryBewitching, not sure what you're getting at, there's no world where: `where(id:id).take` is the best way to do what that's doing, nor the very common alternative that raises if that's what they actually wanted.
[21:15:37] tds5016: can someone tell mw how I'd run a search from an exact term using the ruby gem?
[21:15:47] VeryBewitching: smathy: I was being sarcastic ;)
[21:15:50] tds5016: (This might be the wrong channel, and if so I'm sorry)
[21:16:33] VeryBewitching: smathy: Using where(id: id).take is the same as where(id: id) afaik
[21:16:43] smathy: VeryBewitching, oh right, no it's not.
[21:16:44] tubbo: Synthead: the one way i can see this working is if all of your responses are very fast, and then you use something like Faye or the upcoming ActionCable to tell the browser when to refresh. your job needs to generate a cache key that is newer than the last one, and it needs to populate the cache with whatever you want it do be.
[21:17:00] tubbo: Synthead: so the user gets confirmation that the req went through, but doesn't see results until they are ready
[21:17:02] VeryBewitching: ACTION goes to try
[21:17:21] brahman: smathy: not actually using where(:id) the query has other elements for example :user_id and :status I just didn't think it was required for my Q.
[21:17:25] tubbo: Synthead: you don't need a status thing inside your job for that
[21:17:32] smathy: tds5016, what does "run a search from an exact term" mean?
[21:17:39] brahman: Thanks for your help once again.
[21:17:40] tubbo: because you don't need to break out of the job, since each job could be idempotent
[21:17:46] yfeldblum: has joined #RubyOnRails
[21:17:48] tds5016: I want to do something like name: "foo"
[21:17:53] alotofnoodles: has joined #RubyOnRails
[21:17:58] VeryBewitching: It did exactly what I expected it to do.
[21:18:09] tds5016: and have it return documents that are exactly the value foo
[21:18:10] tubbo: Synthead: as i don't really know what you're doing here and it doesn't seem like you're using a sql database for this particular feature, YMMV
[21:18:30] smathy: brahman, it'd still be helpful to read that guide more fully. The better option is not too far where you seem to have stopped.
[21:18:44] tubbo: tds5016: !try
[21:18:44] helpa: tds5016: Why don't you try it and find out for yourself?
[21:18:59] tubbo: tds5016: !querying
[21:18:59] helpa: tds5016: http://guides.rubyonrails.org/active_record_querying.html - ActiveRecord Querying Guide by Ryan Bigg
[21:18:59] brahman: Will read further. :)
[21:19:02] lacuna: has joined #RubyOnRails
[21:19:03] tds5016: tubbo: try what myself....
[21:19:08] smathy: tds5016, !finders for you too!
[21:19:08] helpa: tds5016: http://guides.rubyonrails.org/active_record_querying.html - ActiveRecord Querying Guide by Ryan Bigg
[21:19:11] tubbo: oh yeah :D
[21:19:13] MartinElvar: has joined #RubyOnRails
[21:19:17] smathy: Oh, tubbo already did that.
[21:19:18] tds5016: tubbo active record isn't elastic search...
[21:19:20] tubbo: love how that's the same guide haha
[21:19:35] tubbo: tds5016: i know that. are you using elasticsearch or something?
[21:20:03] tds5016: yes. I'm using the elasticsearch gem and I need to get the values where a specific thing is exactly a value.
[21:20:06] arthurix_: has joined #RubyOnRails
[21:20:17] tds5016: or rather I need to filter on a given value...
[21:20:30] smathy: ...and here it comes.
[21:20:37] smathy: The actual question.
[21:20:40] smathy: tds5016, !code
[21:20:40] helpa: tds5016: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[21:21:01] tds5016: smathy: I just need to figure out how to do a term search using the elastic search gem.
[21:21:02] tubbo: tds5016: hmm, that's a good question. i'm 99% sure there's a kind of term option that will be like exact_match: 'foo' or whatever
[21:21:08] tds5016: It doesn't seem to be documented.
[21:21:12] tubbo: tds5016: it definitely is
[21:21:33] tds5016: lemme fix that... it doesn't seem o be documented in the elasticsearch-ruby gem.
[21:21:53] tubbo: tds5016: it's probably not specifically documented there because it's on elastic.co
[21:21:57] tubbo: https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html
[21:22:12] smathy: tds5016, even if you did, which you don't, you then added that actually you want to "filter on a given value" - filter suggests that you already have results of a search and you now need to filter those.
[21:22:54] tubbo: tds5016: it's a little hard to find but i think you might find this README helpful https://github.com/elastic/elasticsearch-ruby/tree/master/elasticsearch-dsl
[21:22:55] Synthead: tubbo: I'll walk you through it without the bg jobs :) User A loads the app. The large JSON bit is cached, so it loads quickly. Then, the user updates something via AJAX. The server responds quickly, deletes the cache where the JSON string lives and something is updated on the page. 30 seconds later, user B loads the app and waits 8 seconds for the JSON string to be rebuilt.
[21:23:27] Synthead: tubbo: with the bg jobs, user B wouldn't have to wait the 8 seconds, because user A would have triggered a background job to create said cache.
[21:23:49] tubbo: Synthead: can you fragment-cache each piece of the JSON that could potentially be individually updated? that way rebuilding the cache isn't a 20k-row job, it just rebuilds each piece of the JSON that it needs to
[21:23:55] smathy: Synthead, russian doll caching.
[21:24:10] tds5016: thanks for the help. hopefully this works :-)
[21:24:21] tubbo: Synthead: but yeah, also retain the full cache to achieve true babushkaism
[21:24:25] Synthead: tubbo: I'm also doing that now. .to_json takes ~8 seconds.
[21:24:41] smathy: ACTION suspects non-C parser
[21:24:49] tubbo: yeah how are you parsing json?
[21:25:02] tubbo: we use oj here because the ruby parser is slow
[21:25:07] mloy: has left #RubyOnRails: ("Leaving")
[21:25:40] smathy: Understatement ^
[21:25:49] smathy: The ruby parser is for amusement only.
[21:26:07] smathy: It's a joke on people trying to use Rails on Windows.
[21:26:15] EminenceHC: has joined #RubyOnRails
[21:26:33] ror15: has joined #RubyOnRails
[21:26:54] tubbo: smathy: wanna know a dirty secret? pretty sure the json gem uses a C parser
[21:27:20] tubbo: it uses native extensions. i know this because i've had so many occasions where pow didn't start and it was because 'Dylib not loaded' for a dep of the json gem
[21:27:34] tubbo: not sure why it's so shitty
[21:27:40] SamGerber: has joined #RubyOnRails
[21:29:16] lacuna: has joined #RubyOnRails
[21:29:18] smathy: tubbo, oh good.
[21:29:45] smathy: Fairly sure that it didn't at some point, I'm glad to hear that I'm out of date there.
[21:31:18] smathy: Oj is still even better, but we're going to be in the same ballpark as 8 seconds. So now I'm suspecting n+1 queryes.
[21:31:40] netzfisch: has joined #RubyOnRails
[21:31:42] luckyruby: has joined #RubyOnRails
[21:32:07] Radar: Dunno why you're all not using Elixir to build your JSON APIs these days
[21:32:18] Radar: ACTION gets his Elixir mention of the day in early
[21:32:47] colleenmcguckin: has joined #RubyOnRails
[21:33:13] cornerma1: has joined #RubyOnRails
[21:33:40] Radar: (to be fair, we're not using Elixir for our APIs at all because we have tons of AR model callbacks that would not run if we were to do it through Elixir instead of Rails)
[21:35:36] slash_nick: seems like some pub-subby something could kick those off for you
[21:36:37] ritic: has joined #RubyOnRails
[21:39:13] lacuna: has joined #RubyOnRails
[21:39:17] jobewan: has joined #RubyOnRails
[21:39:28] EminenceHC: has joined #RubyOnRails
[21:40:44] momomomomo: dat BEAM vm though
[21:41:41] vigintas: has joined #RubyOnRails
[21:43:05] luckyruby: has joined #RubyOnRails
[21:43:06] djbkd: has joined #RubyOnRails
[21:45:31] axl_: has joined #RubyOnRails
[21:46:50] timdunn: has joined #RubyOnRails
[21:47:46] SteenJobs: has joined #RubyOnRails
[21:48:28] tvw: has joined #RubyOnRails
[21:50:06] axl_: has joined #RubyOnRails
[21:51:03] Grundell: has joined #RubyOnRails
[21:51:57] colleenmcguckin: has joined #RubyOnRails
[21:53:07] lacuna: has joined #RubyOnRails
[21:53:14] petricore: has joined #RubyOnRails
[21:58:42] bruno-: has joined #RubyOnRails
[21:58:42] northfurr: has joined #RubyOnRails
[21:59:06] GnuYawk: has joined #RubyOnRails
[21:59:58] shpoont: has joined #RubyOnRails
[22:00:17] Linuus`: has joined #RubyOnRails
[22:01:20] pydave6367: has joined #RubyOnRails
[22:02:24] Linuus`: has joined #RubyOnRails
[22:02:53] SteenJobs: has joined #RubyOnRails
[22:03:00] baweaver: has joined #RubyOnRails
[22:03:47] tubbo: dat beeeeeeeeeeeam
[22:04:06] manfrin_: has left #RubyOnRails: ()
[22:06:20] EminenceHC: has joined #RubyOnRails
[22:06:36] roxtrongo: has joined #RubyOnRails
[22:08:30] sdwrage: has joined #RubyOnRails
[22:09:07] EminenceHC: has joined #RubyOnRails
[22:13:17] darrencauthon: has joined #RubyOnRails
[22:16:58] safety_cut: has joined #RubyOnRails
[22:19:02] trosborn: has joined #RubyOnRails
[22:24:45] htmldrum: has joined #RubyOnRails
[22:26:07] ecmacoder: has joined #RubyOnRails
[22:27:41] pixelhan_: has joined #RubyOnRails
[22:27:46] ror15: has joined #RubyOnRails
[22:30:31] NBarnes: Is Phoenix the things for making APIs with Elixier?
[22:30:37] NBarnes: Like Rails is for Ruby-ish?
[22:31:09] smathy: nbarnes, http://www.phoenixframework.org/ explains it pretty well.
[22:31:19] cleopatra: has joined #RubyOnRails
[22:31:51] atomical: has joined #RubyOnRails
[22:33:24] s2013: has joined #RubyOnRails
[22:37:08] pcpanic: has joined #RubyOnRails
[22:38:28] NBarnes: Thanks, smathy
[22:39:06] jessemcgilallen: has joined #RubyOnRails
[22:41:10] adaedra: didn't work.
[22:42:11] cleopatra: ACTION preparing git question!
[22:43:18] tbuehlmann: has joined #RubyOnRails
[22:43:18] tbuehlmann: has joined #RubyOnRails
[22:43:52] wcalderipe: has joined #RubyOnRails
[22:44:17] danneu: ACTION holds his breath
[22:44:30] shibabu: has joined #RubyOnRails
[22:45:14] baweaver: has joined #RubyOnRails
[22:46:00] sdwrage: has joined #RubyOnRails
[22:47:37] snurfery: has joined #RubyOnRails
[22:48:20] atomical: has joined #RubyOnRails
[22:52:08] nettoweb: has joined #RubyOnRails
[22:52:15] lypborges: has joined #RubyOnRails
[22:53:29] lypborges: Hello! I need some ideas, I have to implement a create_by on all my tables. Should I use concern or some gem to do that?
[22:54:49] rickmasta: has joined #RubyOnRails
[22:54:51] smathy: lypborges, !xy
[22:54:51] helpa: lypborges: 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
[22:58:04] cleopatra: hello smathy :)
[22:58:08] cleopatra: how are you today!
[22:58:37] smathy: cleopatra, skeptical and nervous.
[22:59:34] rhizome: like a frog with a teacup
[23:00:32] timdunn: has joined #RubyOnRails
[23:00:52] atomical: has joined #RubyOnRails
[23:01:33] Maletor: has joined #RubyOnRails
[23:01:55] smathy: cleopatra, because you're being weird, greeting me directly, asking how I am, I'm waiting for the shoe.
[23:02:44] towski_: has joined #RubyOnRails
[23:03:00] SteenJobs: has joined #RubyOnRails
[23:04:00] Palsson: has joined #RubyOnRails
[23:05:14] cleopatra: wells, friend i need help I have a field table called UnitPrice, and want to add the cents by a virtual attribute
[23:05:28] cleopatra: https://gist.github.com/ArpiaPsuv/6da145bd3a74eb1025e4
[23:08:08] smathy: cleopatra, are you sure you want two separate fields for dollars and cents? That's a very awkward UI.
[23:08:46] ellisTAA: has joined #RubyOnRails
[23:09:34] cleopatra: smathy, it is not recommended?
[23:09:39] wcalderipe: has joined #RubyOnRails
[23:10:23] jgpawletko: has joined #RubyOnRails
[23:11:09] ellisTAA: if a group has many members, and a member belongs to many groups, should this be a has_many :through association?
[23:11:39] draken: if i use current_user a lot from devise, should i try just set it to a variable in scope or does it not make any difference ?
[23:11:51] draken: aka is is bad to keep calling current_user
[23:13:00] cleopatra: I just wanted to separate in the user interface , dollars and cents and when save whit add in unitprice
[23:13:15] smathy: cleopatra, not by me.
[23:13:35] arthurix: has joined #RubyOnRails
[23:14:02] alevy: has joined #RubyOnRails
[23:14:32] smathy: EllisTAA, "belongs to many" is good English, but not good Rails. All "belongs to" associations are singular, so all plural associations must be "has many" type associations of some sort.
[23:14:41] smathy: EllisTAA, !associations <-- in case the above doesn't trigger the answer.
[23:14:41] helpa: EllisTAA: http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy
[23:15:08] ellisTAA: smathy: i figured i???d use has_and_belongs_to_many but i heard this is going to be deprecated ???.
[23:15:12] smathy: draken, it's memoized.
[23:15:23] quazimodo: has joined #RubyOnRails
[23:16:22] smathy: EllisTAA, not sure where you heard that, I'd worry about it when/if it happens.
[23:17:00] smathy: Wow, we (software engineers) add this concept of deprecation notices so people didn't need to worry about features being removed without notice, and people are so used to them now that they're anticipating the deprecations themselves!
[23:17:07] smathy: Egads world, STFU.
[23:17:37] smathy: *anticipating the deprecation NOTICES themselves
[23:17:41] trosborn: has joined #RubyOnRails
[23:18:11] Lytol: has joined #RubyOnRails
[23:18:38] ellisTAA: smathy: does this look good: https://gist.github.com/ellismarte/c40bc9e3de54e31f0392
[23:18:59] danneu: has joined #RubyOnRails
[23:20:19] smathy: EllisTAA, if you plan a hmt then yes.
[23:20:35] ellisTAA: smathy: cooool
[23:23:51] darrencauthon: has joined #RubyOnRails
[23:24:43] Y_Ichiro: has joined #RubyOnRails
[23:24:51] c0py: has joined #RubyOnRails
[23:26:46] matthewd: Yeah... habtm is now internally implemented via hm:t, and I think that's what people are interpreting as a death knell, but I know of no plans to kill it.
[23:28:41] ellisTAA: so i created groups, members, and a groupmembers table, but when i try to run Group.first.members i can???t access its members. Can I not do this with has_many_and_belongs_to?
[23:29:00] ivanskie: has joined #RubyOnRails
[23:29:15] smathy: I didn't realize that matthewd, I'd even say that that refactor makes it LESS likely it'll be removed. Less code smell if it's just using hmt.
[23:29:43] smathy: EllisTAA, there isn't even a has_many_and_belongs_to - you really need to read the guide I linked you to.
[23:29:54] gambl0re: has joined #RubyOnRails
[23:30:15] smathy: EllisTAA, if you want to use habtm then no, the migrations you showed were wrong. I specifically said that they were fine if you planned to use hmt
[23:30:28] smathy: EllisTAA, !associations - for your sanity and mine.
[23:30:28] helpa: EllisTAA: http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy
[23:31:36] blackhuey: has joined #RubyOnRails
[23:31:46] northfurr: has joined #RubyOnRails
[23:32:01] Radar: has_and_belongs_to_many, perhaps?
[23:32:22] Ropeney: has joined #RubyOnRails
[23:32:27] Guest7725: has joined #RubyOnRails
[23:33:58] quazimodo: has joined #RubyOnRails
[23:34:54] sankaber: has joined #RubyOnRails
[23:38:40] yunior: has joined #RubyOnRails
[23:39:35] timdunn: I have googled how to use postgres when deploying my Rails app to heroku but all the suggestions on stack overflow I have tried do not seem to work. When I try to deploy my app using push heroku master i get an error message saying that sqlite3 is not supported though I have modified my gemfile to include sqlite3 only in development and to use the pg gem only in production. What else must I do to avoid the error message I get when trying
[23:39:35] timdunn: deploy my app?
[23:40:56] rhizome: timdunn: when something like that happened to me, i removed the sqlite and changed the app to use the same db adapter everywhere
[23:41:10] apeiros: has joined #RubyOnRails
[23:41:16] \13k: has joined #RubyOnRails
[23:41:18] alexblom: has joined #RubyOnRails
[23:41:21] jtperreault: has joined #RubyOnRails
[23:41:30] kitallis: has joined #RubyOnRails
[23:41:56] timdunn: rhizone: so what you are saying is I shouldn't even have the sqlite3 in development but should remove it entirely?
[23:42:28] rhizome: essentially, yeah, or whatever you use in production
[23:42:45] Radar: +1 rhizome
[23:42:56] chorgi: has joined #RubyOnRails
[23:43:03] Radar: Develop on the same database that you deploy to.
[23:43:07] rhizome: i suspect there's a bug in rails, but i haven't had time to chase it down
[23:43:13] cnk: that's the optimal solution. For now, look at where the error is coming from
[23:43:34] cnk: stack trace tell you what thinks it should have sqlite3?
[23:43:42] craysiii: maybe you still have the sqlite3 gem reference in highest scope of the gemfile
[23:43:51] rhizome: i forget the exact text of the error outside of heroku
[23:44:02] rhizome: it's not that
[23:44:06] Radar: It is not that hard to reproduce in a new app.
[23:44:21] rhizome: and besides, database.yml should be enough even if both gems are isntalled
[23:44:24] ror15: has joined #RubyOnRails
[23:45:10] Radar: Heroku updates database configuration with its own settings.
[23:46:08] rhizome: well apparently sqlite in env and/or database.yml is slipping through that process
[23:46:19] rhizome: in this case
[23:46:48] Radar: I believe it's the gemfile dependency. I'm waiting for "git push heroku master" to stop hanging so I can test :)
[23:48:40] timdunn: rhizome: is it necessary to do anything with the database.yml file?
[23:48:55] Radar: timdunn: this is the kind of error that you're seeing, right? https://gist.github.com/radar/28ed0804213dd8ec2f62
[23:49:15] rhizome: timdunn: change all the adapters to pg, install pg in your development environment. create/migrate databases
[23:49:35] Radar: Just testing it now. Looks like it will work fine if sqlite3 is in a dev group.
[23:49:40] Radar: Because it runs
[23:49:40] Radar: remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
[23:50:06] Radar: So I'm guessing _either_ sqlite3 is specified outside of the dev environment _or_ a gem that you're using depends on sqlite3.
[23:50:09] rhizome: maybe it got fixed in 4. timdunn what version rails?
[23:50:13] Radar: Hard to know without seeing the Gemfile + Gemfile.lock.
[23:50:13] chipotle: has joined #RubyOnRails
[23:50:23] Radar: timdunn: please gist both Gemfile + Gemfile.lock.
[23:50:38] Radar: timdunn: !gist
[23:50:38] helpa: timdunn: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[23:51:04] dpulliam: has joined #RubyOnRails
[23:51:07] rhizome: so radar, your test app was pg in production and sqlite3 in dev?
[23:51:23] Radar: rhizome: https://gist.github.com/radar/56ec08ba474d9db489db
[23:51:33] Radar: rhizome: sqlite3 in dev, pg in default group
[23:52:07] craysiii: so sqlite3 will override pg since its in the development group?
[23:52:11] GnuYawk: has joined #RubyOnRails
[23:52:23] rhizome: Radar: can you try putting the pg line above the dev group?
[23:52:30] Radar: rhizome: It will be resolved the same way.
[23:52:45] Radar: craysiii: What DB gets used in dev mode depends on config/database.yml
[23:52:58] rhizome: well i definitely saw it in 3, haven't tried since
[23:52:58] Radar: Heroku by default overrides your production credentials.
[23:53:11] ellisTAA: i followed the documentation on this page http://guides.rubyonrails.org/association_basics.html%20 but for some reason when i run Group.first.members in rails console i still get a no method error ??? https://gist.github.com/ellismarte/dadee9de4208009f9ad6
[23:53:12] craysiii: yea makes sense
[23:53:16] timdunn: i am using 4.2
[23:53:29] timdunn: and yes that is what error i got
[23:54:19] Radar: timdunn: gist both Gemfile + Gemfile.lock please.
[23:55:10] timdunn: Radar: when i look at the gemlock file it still has sqlite3
[23:55:20] craysiii: give us the files
[23:55:27] Radar: timdunn: If you'd like help with this, we're going to need to see the files.
[23:57:10] rickmasta: has joined #RubyOnRails
[23:57:18] colleenmcguckin: has joined #RubyOnRails
[23:57:29] timdunn: https://gist.github.com/timdunn22/284e4e1c1019d0e2d956
[23:58:38] montagesoftware: has joined #RubyOnRails
[23:58:45] Radar: sqlite3 isn't mentioned in the Gemfile, just in the Gemfile.lock
[23:58:54] Radar: timdunn: Run `bundle install`, commit both Gemfile + Gemfile.lock, push them to Heroku
[23:58:57] Radar: Let us know what happens.
[23:59:01] losvedir: has joined #RubyOnRails