« Back to channel list

#RubyOnRails - 21 August 2015

« Back 1 day Forward 1 day »
[00:00:09] northfurr: has joined #RubyOnRails
[00:00:32] charliesome: has joined #RubyOnRails
[00:02:56] dopie: has joined #RubyOnRails
[00:05:11] annlewis: has joined #RubyOnRails
[00:07:10] ratmav: has joined #RubyOnRails
[00:07:41] ratmav: has joined #RubyOnRails
[00:09:43] nahtnam: Whats the difference between private and protected in a controller?
[00:09:43] elv: has joined #RubyOnRails
[00:10:03] nahtnam: Scaffolds tend to use protected
[00:11:17] doublemalt_: has joined #RubyOnRails
[00:11:51] bruno-: has joined #RubyOnRails
[00:11:57] _axx: has joined #RubyOnRails
[00:12:09] enitiz: has joined #RubyOnRails
[00:12:11] charliesome: has joined #RubyOnRails
[00:12:11] michael_mbp: has joined #RubyOnRails
[00:12:27] MarkTR: has joined #RubyOnRails
[00:14:17] newton: is there a way to "find by subject" when subject is polymorphic?
[00:14:19] chouhoulis: has joined #RubyOnRails
[00:15:03] bricker: newton: find_by(subject_type: "YourCoolSubjectClass", subject_id: params[:your_cool_subject_id])
[00:15:50] northfurr: has joined #RubyOnRails
[00:16:20] chouhoulis: has joined #RubyOnRails
[00:18:09] Mia: has joined #RubyOnRails
[00:18:53] jenrzzz: has joined #RubyOnRails
[00:19:45] newton: bricker: figured. thanks.
[00:20:04] rromanchuk: has joined #RubyOnRails
[00:20:50] yfeldblum: has joined #RubyOnRails
[00:21:56] dideler: has joined #RubyOnRails
[00:24:43] stardiviner: has joined #RubyOnRails
[00:25:54] jenrzzz: has joined #RubyOnRails
[00:27:01] northfurr: has joined #RubyOnRails
[00:27:09] stardiviner: has joined #RubyOnRails
[00:28:03] frzn: has joined #RubyOnRails
[00:29:06] djbkd: has joined #RubyOnRails
[00:30:23] charliesome: has joined #RubyOnRails
[00:32:18] northfurr: has joined #RubyOnRails
[00:32:23] bronson: has joined #RubyOnRails
[00:32:31] Mia: has joined #RubyOnRails
[00:32:31] Mia: has joined #RubyOnRails
[00:34:52] jenrzzz: has joined #RubyOnRails
[00:36:07] blackmesa: has joined #RubyOnRails
[00:37:32] barhum2013: has joined #RubyOnRails
[00:37:48] VeryBewitching: has joined #RubyOnRails
[00:39:10] enitiz: has joined #RubyOnRails
[00:39:22] pixelhandler: has joined #RubyOnRails
[00:39:37] Moonlight-Angel: has joined #RubyOnRails
[00:42:11] dented42: has joined #RubyOnRails
[00:48:41] nya: has joined #RubyOnRails
[00:50:00] ledestin: has joined #RubyOnRails
[00:50:48] tuelz: has joined #RubyOnRails
[00:51:56] enitiz_: has joined #RubyOnRails
[00:52:10] arooni-mobile: has joined #RubyOnRails
[00:55:13] acti0nman: has joined #RubyOnRails
[00:56:56] Inside: has joined #RubyOnRails
[00:59:59] hmsimha_: has joined #RubyOnRails
[01:01:37] diegoviola: has joined #RubyOnRails
[01:02:24] drale2k: has joined #RubyOnRails
[01:03:29] Sebas1509: has joined #RubyOnRails
[01:03:44] Sebas1509: has left #RubyOnRails: ()
[01:04:54] baweaver: has joined #RubyOnRails
[01:05:03] RegulationD: has joined #RubyOnRails
[01:05:56] annlewis: has joined #RubyOnRails
[01:06:27] quazimodo: has joined #RubyOnRails
[01:09:32] Limix: has joined #RubyOnRails
[01:11:10] mary5030: has joined #RubyOnRails
[01:14:58] nya: has joined #RubyOnRails
[01:17:12] p1k: has joined #RubyOnRails
[01:22:59] jenrzzz: has joined #RubyOnRails
[01:24:46] mary5030: has joined #RubyOnRails
[01:25:12] alfalfa: has joined #RubyOnRails
[01:25:24] dented42: has joined #RubyOnRails
[01:30:23] elepedus: has joined #RubyOnRails
[01:31:02] robbyoconnor: has joined #RubyOnRails
[01:31:06] one_zero: has joined #RubyOnRails
[01:32:00] jenrzzz: has joined #RubyOnRails
[01:33:18] bronson: has joined #RubyOnRails
[01:33:24] dopieee: has joined #RubyOnRails
[01:35:58] northfurr: has joined #RubyOnRails
[01:37:53] blackmesa: has joined #RubyOnRails
[01:38:25] DelDotB: has joined #RubyOnRails
[01:39:43] segy: has joined #RubyOnRails
[01:40:02] jzig: has joined #RubyOnRails
[01:41:27] barhum2013: has joined #RubyOnRails
[01:42:24] chadhs: has joined #RubyOnRails
[01:44:05] chadhs: has joined #RubyOnRails
[01:45:15] diego2: has joined #RubyOnRails
[01:46:06] diego2: has joined #RubyOnRails
[01:46:30] chadhs: has joined #RubyOnRails
[01:46:54] User458764: has joined #RubyOnRails
[01:48:32] chadhs: i'm looking for some guidance related to deploying my app
[01:48:52] riskish: has joined #RubyOnRails
[01:49:15] chadhs: what do you prefer? mod_rails (passenger), unicorn, other?
[01:51:39] allcentu1: has joined #RubyOnRails
[01:52:31] segy: has joined #RubyOnRails
[02:01:18] Rubie: has joined #RubyOnRails
[02:05:02] badmadrad: has joined #RubyOnRails
[02:06:43] annlewis: has joined #RubyOnRails
[02:06:51] northfurr: has joined #RubyOnRails
[02:08:33] beauby: has joined #RubyOnRails
[02:08:41] sevenseacat: has joined #RubyOnRails
[02:08:57] badmadrad1: has joined #RubyOnRails
[02:09:15] workmad3: has joined #RubyOnRails
[02:09:15] tuelz: has joined #RubyOnRails
[02:10:32] Ropeney: chadhs: Puma :P
[02:10:34] dopie: has joined #RubyOnRails
[02:10:44] chadhs: trolling or is that real haha
[02:10:53] chadhs: unicorns, pumas, what's next!?
[02:15:03] Maletor: has joined #RubyOnRails
[02:15:17] hmsimha_: has joined #RubyOnRails
[02:16:09] bronson: has joined #RubyOnRails
[02:21:50] badmadrad: has joined #RubyOnRails
[02:22:12] Sigma00: they're all good, just pick the one you like the most
[02:22:18] greengriminal: has joined #RubyOnRails
[02:27:41] togg719: has joined #RubyOnRails
[02:30:53] baweaver: has joined #RubyOnRails
[02:36:15] j_mcnally: has joined #RubyOnRails
[02:37:02] gambl0re: has joined #RubyOnRails
[02:37:22] mclee: has joined #RubyOnRails
[02:39:44] blackmesa: has joined #RubyOnRails
[02:41:34] oflannabhra: has joined #RubyOnRails
[02:44:46] dented42: has joined #RubyOnRails
[02:45:03] bruno-: has joined #RubyOnRails
[02:46:02] j_mcnally: has joined #RubyOnRails
[02:49:52] ivanskie: has joined #RubyOnRails
[02:50:47] darrencauthon: has joined #RubyOnRails
[02:57:50] x-light: has joined #RubyOnRails
[03:02:40] havenwood: has joined #RubyOnRails
[03:06:31] RegulationD: has joined #RubyOnRails
[03:07:49] annlewis: has joined #RubyOnRails
[03:09:52] elv: has joined #RubyOnRails
[03:10:21] braincrash: has joined #RubyOnRails
[03:11:35] dented42_: has joined #RubyOnRails
[03:12:14] User4587_: has joined #RubyOnRails
[03:15:00] seank_: has joined #RubyOnRails
[03:15:34] darrencauthon: has joined #RubyOnRails
[03:15:56] RandyT_: has joined #RubyOnRails
[03:16:34] jzig: has joined #RubyOnRails
[03:17:22] badmadrad1: has joined #RubyOnRails
[03:18:40] diego3: has joined #RubyOnRails
[03:18:46] diego3: has joined #RubyOnRails
[03:19:09] bronson: has joined #RubyOnRails
[03:22:15] hadees: has joined #RubyOnRails
[03:25:43] NBarnes: has joined #RubyOnRails
[03:26:49] EminenceHC: has joined #RubyOnRails
[03:31:55] ngscheurich: has joined #RubyOnRails
[03:31:59] elepedus: has joined #RubyOnRails
[03:35:39] pontiki: has joined #RubyOnRails
[03:37:12] Maletor: has joined #RubyOnRails
[03:47:14] nickenchuggets: has joined #RubyOnRails
[03:47:19] errakeshpd: has joined #RubyOnRails
[03:47:55] bronson: has joined #RubyOnRails
[03:50:48] tuelz: has joined #RubyOnRails
[04:00:06] EminenceHC: has joined #RubyOnRails
[04:04:24] jzig: has joined #RubyOnRails
[04:04:38] jacaballero: has joined #RubyOnRails
[04:08:35] annlewis: has joined #RubyOnRails
[04:09:05] StartupHub: has joined #RubyOnRails
[04:09:47] bePolite: has joined #RubyOnRails
[04:11:28] fedexo: has joined #RubyOnRails
[04:14:21] braincra-: has joined #RubyOnRails
[04:15:49] spewbaby: has joined #RubyOnRails
[04:17:09] errakeshpd: has joined #RubyOnRails
[04:19:59] framling: has joined #RubyOnRails
[04:26:02] yfeldblum: has joined #RubyOnRails
[04:29:15] yfeldblum: has joined #RubyOnRails
[04:32:02] RandyT_: has joined #RubyOnRails
[04:32:33] togg719: if i was trying to add a column to a table in my schema.rb i add my changes but when i run db:migrate it deletes what i added. do i need to do anything else to edit a table?
[04:32:35] srinidhi: has joined #RubyOnRails
[04:34:04] sevenseacat: togg719: you need to create a migration to add the column. don't make changes to schema.rb directly.
[04:34:08] bricker: has joined #RubyOnRails
[04:34:54] arooni-mobile: has joined #RubyOnRails
[04:39:29] bePolite: has joined #RubyOnRails
[04:39:29] bePolite: has joined #RubyOnRails
[04:39:47] togg719: I added a migration change .rb into db -> migrate and then ran db:migrate but I dont think it added the column when I checked on the console
[04:41:00] togg719: http://privatepaste.com/5d8982bfb2
[04:41:34] hmsimha_: has joined #RubyOnRails
[04:42:22] n00bDev: has joined #RubyOnRails
[04:42:36] sevenseacat: so how did you generate that file
[04:42:38] sevenseacat: and what is it called
[04:43:09] n00bDev: whats the appropriate way to update a foreign key between 2 models with a has_one relationship in a controller?
[04:43:42] blackmesa: has joined #RubyOnRails
[04:44:26] togg719: sevenseacat: I wrote it with what I found online, labeled AddGroupToRecipe.rb in db -> migrate
[04:44:45] x-light: has joined #RubyOnRails
[04:44:48] sevenseacat: ok, now use the migration generator to make sure it gets named correctly
[04:45:01] sevenseacat: rails g migration add_group_id_to_recipes group_id:integer
[04:45:05] sevenseacat: rake db:migrate
[04:47:42] iateadonut: has joined #RubyOnRails
[04:47:47] RandyT_: has joined #RubyOnRails
[04:48:09] djbkd: has joined #RubyOnRails
[04:48:11] togg719: sweet! it said it added the column. on the console i ran @r = Recipe.new and didn???t see a group_id:nil or anything like that however
[04:48:54] dopie: Hey all I have a question should I create a method to get the customer_profile hash and use memorization so I don't have to keep on hitting the api ?
[04:48:54] dopie: https://gist.github.com/staycreativedesign/644da5113528813b7bc8
[04:49:33] sevenseacat: togg719: did you restart the console after running the migration
[04:50:25] iateadonut: on my server, i've got my rails application running through passenger. on my localhost, when I use the command line to start my app (at 127.0.0.1:3000), i get a nice log of everything that my application is doing. how can i get that same type of log outputting to STDOUT on my server?
[04:51:02] sevenseacat: iateadonut: there is no stdout when running through passenger
[04:51:13] sevenseacat: however, things get logged into the log/ folder of your app folder exactly the same
[04:51:20] iateadonut: is there a log somewhere i can tail -f?
[04:51:57] iateadonut: my actual problem is that i added indexes to my postgresql database and it didn't seem to speed anything up.
[04:52:57] sevenseacat: ah, an xy problem
[04:53:22] sevenseacat: that you should be debugging in the database itself, by analyzing the queries that get run
[04:53:34] iateadonut: yeah, i thought the log had some of those.
[04:53:42] nya: has joined #RubyOnRails
[04:53:50] iateadonut: i actually think it's the javascript rendering in front, but i'm going to make sure.
[04:54:00] NivenHuH: has joined #RubyOnRails
[04:54:19] sevenseacat: yeah if the problem is javascript, then adding database indexes wont make a lick of difference.
[04:54:24] ivanskie: has joined #RubyOnRails
[04:54:52] togg719: NameError: uninitialized constant Recipes
[04:55:03] NivenHuH: hi all, when you are doing a create, you can modify associations and have autosave: true automatically update those associations... however, if you're doing a destroy, the same behavior does not work. does anybody know how to also autosave associations on destroy? (I'm trying to get all of the modifications for the associated records to be saved within the same transaction)
[04:56:07] sevenseacat: togg719: you don't have a Recipes constant. whats the name of the model again?
[04:56:56] togg719: yikes, everything is looking good now. thanks for your help :)
[04:58:35] robbyoconnor: has joined #RubyOnRails
[05:00:40] cgfbee: has joined #RubyOnRails
[05:03:20] sdwrage: has joined #RubyOnRails
[05:03:55] errakeshpd: Only ten items only showing eventhough specified per(50), Kaminari.paginate_array(@contacts).page(params[:page]).per(50)
[05:05:25] sevenseacat: need a bit more information than that
[05:05:44] errakeshpd: In the view "<%= paginate @contacts,:remote=>true%> "
[05:05:58] errakeshpd: @contacts = Kaminari.paginate_array(@contacts).page(params[:page]).per(50)
[05:06:05] n00bDev: has joined #RubyOnRails
[05:06:18] errakeshpd: when the above line is executed , contacts is around 1000+
[05:06:41] errakeshpd: pagination "link" is showing 100+
[05:06:57] errakeshpd: Its inside of a bootstrap model popup
[05:07:12] maz-dev: has joined #RubyOnRails
[05:09:23] annlewis: has joined #RubyOnRails
[05:10:25] rvanlieshout: has joined #RubyOnRails
[05:12:27] krz: has joined #RubyOnRails
[05:12:32] beauby: Any way to permit _either_ an object { :key1, :key2 } _or_ an array of objects { :key1, :key2 } with strong parameters?
[05:12:34] NivenHuH: also, is it possible to do a validation after data has been saved to the database, but before the transaction is committed?
[05:12:49] sevenseacat: NivenHuH: thats not a validation.
[05:13:23] sevenseacat: yes, you can issue callbacks at that point of the process, but etf for
[05:13:27] NivenHuH: the goal that i have is... i'm editing associations (of the same type) that i would like to validate
[05:13:38] NivenHuH: along with the parent
[05:14:23] sevenseacat: thats what normal validations are for?
[05:15:06] darrik: has joined #RubyOnRails
[05:15:16] NivenHuH: the problem i'm running into is, it's a uniqueness validation.. so what's in the database doesn't match what's in memory, so the validation fails
[05:15:34] iateadonut: how can i echo the actual psql query from rails? the query that i think ActiveRecord should be generating takes .1 seconds from the psql console, but the ruby request is taking 11 seconds!
[05:15:56] iateadonut: so i want to be sure ruby is executing the same query i am before looking at other bottlenecks.
[05:16:41] VeryBewitching: iateadonut: Model.all.to_sql
[05:16:44] sevenseacat: iateadonut: that will be part of your logs in development
[05:16:51] iateadonut: (the ruby request to that specific method, which only has 2 parts: 1 - postgresql query, 2 - render json; i'm guessing render json is taking a lot of time, but i want to look)
[05:17:31] VeryBewitching: iateadonut: As sevenseacat said, the logs will show you queries run during the request.
[05:17:52] x-light: has joined #RubyOnRails
[05:19:28] Lightsword: has joined #RubyOnRails
[05:20:06] iateadonut: i don't see them. i'm looking in both 'production' and 'development' logs.
[05:20:25] iateadonut: do i need to add 'Model.all.to_sql' to my controller?
[05:20:41] VeryBewitching: iateadonut: That will show you the query that AR will run
[05:20:45] kriskhaira_: has joined #RubyOnRails
[05:21:11] VeryBewitching: iateadonut: If you're not seeing the queries in the logs, then with my current knowledge I don't know why.
[05:21:18] iateadonut: also, i just noticed this: Completed 200 OK in 15532ms (Views: 15374.1ms | ActiveRecord: 149.1ms) - so the databse query is in fact taking 1/10 of a second.
[05:21:40] kriskhaira_: Hi. How do I send a flash message from a model to a controller?
[05:21:44] sevenseacat: there you go, its all in the views.
[05:21:45] VeryBewitching: iateadonut: But a quick Google search points to: config.log_level = :debug
[05:21:49] sevenseacat: kriskhaira_: you don't.
[05:21:59] sevenseacat: iateadonut: you should be seeing things in your logs like this: https://gist.github.com/sevenseacat/95cb54c70c70634a3581
[05:22:28] sevenseacat: all the SQL queries that are taking place.
[05:23:10] kriskhaira: sevenseacat: What if I have an after_save callback in my model where I need to show a message in the controller depending on the output of the callback?
[05:23:22] sevenseacat: kriskhaira: you don't.
[05:23:36] VeryBewitching: kriskhaira: Flash message is set in a controller action
[05:24:37] kriskhaira: VeryBewitching, sevenseacat: Yeah I've been reading up about this and ended up at the same conclusion. What would be a better Rails pattern then for showing a message in the controller depending on what happens to a saved record?
[05:24:54] sevenseacat: kriskhaira: well either its saved or its not
[05:25:06] sevenseacat: so you set the flash message in the controller accordingly
[05:25:20] fgo: has joined #RubyOnRails
[05:25:22] chadhs: has joined #RubyOnRails
[05:25:33] VeryBewitching: kriskhaira: Though, as a good pattern, that message should be localized.
[05:25:49] VeryBewitching: flash[:success] = I18n.t('some.key')
[05:25:49] nahtnam: has joined #RubyOnRails
[05:26:21] sevenseacat: eh, depends if your app needs i18n or not
[05:26:30] kriskhaira: sevenseacat: My use case is this???I have a callback in model A that also updates model B if an attribute of model A is changed to a certain value. So to show a flash message, the only way is to reuse the same condition check in the controller and do it there, is that correct?
[05:26:59] VeryBewitching: sevenseacat: It's not too much more work for the future possibility, I do it as a given typically.
[05:27:01] kriskhaira: VeryBewitching: Yup I will be localizing it.
[05:27:04] sevenseacat: kriskhaira: so your model still either saves or it doesnt
[05:27:08] sevenseacat: what other options are there?
[05:27:21] sevenseacat: VeryBewitching: it can be a lot of work to do and redo. I typically dont do it unless requested.
[05:28:36] kriskhaira: sevenseacat: Showing a flash message simply based on "if instance.save" in the controller won't suffice. What I want to do is "if saved and also if attribute has changed to 0".
[05:28:42] aganov: has joined #RubyOnRails
[05:29:07] sevenseacat: I dont see why you would, but if you want to, then do that
[05:29:33] kriskhaira: In the model, I have a callback that says "if attribute has changed to 0 then update model B as well"
[05:29:39] VeryBewitching: kriskhaira: Are you wondering about messages for validation, or flash messages for notices and such?
[05:29:53] kriskhaira: Note for validation. For flash messages only.
[05:30:09] sevenseacat: I'd definitely abstract it out to something more meaningful than 'if attribute has changed to 0' though
[05:30:20] kriskhaira: sevenseacat: I figured I'd end up down this route. Was just wondering because if model errors can be accessed in the controller, I wish there was a way to also send simple non-error messages.
[05:30:35] VeryBewitching: kriskhaira: @model.errors.messages
[05:30:57] VeryBewitching: But that's field validation errors.
[05:31:09] sevenseacat: this is why I don't like helping people that provide fake examples
[05:31:18] kriskhaira: VeryBewitching: Not for validation. I know how to access model error messages already. I was just wondering about the possibility of sending success messages to the controller from the model.
[05:31:41] VeryBewitching: kriskhaira: @model.save => Boolean
[05:31:50] VeryBewitching: How is that not a good indication of a result?
[05:32:52] kriskhaira: VeryBewitching, sevenseacat: I'm going to put up a Gist of a real example. Hang on.
[05:33:39] elepedus: has joined #RubyOnRails
[05:34:17] darrencauthon: has joined #RubyOnRails
[05:34:25] nahtnam: VeryBewitching: Can I pm you?
[05:36:48] elv: has joined #RubyOnRails
[05:39:01] diego2: has joined #RubyOnRails
[05:40:34] elv_: has joined #RubyOnRails
[05:40:57] kriskhaira: VeryBewitching, sevenseacat: Here you go. This is what I have at the moment https://gist.github.com/kriskhaira/1f83a0b5507fb0883775
[05:41:22] Fevrale: has joined #RubyOnRails
[05:42:08] kriskhaira: Might end up repeating the check at lines 12 and 15 of the model in the controller to show a message
[05:42:21] kriskhaira: I'd probably put it in a method first though. Make it more DRY
[05:42:45] jeadre: has joined #RubyOnRails
[05:43:31] duncannz: has joined #RubyOnRails
[05:43:34] Contigi777: has joined #RubyOnRails
[05:44:22] blackmesa: has joined #RubyOnRails
[05:45:11] User458764: has joined #RubyOnRails
[05:46:46] workmad3: has joined #RubyOnRails
[05:47:09] errakeshpd: has joined #RubyOnRails
[05:47:42] inversesquarelaw: has joined #RubyOnRails
[05:48:07] tagrudev: has joined #RubyOnRails
[05:48:33] VeryBewitching: kriskhaira: So just set the message, if you want a quick fix, in @call_results and write a method to return that list (depending on if you want to have more than one returned at a time) It's not pretty but it'll be forward movement.
[05:48:57] kriskhaira: VeryBewitching: Ok, gonna try that
[05:51:32] tuelz: has joined #RubyOnRails
[05:55:09] sandstrom: has joined #RubyOnRails
[05:56:15] yardenbar: has joined #RubyOnRails
[05:58:18] joe2: has joined #RubyOnRails
[05:58:47] DelDotB: has joined #RubyOnRails
[05:59:16] AnoHito_: has joined #RubyOnRails
[06:02:21] User4587_: has joined #RubyOnRails
[06:03:12] Oog_: has joined #RubyOnRails
[06:03:55] AnoHito: has joined #RubyOnRails
[06:05:02] AnoHito_: has joined #RubyOnRails
[06:05:11] Oog_: how can i select stdev
[06:06:06] Oog_: Order.all.select('stddev(num)') - works but dont see how i can access the result
[06:07:13] Irikos: has joined #RubyOnRails
[06:07:20] MartinElvar: has joined #RubyOnRails
[06:09:17] bronson: has joined #RubyOnRails
[06:10:08] annlewis: has joined #RubyOnRails
[06:10:55] VeryBewitching: Oog_: Order.all.select('stddev(num) as standard_deviation')
[06:10:59] rromanch_: has joined #RubyOnRails
[06:11:37] VeryBewitching: Oog_: Also good when you run a query is to do it in the rails console and inspect the results.
[06:12:06] htmldrum: has joined #RubyOnRails
[06:12:10] Oog_: how do i access the result?
[06:12:21] Oog_: Order.all.select('stddev(num) as num')[0].num is nill
[06:16:27] netzfisch: has joined #RubyOnRails
[06:17:24] Lightsword: has joined #RubyOnRails
[06:17:42] Macaveli: has joined #RubyOnRails
[06:18:43] gingray: has joined #RubyOnRails
[06:18:48] sinkensabe: has joined #RubyOnRails
[06:19:07] AnoHito: has joined #RubyOnRails
[06:19:45] DelDotB: has joined #RubyOnRails
[06:20:38] Macaveli: has joined #RubyOnRails
[06:20:39] arup_r: has joined #RubyOnRails
[06:21:49] VeryBewitching: Oog_: It's hard to try to create a solution without code and sample data to play with.
[06:22:00] Oog_: i got it thanks it was stddev_pop
[06:22:10] VeryBewitching: Ah, good stuff.
[06:22:11] Oog_: stddev for some reason executes but doesnt seem to return anything - odd
[06:23:28] arup_r1: has joined #RubyOnRails
[06:23:56] kimegede: has joined #RubyOnRails
[06:25:27] comrad: has joined #RubyOnRails
[06:25:33] tubbo: has joined #RubyOnRails
[06:26:06] czerasz: has joined #RubyOnRails
[06:26:11] WilfredTheGreat: has joined #RubyOnRails
[06:28:33] Tempesta: has joined #RubyOnRails
[06:35:47] MartinEl_: has joined #RubyOnRails
[06:36:08] russt: has joined #RubyOnRails
[06:37:34] ddv: has joined #RubyOnRails
[06:38:39] Linuus: has joined #RubyOnRails
[06:39:24] rails663: has joined #RubyOnRails
[06:39:47] alphaatom: has joined #RubyOnRails
[06:40:03] arup_r: has joined #RubyOnRails
[06:40:58] vigasdeep: has joined #RubyOnRails
[06:45:28] nya: has joined #RubyOnRails
[06:45:50] krz: has joined #RubyOnRails
[06:46:00] errakeshpd: has joined #RubyOnRails
[06:46:06] blackmesa: has joined #RubyOnRails
[06:46:54] bruno-: has joined #RubyOnRails
[06:52:43] michael_mbp: has joined #RubyOnRails
[06:52:51] alexhartley: has joined #RubyOnRails
[06:53:50] r0bby_: has joined #RubyOnRails
[06:54:29] dionysus69: has joined #RubyOnRails
[06:54:41] jensljungblad: has joined #RubyOnRails
[06:55:34] iamse7en: has joined #RubyOnRails
[06:55:52] Linuus: has joined #RubyOnRails
[06:57:32] iamse7en: Would there be a way to validate a form field, but if it fails validation, still allow submission but perform an action for those failed fields? E.g. Specifically, Users can create a team and add users to the team, using their email address. If the user#email doesn't exist, then send that email an invite to the site.
[07:00:26] juanpaucar: has joined #RubyOnRails
[07:01:58] rvanlieshout: iamse7en: so you want to present a validation failure to the user AND just ignore it?
[07:02:23] VeryBewitching: iamse7en: You can call user.valid? and inspect user.errors
[07:02:25] juanpauc_: has joined #RubyOnRails
[07:02:37] Meow-J: has joined #RubyOnRails
[07:03:04] VeryBewitching: iamse7en: You can also write a custom validation method and return true regardless of the method determines it has failed.
[07:03:07] kriskhaira: iamse7en: I've used the validation_scopes gem for this https://github.com/gtd/validation_scopes
[07:03:45] iamse7en: rvanlieshout: true, that doesn't make any sense, so maybe validation isn't want I want. just define a method if that email exists, add person to team if they do, send email if not... ?
[07:03:53] dhjondoh: has joined #RubyOnRails
[07:04:18] rvanlieshout: iamse7en: perform that magic before_save or before_create?
[07:04:22] juanpaucar: has joined #RubyOnRails
[07:05:19] iamse7en: rvanlieshout, yeah ok, and flash success might even include those future users who were sent emails
[07:05:46] iamse7en: just so they are aware of whats going on
[07:05:47] rvanlieshout: if you want that, you might want to use a service-object or something similar to perform that logic
[07:06:10] elepedus: has joined #RubyOnRails
[07:06:11] VeryBewitching: iamse7en: I would agree with rvanlieshout on the service object.
[07:06:18] juanpauc_: has joined #RubyOnRails
[07:06:19] RTG`: has joined #RubyOnRails
[07:06:27] rvanlieshout: a model should not know about anything besides the data
[07:06:30] rvanlieshout: that includes notifications
[07:06:39] rvanlieshout: a service object would be the bridge between that
[07:06:52] iamse7en: oh okay. googling service object now, as it is anew concept
[07:06:59] rvanlieshout: class FooService
[07:07:02] rvanlieshout: it's nothing special
[07:07:02] Linuus: has joined #RubyOnRails
[07:07:08] rvanlieshout: it could also be done in the controller
[07:07:22] rvanlieshout: but that would make it hard to use it outside a controllers perspective
[07:07:22] VeryBewitching: iamse7en: I've taken to creating app/actions/model/create.rb,update.rb,destroy.rb
[07:07:32] rvanlieshout: it's just a class that you define and shape
[07:07:44] iamse7en: kriskhaira and VeryBewitching, think I should go this other route other than do some type of custom validation or validation gem (given what I am looking for here)
[07:07:46] rvanlieshout: VeryBewitching: wouldn't that be concerns?
[07:08:08] VeryBewitching: rvanlieshout: No, concerns attach new functionality to the model
[07:08:12] rvanlieshout: or controller
[07:08:13] juanpauc_: has joined #RubyOnRails
[07:08:15] rvanlieshout: or anything actually
[07:08:23] rvanlieshout: there are routing concerns, controller concerns
[07:08:36] rvanlieshout: heck, even service concerns
[07:08:40] VeryBewitching: I do Namespace::Actions::Member::Create.new(member_params).call
[07:09:09] rvanlieshout: that feels like a bit weird
[07:09:15] sevenseacat: I prefer to name my service objects after what they actually do, not where they happen to be located in some heirarchy
[07:10:08] juanpaucar: has joined #RubyOnRails
[07:10:09] VeryBewitching: sevenseacat: I've done that too, but I'd rather process a request in a plain class that deal with all of that code in the controller, regardless of how it's named.
[07:10:38] sevenseacat: errr. I don't know what that means, but okay.
[07:10:56] annlewis: has joined #RubyOnRails
[07:12:13] juanpauc_: has joined #RubyOnRails
[07:14:05] iamse7en: just so I can understand here, this "magic" that adds user to group if exist or sends email if not... i could put in app/services/adding_user_to_group.rb, then hook up with my users controller (or maybe my groups controller). that is a service object? a la https://blog.engineyard.com/2014/keeping-your-rails-controllers-dry-with-services
[07:14:17] juanpaucar: has joined #RubyOnRails
[07:14:46] NBarnes: has joined #RubyOnRails
[07:14:56] iamse7en: and it could work to just put all of it in the controller, but it's cleaner/better as a service object?
[07:16:14] juanpauc_: has joined #RubyOnRails
[07:16:19] darutoko: has joined #RubyOnRails
[07:17:08] jenrzzz: has joined #RubyOnRails
[07:17:41] sandstrom: has joined #RubyOnRails
[07:17:58] cornerma1: has joined #RubyOnRails
[07:18:10] juanpaucar: has joined #RubyOnRails
[07:20:07] juanpauc_: has joined #RubyOnRails
[07:21:10] curses: has joined #RubyOnRails
[07:21:40] mutuma: has joined #RubyOnRails
[07:22:04] juanpaucar: has joined #RubyOnRails
[07:24:00] juanpauc_: has joined #RubyOnRails
[07:24:03] roolo: has joined #RubyOnRails
[07:25:55] juanpaucar: has joined #RubyOnRails
[07:27:23] alex88: has joined #RubyOnRails
[07:27:56] juanpauc_: has joined #RubyOnRails
[07:29:51] juanpaucar: has joined #RubyOnRails
[07:31:27] errakeshpd: we are using share this "http://localhost:3000/offers/fstrfg/share#sthash.op3jqLm9.4SJmMZUh.dpbs" But some unwanted url shows when naviagte to share how can i remove this "#sthash.op3jqLm9.4SJmMZUh.dpbs" ?
[07:31:48] juanpaucar: has joined #RubyOnRails
[07:32:33] charliesome: has joined #RubyOnRails
[07:32:42] choke: has joined #RubyOnRails
[07:33:18] blackmesa: has joined #RubyOnRails
[07:33:42] juanpaucar: has joined #RubyOnRails
[07:35:33] workmad3: has joined #RubyOnRails
[07:35:41] juanpaucar: has joined #RubyOnRails
[07:35:53] xhosae: has joined #RubyOnRails
[07:37:37] juanpauc_: has joined #RubyOnRails
[07:39:40] juanpaucar: has joined #RubyOnRails
[07:41:36] juanpaucar: has joined #RubyOnRails
[07:43:39] juanpauc_: has joined #RubyOnRails
[07:44:39] alex88: has joined #RubyOnRails
[07:45:36] juanpaucar: has joined #RubyOnRails
[07:47:22] errakeshpd: session[:share] is nil when trying to access from other controller action eventhough it was set as link this : session[:share] = "bid"
[07:47:35] juanpaucar: has joined #RubyOnRails
[07:47:43] errakeshpd: like this session[:share] = "bid"
[07:48:00] rvanlieshout: when was it set?
[07:48:22] choke: has joined #RubyOnRails
[07:49:32] juanpauc_: has joined #RubyOnRails
[07:49:55] Cervajz: has joined #RubyOnRails
[07:50:12] errakeshpd: when navigate to an "share action"
[07:51:21] Cervajz_: has joined #RubyOnRails
[07:51:27] juanpauc_: has joined #RubyOnRails
[07:52:19] tuelz: has joined #RubyOnRails
[07:53:23] mnms_: I created a simple app with sunspot gem. I have model question with searchable block with text :content inside. When I add new question in SOLR database only id and version fields for ducment are filled in (content field is not saved ?)
[07:53:24] juanpaucar: has joined #RubyOnRails
[07:53:29] errakeshpd: @<rvanlieshout> https://gist.github.com/errakeshpd/d2a41bbb394e51620ad4
[07:54:04] mnms_: Someone has experience with sunspot ?
[07:54:15] rvanlieshout: and you're sure that share method is triggered somewhere before?
[07:54:33] sevenseacat: mnms_: yes. can you gist your model?
[07:55:08] mnms_: sevenseacat: sure, doing it...
[07:55:22] juanpauc_: has joined #RubyOnRails
[07:56:09] maz-dev: has joined #RubyOnRails
[07:56:29] artto: has joined #RubyOnRails
[07:56:29] towski_: has joined #RubyOnRails
[07:56:34] mnms_: sevenseacat: https://gist.github.com/anonymous/91ef9778a8d23da59d9a
[07:57:01] sevenseacat: mnms_: and what happens when you index a question? what solr request gets made
[07:57:12] certainty: has joined #RubyOnRails
[07:57:27] juanpaucar: has joined #RubyOnRails
[07:58:15] mnms_: update without parameters
[07:58:25] mnms_: I will make a gist
[07:58:34] mikecmpbll: has joined #RubyOnRails
[07:59:01] certainty: sevenseacat: what's the current state of the art gem for authorization with roles in rails?
[07:59:14] mnms_: sevenseacat: https://gist.github.com/anonymous/fd92bec92caeed94e482
[07:59:15] sevenseacat: certainty: I would use pundit.
[07:59:20] juanpauc_: has joined #RubyOnRails
[07:59:33] certainty: sevenseacat: thanks a bunch. Greetings to the wonderful down under :)
[08:00:01] sevenseacat: mnms_: ah you're using one of those versions of sunspot that doesnt actually show you the output -_-
[08:00:30] sevenseacat: mnms_: what makes you think the content isnt getting saved?
[08:00:47] devdazed: has joined #RubyOnRails
[08:00:52] mnms_: I check it in solr admin panel
[08:00:59] mnms_: sevenseacat: query section
[08:01:00] Sylario: has joined #RubyOnRails
[08:01:22] juanpaucar: has joined #RubyOnRails
[08:01:26] mnms_: sevenseacat: I can show you a results of making a query
[08:01:49] sevenseacat: mnms_: so if you opened up a rails console, did something like Question.search do fulltext "lalala" end; you get nothing?
[08:01:49] mnms_: sevenseacat: Maybe I dont understand whole concept, I dont know... :P
[08:02:09] sevenseacat: yeah i find the solr admin panel stupid to interact with
[08:02:12] charliesome: has joined #RubyOnRails
[08:03:24] juanpaucar: has joined #RubyOnRails
[08:03:55] mnms_: I was using SOLR without problem but nu in rails project, here I dont understand everything :P
[08:04:20] mnms_: sevenseacat: I get nothing doing this search
[08:04:38] mnms_: sevenseacat: records should be saved in sqlite and SOLR database ?
[08:04:53] sevenseacat: they need to be in both, yes
[08:05:07] jsrn_: has joined #RubyOnRails
[08:05:23] juanpaucar: has joined #RubyOnRails
[08:05:41] mnms_: sevenseacat: I couldnt find anywhere information about that...
[08:05:58] sevenseacat: well sunspot will return you ActiveRecord objects
[08:06:12] sevenseacat: if the records don't exist in your database, you cant get AR objects back can you
[08:06:37] alexhartley: has joined #RubyOnRails
[08:06:53] sevenseacat: setting up a test app now
[08:06:56] mnms_: sevenseacat: in sql db you mean ?
[08:07:06] mnms_: if they dont exist ?
[08:07:08] sevenseacat: you only have one database, dont you?
[08:07:25] juanpauc_: has joined #RubyOnRails
[08:07:28] mnms_: sevenseacat: I made new rails app with sqlite db
[08:07:36] sevenseacat: so thats your database.
[08:08:37] krz: has joined #RubyOnRails
[08:09:18] bronson: has joined #RubyOnRails
[08:09:21] juanpaucar: has joined #RubyOnRails
[08:10:04] mnms_: yes but lucene index is the second one, I store there information too..
[08:10:07] sevenseacat: https://gist.github.com/sevenseacat/29e1d8f23e1f3879f389
[08:10:11] sevenseacat: thats not a database
[08:10:23] errakeshpd: <rvanlieshout> Yes,
[08:10:35] sevenseacat: mnms_: check that link to see how it works
[08:11:07] mnms_: Im looking
[08:11:22] mnms_: aaa can you check what you have in admin panel when you make a query for all ?
[08:11:29] juanpauc_: has joined #RubyOnRails
[08:11:34] sevenseacat: probably not. i dont know the obscure lucene syntax.
[08:11:45] curses: has joined #RubyOnRails
[08:11:45] annlewis: has joined #RubyOnRails
[08:11:49] doerteDev: has joined #RubyOnRails
[08:11:53] sevenseacat: but let me see if i can copy the one from the rails console
[08:12:20] mnms_: sevenseacat: you would just have to open http://127.0.0.1:8982/solr/ select development from dropdown
[08:12:34] sevenseacat: yeah I've gotten that far :P gimme a sec
[08:12:49] mnms_: sevenseacat: click the query link on the menu on the left and press the button "Execute query" :P
[08:13:19] sevenseacat: yeah I've never been able to make this panel query properly
[08:13:22] sevenseacat: and I still can't
[08:13:24] juanpaucar: has joined #RubyOnRails
[08:14:14] mnms_: sevenseacat: you didnt change anything ? just click execute query, this is default setup to grab everything from database - first 10 records :)
[08:14:23] sevenseacat: didnt change anything. no results.
[08:14:50] sevenseacat: theyre in the default core, not the development core
[08:14:59] NivenHuH: has joined #RubyOnRails
[08:15:21] juanpaucar: has joined #RubyOnRails
[08:15:23] mnms_: what you got there ?
[08:16:21] Zelic: has joined #RubyOnRails
[08:16:30] sevenseacat: so, happy that it all works now? :)
[08:17:19] juanpaucar: has joined #RubyOnRails
[08:17:37] mnms_: It works like that before, I was not sure if it should be saved in sql also
[08:17:56] mnms_: so you told me that :P
[08:18:29] sevenseacat: well you typed Question.create, which saves the question record to your database
[08:18:40] sevenseacat: its sunspot that also indexes it with solr
[08:19:15] mnms_: In previous project I was storing logs in solr database, I didnt need save it also to sql db
[08:19:17] juanpauc_: has joined #RubyOnRails
[08:19:33] mnms_: I guess I didnt understand whole concept
[08:19:38] sevenseacat: then you werent using sunspoit
[08:19:43] mnms_: with full text search
[08:19:53] mnms_: yes it was .net project
[08:19:58] sevenseacat: the sunspot readme might be a good place to start
[08:20:45] mnms_: sevenseacat: I read it, Im sure and there is not explicit info about that :)
[08:21:00] sevenseacat: it does presume that you know how rails works.
[08:21:01] jas02: has joined #RubyOnRails
[08:21:02] Ergo: has joined #RubyOnRails
[08:21:11] charliesome: has joined #RubyOnRails
[08:21:18] juanpaucar: has joined #RubyOnRails
[08:21:29] mnms_: Acha but I didnt know if it was intended, I was just not sure
[08:21:42] mnms_: But now I know thx
[08:22:10] sevenseacat: well its kinda hard to use a rails library without knowing how to use rails
[08:23:16] juanpauc_: has joined #RubyOnRails
[08:24:10] mnms_: What has to do knowing rails, to not understand concept ? ;)
[08:24:42] sevenseacat: I'm not sure how to answer that without insulting you, so I won't.
[08:24:44] universa1: you need to know which concepts to know...
[08:25:19] juanpaucar: has joined #RubyOnRails
[08:25:39] mnms_: thanks for clarification
[08:25:57] universa1: if something is just a blackbox to you, it is really hard to understand something ;)
[08:26:12] workmad3: has joined #RubyOnRails
[08:26:21] marr: has joined #RubyOnRails
[08:26:57] mnms_: universa1: the point is that SOLR is fulltext search index and I didnt understand why records has to be saved in db. Ok Im doing Model.create I get it
[08:27:23] mnms_: but I could be done without saving to db
[08:27:24] juanpauc_: has joined #RubyOnRails
[08:27:28] hadees: has joined #RubyOnRails
[08:28:14] bePolite: has joined #RubyOnRails
[08:29:30] juanpaucar: has joined #RubyOnRails
[08:31:12] htmldrum: has joined #RubyOnRails
[08:31:24] juanpaucar: has joined #RubyOnRails
[08:32:22] finges_: has joined #RubyOnRails
[08:33:25] juanpauc_: has joined #RubyOnRails
[08:35:27] juanpaucar: has joined #RubyOnRails
[08:35:35] puppeh: `config.assets.js_compressor` and css_compressor should *not* be set in development, right?
[08:35:43] puppeh: they're only for production?
[08:36:59] artto: has joined #RubyOnRails
[08:37:24] juanpauc_: has joined #RubyOnRails
[08:38:01] universa1: puppeh: you can change them in development, but the default value makes sense in development mode imho
[08:38:33] universa1: puppeh: the vlaue might be ignored anyways, since config.assets.compress_assets is false in dev-mode (or whatever the configuration variable is ;))
[08:39:27] juanpauc_: has joined #RubyOnRails
[08:40:03] iateadonut: how do i do a query if(params[:foo].present?) where(['tbl.col = ?', params[:foo]]) ?
[08:41:09] jenrzzz: has joined #RubyOnRails
[08:41:23] juanpaucar: has joined #RubyOnRails
[08:42:30] zpe: has joined #RubyOnRails
[08:43:13] elepedus: has joined #RubyOnRails
[08:43:24] juanpauc_: has joined #RubyOnRails
[08:44:09] livathinos: has joined #RubyOnRails
[08:45:29] juanpaucar: has joined #RubyOnRails
[08:47:27] juanpauc_: has joined #RubyOnRails
[08:47:33] artto: has joined #RubyOnRails
[08:48:04] sdwrage: has joined #RubyOnRails
[08:49:23] juanpauc_: has joined #RubyOnRails
[08:50:18] iateadonut: i've got as far as this, but i really need .present? - if the post value == '', then i don't want it to execute either:
[08:50:18] iateadonut: where(['vehicles.make = ?', params[:make]]) if params[:make]
[08:50:46] nesumrobot: has joined #RubyOnRails
[08:51:19] juanpaucar: has joined #RubyOnRails
[08:52:09] noodman: has joined #RubyOnRails
[08:53:14] juanpauc_: has joined #RubyOnRails
[08:55:10] alexhart_: has joined #RubyOnRails
[08:55:12] juanpauc_: has joined #RubyOnRails
[08:55:12] michael_mbp: has joined #RubyOnRails
[08:55:17] jensljungblad: has joined #RubyOnRails
[08:55:18] rvanlieshout: value.presence || ...
[08:55:33] rvanlieshout: could you gist your stuff?
[08:55:43] rvanlieshout: you could use .where!(..) if params[:..].presence
[08:56:06] rvanlieshout: didn't read back enough, but @foo = Foo.where(..) and such \n
[08:56:12] rvanlieshout: @foo.where!(..) if params[:..]
[08:56:36] Cervajz: has joined #RubyOnRails
[08:57:12] juanpaucar: has joined #RubyOnRails
[08:57:23] Cervajz_: has joined #RubyOnRails
[08:57:29] arup_r: has joined #RubyOnRails
[08:57:39] iateadonut: it didn't like if params[:..].presence
[08:58:57] rvanlieshout: iateadonut: could you gist your code?
[08:59:00] iateadonut: but it gives an error that a form is missing
[08:59:13] juanpauc_: has joined #RubyOnRails
[08:59:14] iateadonut: where's gist?
[08:59:17] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[09:00:39] iateadonut: https://gist.github.com/iateadonut/879ec688dafd8ecf3bfb
[09:00:48] noodman: has joined #RubyOnRails
[09:00:58] bronson: has joined #RubyOnRails
[09:01:15] juanpaucar: has joined #RubyOnRails
[09:01:21] iateadonut: when the last line is where(['vehicles.make = ?', params[:make]]) if params[:make] - it kind of works, except that if make=='' then it uses it
[09:01:26] Linuus: has joined #RubyOnRails
[09:03:17] juanpaucar: has joined #RubyOnRails
[09:03:39] suchness: has joined #RubyOnRails
[09:04:19] tsvenson: has joined #RubyOnRails
[09:05:11] juanpaucar: has joined #RubyOnRails
[09:05:31] rvanlieshout: in place replacement
[09:05:37] rvanlieshout: same as customers = customers.where(...)
[09:05:52] rvanlieshout: puts a => "hi"
[09:06:00] rvanlieshout: puts a => "HI"
[09:06:06] rvanlieshout: puts a => "HI"
[09:07:11] juanpaucar: has joined #RubyOnRails
[09:07:52] iateadonut: only when you said 'same as customers = customers...'
[09:08:04] rvanlieshout: that's ok. and that a = part?
[09:08:18] rvanlieshout: that's the same. there are quite some methods that have a ! variant for in place replacement
[09:08:45] iateadonut: (i thought the two were both the same example at first)
[09:08:55] Motoservo: has joined #RubyOnRails
[09:09:12] juanpaucar: has joined #RubyOnRails
[09:09:37] charliesome: has joined #RubyOnRails
[09:09:51] Ergo: has joined #RubyOnRails
[09:10:05] scottmatheina: has joined #RubyOnRails
[09:11:12] roolo: has joined #RubyOnRails
[09:11:16] juanpaucar: has joined #RubyOnRails
[09:12:33] annlewis: has joined #RubyOnRails
[09:13:16] juanpauc_: has joined #RubyOnRails
[09:14:59] charliesome: has joined #RubyOnRails
[09:15:14] juanpaucar: has joined #RubyOnRails
[09:16:12] srinidhi1: has joined #RubyOnRails
[09:16:32] srinidhi: has joined #RubyOnRails
[09:16:44] srinidhi: has joined #RubyOnRails
[09:17:19] juanpaucar: has joined #RubyOnRails
[09:18:53] lucha: has joined #RubyOnRails
[09:19:10] juanpauc_: has joined #RubyOnRails
[09:21:06] Linuus: has joined #RubyOnRails
[09:21:11] julienk: has joined #RubyOnRails
[09:21:14] juanpauc_: has joined #RubyOnRails
[09:21:37] charliesome: has joined #RubyOnRails
[09:23:15] htmldrum: has joined #RubyOnRails
[09:23:21] juanpaucar: has joined #RubyOnRails
[09:24:24] crdpink2: has joined #RubyOnRails
[09:24:34] blnkammo_: has joined #RubyOnRails
[09:25:20] juanpauc_: has joined #RubyOnRails
[09:25:35] mutuma: has joined #RubyOnRails
[09:26:41] nettoweb: has joined #RubyOnRails
[09:27:20] juanpaucar: has joined #RubyOnRails
[09:27:26] ledestin: has joined #RubyOnRails
[09:28:54] rubyonrails041: has joined #RubyOnRails
[09:29:11] puppeh: does anobody knows what files the asset pipeline gzips by default?
[09:29:15] puppeh: is it only CSS and JS?
[09:29:16] juanpaucar: has joined #RubyOnRails
[09:30:20] lucha: has joined #RubyOnRails
[09:31:22] juanpauc_: has joined #RubyOnRails
[09:32:38] elepedus: has joined #RubyOnRails
[09:33:54] blackhuey: has joined #RubyOnRails
[09:34:55] arup_r: has joined #RubyOnRails
[09:35:24] stardiviner: has joined #RubyOnRails
[09:35:46] Node_928: has joined #RubyOnRails
[09:36:00] arup_r1: has joined #RubyOnRails
[09:36:33] arup_r1: has joined #RubyOnRails
[09:36:49] srinidhi: has joined #RubyOnRails
[09:39:21] nettoweb: hello guys, how I create a system that when you reply an email it send a POST to some URL of my app and I can create a ticket in my Rails app? Is there any gem to help me with that or some article helping undertanding the whole thing?
[09:39:37] arup_r1: has joined #RubyOnRails
[09:39:41] hmsimha_: has joined #RubyOnRails
[09:40:11] krz: has joined #RubyOnRails
[09:41:42] arup_r: has joined #RubyOnRails
[09:42:07] rails663: has joined #RubyOnRails
[09:43:30] arup_r: I have two model Account and Judge they have N X N relationship thought: account_event. Now my problem is I am not able to understand how should I stop duplicate record addition.. Better idea is please.. Should I use scoped validation or anything better you know ?
[09:43:39] arup_r: https://gist.github.com/aruprakshit/45e47cc22db081c017c3
[09:43:53] Motoservo: has joined #RubyOnRails
[09:43:56] arup_r: See there dup records are getting added as there is no check for now
[09:44:21] nfk: has joined #RubyOnRails
[09:45:04] Karpah: has joined #RubyOnRails
[09:45:44] rvanlieshout: arup_r: what kind of relationship is defined?
[09:46:04] arup_r: has_many though
[09:46:19] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[09:46:28] DEA7TH: has joined #RubyOnRails
[09:46:39] arup_r: I thought my lines will be enough.. anyway putting
[09:48:03] nya: has joined #RubyOnRails
[09:48:19] arup_r: rvanlieshout: https://gist.github.com/aruprakshit/45e47cc22db081c017c3
[09:48:47] rvanlieshout: add validations on AccountJudge
[09:48:55] rvanlieshout: presence and uniqueness
[09:50:00] rvanlieshout: or, if there is nothing in that relationship switch to has_and_belongs_to_many
[09:50:05] rvanlieshout: remove the id column
[09:50:31] rvanlieshout: and are you sure you want to remove judges if one removes an account? or only the account judges?
[09:50:39] lucha: has joined #RubyOnRails
[09:51:03] arup_r: rvanlieshout: Yes I thought about validations. With validation it wouldn't allow to save. I was thinking if I can omit the records which are present and add which are new,.. something like that
[09:51:24] rvanlieshout: that's not what << implies
[09:51:32] choke: has joined #RubyOnRails
[09:52:05] arup_r: yes account is destroy means .. the thoguh: table should also remove the corresponding connections.. that's why dependent: :destroy.. this is fine
[09:52:07] loveablelobster: has joined #RubyOnRails
[09:52:11] loveablelobster: has left #RubyOnRails: ()
[09:52:24] arup_r: rvanlieshout: yes << will not check that,
[09:52:25] rvanlieshout: corresponding connections is not where you have your dependent destroy now
[09:52:50] puppeh: any ideas why after upgrading to rails 4, asset pipeline does not gzip all the assets?
[09:52:53] puppeh: but only some?
[09:53:03] tuelz: has joined #RubyOnRails
[09:53:04] arup_r: rvanlieshout: wrong place it is..
[09:53:08] rodfersou: has joined #RubyOnRails
[09:53:16] arup_r: Humm you are right..
[09:53:41] livathinos: has joined #RubyOnRails
[09:54:02] maz-dev_: has joined #RubyOnRails
[09:54:49] arup_r: Nah I checked dependent: :destroy is ok..
[09:55:01] arup_r: anyway.. so the validations are the way to stop only here..
[09:55:33] arup_r: I kinda thought of some skipping which are present and add which are new.. without stopping request
[09:57:02] arup_r: thing is has_many don't have a direct method like find_or_create
[09:57:13] arup_r: otherwise I would be done..
[09:59:23] rubyonrails719: has joined #RubyOnRails
[09:59:28] charliesome: has joined #RubyOnRails
[09:59:46] rvanlieshout: and why not has_and_belongs_to_many?
[10:00:24] arup_r: rvanlieshout: they have plan to add some fields in the table
[10:00:26] rubyonrails719: Hi! I made a custom scaffold view to generate. How do I change the path where it gets generated?
[10:00:30] arup_r: that is why
[10:00:50] scottmatheina: has joined #RubyOnRails
[10:07:18] kitsuneyo: has joined #RubyOnRails
[10:08:37] elepedus: has joined #RubyOnRails
[10:08:57] kitsuneyo: is there a super easy way to use bootstrap modal for data confirmations? instead of the standard box. i found this: https://gist.github.com/postpostmodern/1862479
[10:10:58] Ufinii: has joined #RubyOnRails
[10:11:17] alexhartley: has joined #RubyOnRails
[10:13:13] annlewis: has joined #RubyOnRails
[10:13:58] kies: has joined #RubyOnRails
[10:15:48] m1lt0n: has joined #RubyOnRails
[10:18:24] bruno-: has joined #RubyOnRails
[10:18:53] northfurr: has joined #RubyOnRails
[10:20:25] rickmasta: has joined #RubyOnRails
[10:22:58] allcentu1: has joined #RubyOnRails
[10:26:44] kitsuneyo: has joined #RubyOnRails
[10:28:52] RailsRiders: has joined #RubyOnRails
[10:29:24] nya: has joined #RubyOnRails
[10:30:14] EminenceHC: has joined #RubyOnRails
[10:30:17] jellyjellyrobot: has joined #RubyOnRails
[10:30:29] RailsRiders: Hi, pls, how can I have a dropdown: <%= collection_select(:@listing, :country_id, Country.order(:name), :id, :name, { :prompt => true }, { :class => 'awe-select', :id => 'countries' }) %>
[10:30:47] RailsRiders: in the Listing model I have attr_accessor :country_id
[10:30:55] RailsRiders: how can I read it from params?
[10:31:55] Ergo^: has joined #RubyOnRails
[10:32:22] ledestin: has joined #RubyOnRails
[10:32:27] rvanlieshout: it uses the value on @listing
[10:32:35] rvanlieshout: use collection_select(@listing, ...), not:@listing
[10:34:21] RailsRiders: aha, I see. stupid typo. but I'm rookie, so I don't see consequences. Thanks!
[10:34:34] CMOTD: has joined #RubyOnRails
[10:34:35] rvanlieshout: i actually don't know if there is a big consequence in this case
[10:34:57] tfitts: has joined #RubyOnRails
[10:35:48] chouhoul_: has joined #RubyOnRails
[10:36:31] RailsRiders: the big consequence is that it is not working. and as a rookie it's harder for me to find it, when I don't get all corellations yet. thanks man
[10:36:53] rvanlieshout: then the difference is that you're now using the actual object in @listing
[10:37:06] rvanlieshout: not a symbol (which in many ways is just a string)
[10:37:18] jensljungblad: has joined #RubyOnRails
[10:41:13] nya: has joined #RubyOnRails
[10:41:49] nya: has joined #RubyOnRails
[10:46:05] doodlehaus: has joined #RubyOnRails
[10:46:18] renegadeandy: has joined #RubyOnRails
[10:46:32] renegadeandy: Why would this alert notice not be being displayed on my redirect call : redirect_to controller:"listings", action:"index", id: current_user.id, alert: 'Please add a Stripe account before creating a listing! This lets you accept payments for your listing. Press the stripe connect button at the bottom of this page.'
[10:47:06] sevenseacat: renegadeandy: not enough info to say
[10:47:07] arup_r: getting error as ActiveRecord::AssociationTypeMismatch: Judge(#70288735116180) expected, got Judge(#70288657328580) What does it mean ? https://gist.github.com/aruprakshit/d1662729df043243bcae
[10:47:22] renegadeandy: Ok so there is nothing syntactically wrong about that line
[10:47:41] frzn: has joined #RubyOnRails
[10:47:52] sevenseacat: you'd get an error if there was.
[10:51:10] Norrin: has joined #RubyOnRails
[10:51:26] arup_r: seems like a bug! :D
[10:52:08] arup_r: all is f9 now
[10:52:19] rvanlieshout: renegadeandy: arup_r you created self.create_relationship_with_judges current_account, judges
[10:52:25] rvanlieshout: which expects a collection of judges
[10:52:30] rvanlieshout: where you only pass in one
[10:52:42] rvanlieshout: it's an array
[10:53:11] arup_r: rvanlieshout: yes.. thing is I forgot to `reload` my console .. so it was taking my old method body :)
[10:53:26] arup_r: I did `reload` and worked as expected
[10:53:35] renegadeandy: sevenseacat: Ok - here is a bit more detail : https://gist.github.com/renegadeandy/0bfbfd62ca82d22c6462
[10:53:37] stamina: has joined #RubyOnRails
[10:53:39] arup_r: rvanlieshout: that's how now I came up with :)
[10:54:07] arup_r: I used find_or_cretate_by in the through model to add new record and skip old record
[10:54:12] arup_r: no validations for now
[10:54:22] sevenseacat: renegadeandy: ah there we go - your use of the weird routing syntax has confused Rails
[10:54:27] RailsRiders: But still I have in params this:
[10:54:28] artto: has joined #RubyOnRails
[10:54:29] RailsRiders: pry(#<ListingsController>)> params => {"utf8"=>"???", "authenticity_token"=>"bbgvSItMv/MucSsltkrtZRzW4NiplGOcZoAQLaSyfPdYaFrC22hFScQAgKXbF7tTuR4y0Kxr62X5NIEOZbHTCg==", "#<Listing:0x007fa669293210>"=>{"country_id"=>"52"}, "listing"=>{"destination_name"=>"Mikulov", "description"=>"asgherhzer", "fee"=>"pivo"}, "controller"=>"listings", "action"=>"create"}
[10:54:42] sevenseacat: either wrap the route-specific parts in a hash {}, or use the named route instead
[10:54:52] RailsRiders: which means it is not accessible via params[:listing][:country_id]
[10:55:18] renegadeandy: if i use the named route, it fails with an error saying it needs the :id, and if i specify it, it still doesnt pick it up?
[10:55:57] renegadeandy: sevenseacat: https://gist.github.com/renegadeandy/ae882f04f8b7c75b4b35
[10:56:06] erich: has joined #RubyOnRails
[10:56:12] sevenseacat: you're not passing the param to the named route
[10:56:13] nya: has joined #RubyOnRails
[10:56:13] renegadeandy: missing required keys :id
[10:56:22] sevenseacat: listings_index_path(current_user)
[10:56:36] renegadeandy: oh! I forgot it would be as simple as that
[10:56:37] sevenseacat: though index in the named route suggests that your routing is incorrect
[10:56:47] nya: has joined #RubyOnRails
[10:57:33] renegadeandy: sevenseacat: its working - thank you very much, far prefer the named routes
[10:57:43] sevenseacat: renegadeandy: i'd look at fixing the routes.
[10:57:46] renegadeandy: i tried it first but couldnt work out how to solve the error
[10:57:51] renegadeandy: the route in this case was :
[10:58:00] renegadeandy: sevenseacat: get 'listings/:id', to: 'listings#index', as: "listings_index"
[10:58:14] sevenseacat: yeah thats just weird o.O
[10:58:21] nya: has joined #RubyOnRails
[10:58:26] renegadeandy: sevenseacat: what would you do?
[10:58:43] sevenseacat: that URL should be for showing a particular listing
[10:58:59] renegadeandy: sevenseacat: oh i see what you are saying, yeah I agree
[10:59:04] sevenseacat: I'd have URLs like /user/:id/listings
[10:59:05] nya: has joined #RubyOnRails
[10:59:08] renegadeandy: sevenseacat: the naming is all buggered up
[10:59:08] jensljungblad: has joined #RubyOnRails
[10:59:16] renegadeandy: thats much nicer!
[10:59:17] roolo: has joined #RubyOnRails
[10:59:27] sevenseacat: which if you had resources :users do resources :listings end end, would give you user_listings_path(current_user)
[10:59:51] kitsuneyo: has joined #RubyOnRails
[10:59:57] renegadeandy: sevenseacat: thank you - ill look into this!
[11:00:09] nettoweb: guys, I update a file in lib directory and run 'touch tmp/restart.txt' to restart my app mbut this file still doesnt took effect
[11:01:16] renegadeandy: sevenseacat: ive made a quick fix : get 'users/:id/listings', to: 'listings#index', as: "listings_index" until i understand whats going on with the resources - which i really don't use
[11:01:22] dhjondoh: has joined #RubyOnRails
[11:01:36] sevenseacat: renegadeandy: you should, they're very useful :)
[11:02:29] czerasz: has joined #RubyOnRails
[11:02:41] bronson: has joined #RubyOnRails
[11:03:50] rails663: I have A->(has many)->B->(has many)->C relationship. What would be rails query to get all C from A?
[11:04:29] ledestin: does Capybara run a web server when running non-js tests?
[11:04:46] sevenseacat: yes, it has to.
[11:06:25] MartinElvar: has joined #RubyOnRails
[11:07:59] ledestin: sevenseacat trying to get host/port it runs on. Capybara.current_session.server.host doesn't work for me
[11:08:42] sevenseacat: "doesnt work" is not an error message i can help with
[11:08:48] tuelz: has joined #RubyOnRails
[11:10:06] ledestin: sevenseacat undefined method `host' for nil:NilClass. probably need to run server
[11:10:30] sevenseacat: ACTION shrugs
[11:10:34] bruno-: has joined #RubyOnRails
[11:11:53] kitsuneyo: has joined #RubyOnRails
[11:12:03] marr: has joined #RubyOnRails
[11:13:59] annlewis: has joined #RubyOnRails
[11:15:07] NBarnes: has joined #RubyOnRails
[11:18:41] swept: has joined #RubyOnRails
[11:21:30] rodfersou: has joined #RubyOnRails
[11:21:31] Macaveli: has joined #RubyOnRails
[11:23:08] rodfersou: has joined #RubyOnRails
[11:26:41] darrencauthon: has joined #RubyOnRails
[11:28:30] mostlybadfly: has joined #RubyOnRails
[11:37:55] banister: has joined #RubyOnRails
[11:38:05] mutuma: has joined #RubyOnRails
[11:40:56] arup_r: why do people shrugs ?
[11:43:56] ldnunes: has joined #RubyOnRails
[11:45:34] fast_scooter: has joined #RubyOnRails
[11:47:29] totimkopf: has joined #RubyOnRails
[11:48:20] bogn1: has joined #RubyOnRails
[11:50:11] Linuus: has joined #RubyOnRails
[11:50:38] DylanJ: ACTION shrugs
[11:50:53] sevenseacat: I was hoping someone would do that. :D
[11:52:54] hardtail: good morning
[11:54:39] bogn: has joined #RubyOnRails
[11:54:46] workmad3: has joined #RubyOnRails
[11:54:50] bogn: Hi all, I want to consume a Twitter Stream in a Rails project. Would you advise to use ActiveQueue for that or is it really only for periodic jobs?
[11:55:22] maz-dev_: has joined #RubyOnRails
[11:55:37] user1138: has joined #RubyOnRails
[11:55:52] bogn: I was actually asking about ActiveJob
[12:01:32] zpe_: has joined #RubyOnRails
[12:02:18] wldcordeiro_: has joined #RubyOnRails
[12:05:10] maz-dev_: has joined #RubyOnRails
[12:05:25] totimkopf: sevenseacat: manning still taking their sweet time? :D
[12:06:43] totimkopf: those slackers.
[12:08:17] totimkopf: I have enjoyed R4IA. Learned tons. I also liked Hartl's book but I noticed he dropped RSpec in his newest edition :S
[12:11:14] sevenseacat: I'm glad it's helped you :)
[12:13:06] darrenca_: has joined #RubyOnRails
[12:13:16] rrawlins: has joined #RubyOnRails
[12:14:44] annlewis: has joined #RubyOnRails
[12:15:48] poli: has joined #RubyOnRails
[12:16:00] Cervajz: has joined #RubyOnRails
[12:19:04] zpe: has joined #RubyOnRails
[12:19:10] scottmatheina: has joined #RubyOnRails
[12:21:10] northfurr: has joined #RubyOnRails
[12:21:28] Pazician: has joined #RubyOnRails
[12:21:28] Pazician: has joined #RubyOnRails
[12:22:44] nya: has joined #RubyOnRails
[12:22:48] bogn: and what about rails runner scripts have they been removed and if not, are they suitable for a Twitter streaming client? That is to be run infinitely.
[12:23:37] bogn: no they haven't been removed, but I'm doubtful that this is sufficient.
[12:24:09] kitsuneyo: has joined #RubyOnRails
[12:24:15] fast_scooter: has joined #RubyOnRails
[12:26:08] unver: has joined #RubyOnRails
[12:26:15] unver: has left #RubyOnRails: ()
[12:26:28] jeanlinux: has joined #RubyOnRails
[12:27:19] Gmi: has joined #RubyOnRails
[12:27:35] ustrajunior: has joined #RubyOnRails
[12:29:18] kanzure: has joined #RubyOnRails
[12:33:12] kitsuneyo: how's everyone doing?
[12:36:26] mrchris: has joined #RubyOnRails
[12:36:35] mrchris: Good morning
[12:36:47] nickenchuggets: has joined #RubyOnRails
[12:37:39] jensljungblad: has joined #RubyOnRails
[12:37:46] tuelz: has joined #RubyOnRails
[12:38:34] kitsuneyo: hi __chris and nickenchuggets
[12:40:07] rustymyers: has joined #RubyOnRails
[12:41:21] rickmasta: has joined #RubyOnRails
[12:44:11] pyemkey: has joined #RubyOnRails
[12:44:16] Ergo: has joined #RubyOnRails
[12:44:43] mrchris: Can someone take a look at this question for me? http://pastie.org/10366186
[12:45:15] mrchris: I'm trying to do a has_many, accepts_nested_attributes, ajax type of form
[12:45:24] spectra: has joined #RubyOnRails
[12:46:28] Mia: has joined #RubyOnRails
[12:47:09] wethu: has joined #RubyOnRails
[12:47:11] eoy: has joined #RubyOnRails
[12:47:25] roolo: has joined #RubyOnRails
[12:49:16] pyemkey: Hello, I would like to ask you for design help. I have standard User model, which have some rules to accept like: newsletter, insurance end date etc. Should it be store in the User table or better create new one. https://gist.github.com/pyemkey/c7a65e0655b5232a0f82 What do you think?
[12:49:16] yashinbasement: has joined #RubyOnRails
[12:49:35] bmurt: has joined #RubyOnRails
[12:49:54] pyemkey: How would you call name of the table
[12:50:08] kitsuneyo: __chris, if you use has_many through, you would have a table for the relationship which you could add a boolean field for favourite_child
[12:50:54] yashinbasement: has joined #RubyOnRails
[12:50:59] ramortegui: has joined #RubyOnRails
[12:51:37] mrchris: kitsuneyo, thanks. something to think about i guess
[12:52:09] Deck`: has joined #RubyOnRails
[12:53:14] amortimer: has joined #RubyOnRails
[12:53:16] suchness: pyemkey: Settings/Preferences
[12:55:32] jammanbo: has joined #RubyOnRails
[12:55:46] Ergo^: has joined #RubyOnRails
[12:56:25] jeanlinux: has joined #RubyOnRails
[12:57:01] jammanbo: How do you format a time of day, without date, day, etc., in the user's locale? e.g. "13:01" or "1.01pm".
[12:57:57] chouhoulis: has joined #RubyOnRails
[12:58:51] frzn: has joined #RubyOnRails
[12:59:42] mrchris: has joined #RubyOnRails
[13:00:07] MartinElvar: has joined #RubyOnRails
[13:00:34] chouhoulis: has joined #RubyOnRails
[13:01:05] MartinEl_: has joined #RubyOnRails
[13:01:16] centrx: has joined #RubyOnRails
[13:03:23] waseem_: jammanbo: You should check this out http://guides.rubyonrails.org/i18n.html#adding-date-time-formats. Ideally you should read the whole guide and implement localization/internationalization.
[13:03:33] frzng: has joined #RubyOnRails
[13:03:54] bronson: has joined #RubyOnRails
[13:04:46] jammanbo: waseem_: Thanks. Aware of it, but surely the necessary format locale-aware formats already exist, no?
[13:05:24] waseem_: jammanbo: I'm not sure if they do. But that's how I'll implement it. Even if it's just for formatting time.
[13:05:56] Macaveli: has joined #RubyOnRails
[13:06:14] drale2k: has joined #RubyOnRails
[13:06:54] waseem_: jammanbo: I'm assuming that you have users in more than one locale.
[13:07:00] paulcsmith: has joined #RubyOnRails
[13:07:10] yashinbasement: hey guys I am gonna have my first interview for web development job, any tips ?
[13:07:14] julienk: has joined #RubyOnRails
[13:08:36] scottmatheina: has joined #RubyOnRails
[13:09:15] d2dchat: has joined #RubyOnRails
[13:10:21] fwaokda: has joined #RubyOnRails
[13:10:52] northfurr: has joined #RubyOnRails
[13:11:32] curses: has joined #RubyOnRails
[13:12:42] fwaokda: when creating a "has_many" association. I need to specify my primary_key and foreign_key. When I create the belongs_to
[13:12:58] fwaokda: on the other model do I specify the same foreign key and primary key or do i reverse them?
[13:13:28] waseem_: fwaokda: The same.
[13:13:47] n1lo: has joined #RubyOnRails
[13:14:05] waseem_: fwaokda: I dont think you need to specify the primary key.
[13:14:13] j_mcnally: has joined #RubyOnRails
[13:14:39] fwaokda: waseem_: so the primary_key is specified as the key on the "has_many" table, and the foreign_key is specified as the key on the "belongs_to" table?
[13:14:42] Detch: has joined #RubyOnRails
[13:14:51] yashinbasement: don't try to do that
[13:15:05] yashinbasement: just create migration
[13:15:19] yashinbasement: and specify the relation in the models
[13:15:22] fwaokda: i have to specify my foreign key and primary key because the database is not created from my application im reading data from another database
[13:15:31] annlewis: has joined #RubyOnRails
[13:15:31] fwaokda: yashinbasement: ^^
[13:17:11] yashinbasement: then you might need to do that, although there are other ways to get around with it
[13:17:23] yashinbasement: yeah belongs to have foriegn key
[13:17:35] waseem_: fwaokda: foreign key is just one. So there should be no problem. The primary key specified should be the column of the table that is being referred to in belongs_to association.
[13:17:51] northfurr: anyone know how to disable syntastic errors that appear when importing gems into scss?
[13:17:53] fwaokda: waseem_: thanks!
[13:18:07] victortyau: has joined #RubyOnRails
[13:18:07] waseem_: fwaokda: Play around in console, it'll take a few trials to figure out.
[13:18:11] fwaokda: yashinbasement: what other ways?
[13:18:45] fwaokda: waseem_: yes currently doing that. I was able to get it to work at some point just didn't know exactly "why" it was working
[13:20:00] juanpaucar: has joined #RubyOnRails
[13:20:36] fwaokda: waseem_: just checking, but do i need to specify both foreign_key and primary_key on both models? or just foreign_key on "belongs_to" and primary_key on "has_many" or something similar that doesn't take both
[13:21:20] annlewis: has joined #RubyOnRails
[13:23:31] waseem_: fwaokda: If your primary key is something other than `id`, you'll have to specify it. If your `foreign_key` can not be guessed from the class of the associating model, you'll have to specify it.
[13:23:48] fwaokda: waseem_: ok thanks for all the help!
[13:24:19] waseem_: fwaokda: Sure, read the documentation of both methods. It'll be more clear. http://devdocs.io/rails/activerecord/associations/classmethods#method-i-has_many
[13:27:36] bruno-: has joined #RubyOnRails
[13:31:38] umgrosscol: has joined #RubyOnRails
[13:34:06] unreal_: has joined #RubyOnRails
[13:37:32] sdwrage: has joined #RubyOnRails
[13:38:31] Mia: has joined #RubyOnRails
[13:39:07] devdazed: has joined #RubyOnRails
[13:40:49] Grundell: has joined #RubyOnRails
[13:42:35] Mia: has joined #RubyOnRails
[13:42:35] Mia: has joined #RubyOnRails
[13:45:03] dopamean1: has joined #RubyOnRails
[13:46:25] doodlehaus: has joined #RubyOnRails
[13:48:05] jamiely: has joined #RubyOnRails
[13:49:41] devdazed: has joined #RubyOnRails
[13:50:16] jbrinkmusic: has joined #RubyOnRails
[13:50:56] Macaveli: has joined #RubyOnRails
[13:51:07] chadhs: has joined #RubyOnRails
[13:51:17] oflannabhra: has joined #RubyOnRails
[13:51:24] jensljungblad: has joined #RubyOnRails
[13:51:33] darrencauthon: has joined #RubyOnRails
[13:52:20] jbrinkmusic: hey, I'm a bit stuck on a problem with devise and roles... I added a new admin role and adding this line to my user model seems to give me some headaches: after_initialize :set_default_role, :if => new_record?
[13:52:26] darrencauthon: has joined #RubyOnRails
[13:52:39] Linuus: has joined #RubyOnRails
[13:53:12] jbrinkmusic: when trying to start my server I get an error saying "new_record?" is an undefined method
[13:54:48] greengriminal: has joined #RubyOnRails
[13:55:14] drale2k: has joined #RubyOnRails
[13:55:16] j_mcnally: has joined #RubyOnRails
[13:57:03] afrianska: has joined #RubyOnRails
[13:57:30] jtperreault: jbrinkmusic: perhaps you could move set_default_role to an after_create method, and skip the if statement
[13:57:52] jtperreault: jbrinkmusic: or before_create, whatever you need
[13:59:02] jhack: has joined #RubyOnRails
[13:59:48] [H]unt3r: has joined #RubyOnRails
[14:00:02] jbrinkmusic: jtperreault: before_create would sound more similar to me, if I understand correctly what's happening... then it will set the role before saving the entry to the database, right?
[14:02:34] jtperreault: jbrinkmusic: it would execute your set_default_role method before saving the object to the database
[14:03:36] jbrinkmusic: awesome, that's exactly what I want
[14:04:01] jtperreault: jbrinkmusic: you're welcome.
[14:04:06] dstarh: has joined #RubyOnRails
[14:04:34] bronson: has joined #RubyOnRails
[14:04:56] r0uder: has joined #RubyOnRails
[14:06:03] rouder: has joined #RubyOnRails
[14:06:31] mwlang: has joined #RubyOnRails
[14:09:47] r0uder7: has joined #RubyOnRails
[14:11:55] mwlang: For those of you paying attention to my question about IE from yesterday. It turns out to be the Compatibility View setting in IE 11 ??? which makes the assumption that if you???re accessing an internally hosted website, you must be running legacy apps that don???t comply to modern standards, therefore, IE 11 tries to be ???smart??? and downgrades your user experience to the ancient ways (i.e. render your fine design just like IE6 would
[14:11:56] mwlang: http://stackoverflow.com/questions/22269781/why-compatibility-mode-for-intranet-sites
[14:12:52] kitsuneyo: IE11? is that the one in windows 10?
[14:13:31] mwlang: kitsuneyo: its the newest one???I have it on my Win 7 from monthly security patches.
[14:13:45] Anonn: has joined #RubyOnRails
[14:13:45] Hates_: has joined #RubyOnRails
[14:13:46] mwlang: but yeah, it???s the one that comes with Win10
[14:13:50] Cache_Money: has joined #RubyOnRails
[14:13:56] lsone: has joined #RubyOnRails
[14:14:21] axl_: has joined #RubyOnRails
[14:14:28] kitsuneyo: mwlang, thinking for a sec... the win10 browser is called edge i think?
[14:15:03] mwlang: kitsuneyo: I???m actually not really sure???I tend to stay out of Microsoft???s hair as much as possible. ;-)
[14:15:20] nya: has joined #RubyOnRails
[14:16:30] RouderX: has joined #RubyOnRails
[14:16:51] sinkensabe: has joined #RubyOnRails
[14:17:12] mwlang: kitsuneyo: but I do vaguely recall that Microsoft decided to totally rewrite IE???s core rendering engine and rather than throw the baby out with the bathwater, they bundled the old rendering engine into the new browser, too.
[14:17:29] zpe: has joined #RubyOnRails
[14:19:22] kitsuneyo: mwlang, that makes sense, they like everything to be BC even if it damages the new features
[14:19:36] camilasan: has joined #RubyOnRails
[14:19:43] workmad3: has joined #RubyOnRails
[14:20:18] prestorium: has joined #RubyOnRails
[14:20:26] JoshL: has joined #RubyOnRails
[14:20:47] mwlang: so, long story short: Add <meta http-equiv="X-UA-Compatible" content="IE=9,10,11??? ></meta> as the very first <HEAD> tag if you don???t want to get bitten by this ???feature??? in IE11
[14:21:19] TomyLobo: has joined #RubyOnRails
[14:21:39] mwlang: it???s just one-more-thing-to-remember-nothing-more-nothing-less(tm)
[14:22:06] IrishGringo: has joined #RubyOnRails
[14:22:34] rubyonrails255: has joined #RubyOnRails
[14:22:51] Dbugger: has joined #RubyOnRails
[14:22:56] Dbugger: Hello "everyone" :)
[14:23:03] Dbugger: I hope I did it right this time...
[14:23:37] Dbugger: Does anyone know how can I get the default value of a Model's attribute?
[14:24:11] doodlehaus: has joined #RubyOnRails
[14:24:25] riotjones: has joined #RubyOnRails
[14:26:18] allcentury: has joined #RubyOnRails
[14:26:29] broman: has joined #RubyOnRails
[14:26:52] broman: I'm migrating my rails app.. when i access the page, it shows me a blank screen.. how can i debug this??
[14:27:06] r0uder: has joined #RubyOnRails
[14:27:09] j_mcnally: has joined #RubyOnRails
[14:27:25] centrx: dbugger, Usually that would be in the database
[14:27:48] kitsuneyo: dbugger, printed in a view or in a select?
[14:28:11] r0uder: can you see it?
[14:28:14] jhack: has joined #RubyOnRails
[14:28:14] jhack: has joined #RubyOnRails
[14:29:39] hotpancakes: has joined #RubyOnRails
[14:29:56] centrx: r0uder, test failed
[14:30:04] FCser: has joined #RubyOnRails
[14:31:44] sandstrom: has joined #RubyOnRails
[14:32:09] Macaveli: has joined #RubyOnRails
[14:32:29] hotpancakes: Anyone know where I can get a complete list of all default validators? I checked the api docs and it gives a bunch of examples, but no complete list.
[14:35:02] ngscheurich: has joined #RubyOnRails
[14:35:10] jzig: has joined #RubyOnRails
[14:35:35] roolo: has joined #RubyOnRails
[14:36:37] srinidhi: has joined #RubyOnRails
[14:36:44] dopie: has joined #RubyOnRails
[14:36:50] RegulationD: has joined #RubyOnRails
[14:40:57] DelDotB: has joined #RubyOnRails
[14:41:18] pyemkey: I need your help. I am trying to write raw ajax request to update attribute, but I'm getting error unexpected_token. What's wrong with my request https://gist.github.com/pyemkey/07e30dd2ec287f8bee34
[14:41:21] mwlang: hotpancakes: http://guides.rubyonrails.org/active_record_validations.html
[14:41:56] axl_: has joined #RubyOnRails
[14:42:07] fmcgeough: has joined #RubyOnRails
[14:43:19] hotpancakes: mwlang: d'oh..straight in the guides. not sure how I missed that...thanks!
[14:43:38] Detch: has joined #RubyOnRails
[14:43:49] Lightsword: has joined #RubyOnRails
[14:44:16] mwlang: hotpancakes: the guides are too pretty, hence distracting. :-)
[14:44:22] kies^: has joined #RubyOnRails
[14:45:02] ckinniburgh: has joined #RubyOnRails
[14:45:38] hotpancakes: mwlang: Yup. I'm beginning to realize how great the guides actually are.
[14:46:13] bustrarm: has joined #RubyOnRails
[14:46:52] mrchris: is it possible to prevent the form builder from creating new (empty) fields when dealing with a has_many association?
[14:47:02] NBarnes: has joined #RubyOnRails
[14:47:22] nya: has joined #RubyOnRails
[14:47:23] asheinfeld: has joined #RubyOnRails
[14:47:58] mrchris: For example, if Foo has 2 Bars, when I do "fields_for :bars" i only want to see the 2 existing bars as inputs and not the third "empty" bar form
[14:48:47] EminenceHC: has joined #RubyOnRails
[14:49:37] mwlang: hotpancakes: both the Ruby and Rails Guides documentation are good, but do take time to fully absorb and appreciate ??? mainly because it???s mostly Greek until you???ve begun to grok Ruby idioms..as you get better they start to become quick reference points, but you do have to kind of know the answer???s gonna be there to find it half the time.
[14:51:11] tonios57: has joined #RubyOnRails
[14:51:28] badmadrad: has joined #RubyOnRails
[14:51:58] axl_: has joined #RubyOnRails
[14:52:08] mary5030: has joined #RubyOnRails
[14:53:35] Ergo: has joined #RubyOnRails
[14:54:10] hotpancakes: mwlang: yeah, pretty spot-on with that observation.
[14:54:44] pierre_f: has joined #RubyOnRails
[14:55:54] Cache_Money: I can't get Active Model Serializers to work https://gist.github.com/anonymous/08d91028a397716858a7 Anything glaringly obvious I'm doing wrong?
[14:56:44] universa1: could you please fix your intendation? your code is really hard to read.
[14:57:18] pierre_f: Hey lads, I am working on some text case and it seems that I cannot access to the session on my test as it was set on a different controller than the one I am testing. Is that normal ?
[14:58:12] michael_mbp: has joined #RubyOnRails
[14:58:13] universa1: pierre_f: controller test? integration test?
[14:58:16] universa1: pierre_f: !code
[14:58:16] helpa: pierre_f: 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.
[14:58:26] pierre_f: yep code is on the way
[14:58:42] Cache_Money: universa1: sorry, that's how it appears after I copy/paste, doesn't look like that in Sublime Text
[14:59:12] kitsuneyo: __chris, in my forms of that type i'm using a javascript method of adding and removing fields, which i got from railscast. it doesn't show empty fields and is generally pretty great.
[14:59:31] pierre_f: ]>> https://gist.github.com/Grandvizir/d0244e5909cbec00ce37
[14:59:32] universa1: Cache_Money: search and replace (enable regex) search for \t ; repleace with " " (two spaces), lower right corner: indent by spaces, 2 spaces.
[15:00:04] kitsuneyo: __chris: https://www.youtube.com/watch?v=amT27SfNhKM
[15:00:07] pierre_f: So on the controllers I set a session (call on tracker_controller et set on base_controller)
[15:00:23] pierre_f: and I try to access to it on tracker_controller_test.rb
[15:00:31] Cache_Money: universa1: that's what it's set to right now
[15:00:31] artto: has joined #RubyOnRails
[15:00:53] kitsuneyo: (it's railscast #196)
[15:01:03] universa1: Cache_Money: then you must have tabs in there. (there is also convert indentation to spaces in the lower right corner)
[15:01:09] Creeves: has joined #RubyOnRails
[15:01:09] asheinfeld: has joined #RubyOnRails
[15:01:12] nya: has joined #RubyOnRails
[15:01:28] universa1: pierre_f: so what is not working?!
[15:01:48] pierre_f: puts session.inspect on line 19 on the test
[15:01:54] DCio: has joined #RubyOnRails
[15:02:01] pierre_f: it's returning only flash variable
[15:02:11] maz-dev__: has joined #RubyOnRails
[15:02:38] pierre_f: but i set a user.process_id.ID key on the session on the base_controlker
[15:02:42] universa1: pierre_f: you want that file to be in .../administration/trackers_controllers_test.rb
[15:03:04] pierre_f: what do yupou
[15:03:18] universa1: pierre_f: ignore that, haven't used test::unit in years... so no clue about that.
[15:03:42] universa1: pierre_f: i would also have guessed you want that to be class Administration::TrackersControllerTest < ...
[15:03:45] mrchris: kitsuneyo, i'm using a method similar to that as well. the issue is fields_for: is generating 1 set of empty fields in addition to fields for the existing associations
[15:03:57] The_Phoenix: has joined #RubyOnRails
[15:03:59] universa1: pierre_f: then it should be able to "guess" the correct controller class itself.
[15:04:14] mrchris: I want to prevent fields_for from adding that set of empty fields
[15:04:34] kitsuneyo: __chris, mine doesn't. i can paste in a gist if you want so you can compare and maybe spot the difference
[15:04:38] universa1: pierre_f: what is not working in your test?
[15:04:52] victortyau: has joined #RubyOnRails
[15:04:57] mrchris: kitsuneyo, that would be great thanks
[15:05:00] The_Phoenix: has joined #RubyOnRails
[15:05:02] pierre_f: universa1: i'll try to add in the same namespace
[15:05:04] DCio: So i need help crafting an ActiveRecord query. I have 3 models: Surveys, Responses, and Qsets. Surveys have_many :responses and have_many :qsets, through: :responses. Responses have_many :qsets. Qsets have two columns, q_id and answer. I wish to find all Responses that have qsets with q_id X and answer Y. Is this possible with just an ActiveRecord query?
[15:05:22] pierre_f: but i do not get any error about the call: current_session_process_id
[15:05:24] universa1: pierre_f: what exactly? which test fails?!
[15:05:41] chandlerbing: has joined #RubyOnRails
[15:05:41] pierre_f: Should start a Tracker
[15:05:58] universa1: pierre_f: where exactly?
[15:06:00] The_Phoenix: has joined #RubyOnRails
[15:06:16] universa1: pierre_f: where it fails.
[15:06:22] Cache_Money: universa1: this should be better https://gist.github.com/anonymous/f5bfea100dd36a9ec167
[15:06:54] pierre_f: oh it's not failing as i am writing it, and to test it i need to access to the key 'user.process_id' of ma session.
[15:06:59] umgrosscol: has joined #RubyOnRails
[15:07:07] pierre_f: but it's empty
[15:07:56] The_Phoenix: has joined #RubyOnRails
[15:08:37] universa1: pierre_f: hmmm. than something else is off. the session object should not be empty.
[15:08:56] pierre_f: yeah. I set up on the base_controller..
[15:09:07] pierre_f: i will try to figure out ..
[15:09:34] universa1: Cache_Money: do you have an serializers/job_serializer.rb ?
[15:09:37] fgo: has joined #RubyOnRails
[15:10:54] Cache_Money: universa1: yes, it's in there. It's actually found at /app/serializers/v1/job_serializer.rb
[15:10:58] kitsuneyo: __chris: here, https://gist.github.com/kitsuneyo/7ee765ea05503694b440, mine is a has_many through, don't know if that makes a difference or not
[15:11:08] universa1: Cache_Money: do you have a JobSerializer in another namespace?
[15:11:42] Cache_Money: universa1: that's the only JobSerializer I have
[15:11:45] mrchris: kitsuneyo, the through is probably the difference. ill take a look thanks
[15:12:15] universa1: Cache_Money: have you tried the serializer in console?
[15:12:34] hadees: has joined #RubyOnRails
[15:13:09] Cache_Money: univera1: what would I try in the console?
[15:13:28] universa1: JobSerializer.new(Job.first).to_json or whatever it is.
[15:14:22] Cache_Money: universa!: I get "NameError: uninitialized constant JobSerializer"
[15:14:42] universa1: Cache_Money: V1::JobSer...
[15:15:26] bruno-: has joined #RubyOnRails
[15:15:40] universa1: Cache_Money: exit; rails c
[15:15:56] The_Phoenix: has joined #RubyOnRails
[15:17:06] The_Phoenix: has joined #RubyOnRails
[15:17:16] havenwood: has joined #RubyOnRails
[15:18:07] strcmp1: has joined #RubyOnRails
[15:18:39] [Butch]: has joined #RubyOnRails
[15:18:39] Cache_Money: universa1: This comment says AMS doesn't like to be namespaced http://stackoverflow.com/a/15464369/899904
[15:18:58] The_Phoenix: has joined #RubyOnRails
[15:20:16] The_Phoenix: has joined #RubyOnRails
[15:20:18] disgrntld: has joined #RubyOnRails
[15:21:46] The_Phoenix: has joined #RubyOnRails
[15:22:52] polpak: has joined #RubyOnRails
[15:23:19] The_Phoenix: has joined #RubyOnRails
[15:24:02] universa1: Cache_Money: hmm, just tried it in console with a non model specific name and a namespace and it works for me.
[15:24:31] The_Phoenix: has joined #RubyOnRails
[15:25:13] universa1: Cache_Money: so what happens if you do: V1::JobSerializer.new(Job.first).to_json ?
[15:25:24] The_Phoenix: has joined #RubyOnRails
[15:26:02] Cache_Money: universa1: NameError: uninitialized constant V1::JobSerializer
[15:26:43] Cache_Money: this look good? /app/serializers/v1/job_serializer.rb
[15:26:58] The_Phoenix: has joined #RubyOnRails
[15:27:05] universa1: Cache_Money: yes.
[15:27:12] universa1: Cache_Money: did you restart your rails console?
[15:27:26] universa1: than you are in the wrong app.
[15:27:43] erts: has joined #RubyOnRails
[15:27:53] n008f4g_: has joined #RubyOnRails
[15:28:13] Cache_Money: universa1: nope :/
[15:28:23] nettoweb: has joined #RubyOnRails
[15:28:30] northfurr: has joined #RubyOnRails
[15:28:33] The_Phoenix: has joined #RubyOnRails
[15:28:38] Rubie: has joined #RubyOnRails
[15:28:59] universa1: Cache_Money: open a new terminal, go to the apps root directory, do cat app/serializers/v1/job_serializer.rb
[15:29:20] universa1: Cache_Money: then do rails c; V1::JobSerializer.new(Job.first).to_json
[15:29:45] The_Phoenix: has joined #RubyOnRails
[15:29:55] elv: has joined #RubyOnRails
[15:30:43] Cache_Money: universa1: module V1; class JobSerializer < ActiveModel::Serializer; attributes :title, :uid; end; end
[15:30:56] The_Phoenix: has joined #RubyOnRails
[15:31:19] Cache_Money: universa1: It worked in the console that time, it must have something to do with opening a new terminal window ??
[15:31:26] universa1: Cache_Money: not really.
[15:31:33] universa1: Cache_Money: is the output the one you want?
[15:32:00] Cache_Money: universa1: yeah, it's what I am expecting
[15:32:01] kitsuneyo: has joined #RubyOnRails
[15:32:18] Cache_Money: weird! thanks for your help tho
[15:32:22] The_Phoenix: has joined #RubyOnRails
[15:32:26] universa1: so close your other terminal windows
[15:32:36] universa1: and start a new one for the rails server.
[15:33:17] The_Phoenix: has joined #RubyOnRails
[15:34:04] doodlehaus: has joined #RubyOnRails
[15:34:17] northfurr: has joined #RubyOnRails
[15:34:34] The_Phoenix: has joined #RubyOnRails
[15:34:58] j_mcnally: has joined #RubyOnRails
[15:35:13] Cache_Money: universa1: so, what do I call in my jobs_controller? I'm using `render json: @job, serializer: JobSerializer` but in my new terminal I'm getting everything (e.g. created_at, etc)
[15:35:22] evenix: has joined #RubyOnRails
[15:35:31] The_Phoenix: has joined #RubyOnRails
[15:35:42] Cache_Money: should I call `render json: @job, serializer: V1::JobSerializer`?
[15:35:43] universa1: Cache_Money: did you restart your rails server?
[15:36:01] universa1: the output is still wrong?
[15:36:53] Cache_Money: it is when I curl for it, not in the Rails Console
[15:37:34] universa1: ok. what happens if you access the url in the browser?
[15:37:47] AzaToth: has joined #RubyOnRails
[15:38:36] Cache_Money: I get back the entire object: {"id":4,"title":"Testing thru curl","uid":"e2a5","created_at":"2015-08-20T22:52:14.226Z","updated_at":"2015-08-20T22:52:14.226Z"}
[15:38:47] Cache_Money: I'm expecting just the "title" and "uid"
[15:38:57] war_pigs: has joined #RubyOnRails
[15:39:01] Cache_Money: > V1::JobSerializer.new(Job.first).to_json
[15:39:05] universa1: Cache_Money: try with serializer: V1::JobSerializer
[15:39:07] Cache_Money: => "{\"job\":{\"title\":\"Testing thru curl\",\"uid\":\"e2a5\"}}"
[15:39:07] Hates_: has joined #RubyOnRails
[15:39:21] Ropeney: has joined #RubyOnRails
[15:39:26] universa1: Cache_Money: you can also do render json: V1::JobSerializer.new(@job).to_json
[15:39:44] universa1: something is off in your app, sadly don't know what.
[15:39:52] universa1: and have to go now :-) need to start cooking soon.
[15:39:54] asheinfeld: has joined #RubyOnRails
[15:40:19] Cache_Money: universa1: i'll try that, thanks for your help
[15:42:36] biske: has joined #RubyOnRails
[15:43:06] evenix: Ok guys I have a question that been very TRICKY :) but fascinating
[15:43:36] evenix: When you do .clone ; how do you tell that object to stop being a clone and mimicking everything that happen to his original file
[15:43:50] sonofdirt: has joined #RubyOnRails
[15:44:16] evenix: lets say i have x = 5 and i do y = x.clone | now I decide that I don't want y to be updated anymore when I do x = 6
[15:44:38] evenix: I guess an example with a model would make more sense
[15:44:45] evenix: with an object its quite easy y = 6 would do the job
[15:45:01] evenix: but What if its : Person.name = "James"
[15:45:11] evenix: a = Person.first
[15:45:15] evenix: b = a.clone
[15:45:24] evenix: a.name = "John Doe" ; a.save;
[15:46:02] evenix: => "john doe"; now I want that b becomes its own thing and doesn't get updated when a get updated. How would you do it?
[15:46:08] hotpancakes: has joined #RubyOnRails
[15:46:16] borkdude: we are using carrierwave combined with carrierwave-crop. Sometimes the cropping results in an exception. How can I add an error to a field when this happens?
[15:48:09] GnuYawk: has joined #RubyOnRails
[15:48:21] borkdude: preferably in the model
[15:48:22] xhosae: has joined #RubyOnRails
[15:48:34] NBarnes: has joined #RubyOnRails
[15:48:41] elv: has joined #RubyOnRails
[15:49:46] DEac-: has joined #RubyOnRails
[15:50:56] zeknox: has joined #RubyOnRails
[15:51:32] kies^: has joined #RubyOnRails
[15:51:41] zeknox: are testing controllers necessary if you have request specs which are testing the end user features, and indirectly testing the controllers through form submission and such???
[15:53:36] petricore: has joined #RubyOnRails
[15:54:05] Scriptonaut_: has left #RubyOnRails: ()
[15:54:08] towski_: has joined #RubyOnRails
[15:54:46] Scriptonaut: has joined #RubyOnRails
[15:56:40] northfurr: has joined #RubyOnRails
[15:59:30] baweaver: has joined #RubyOnRails
[15:59:34] Maletor: has joined #RubyOnRails
[16:02:57] bricker: has joined #RubyOnRails
[16:04:27] nettoweb: has joined #RubyOnRails
[16:05:28] bronson: has joined #RubyOnRails
[16:07:09] hotpancakes: has joined #RubyOnRails
[16:08:47] bronson: has joined #RubyOnRails
[16:09:28] Dbugger: has joined #RubyOnRails
[16:09:31] Dbugger: Hello everyone
[16:09:56] Spami: has joined #RubyOnRails
[16:10:13] Dbugger: I have run a very simple test "get(:show, {'id' => '1'})" and then "assert_response :success" but I get a 302. How could I find out what is wrong?
[16:11:46] Dbugger: I answered my own question... read the logs :P
[16:12:02] Dbugger: I was assuming the fixtures where using 1, 2, 3.... as ids. False
[16:12:21] [Butch]: has joined #RubyOnRails
[16:15:17] elv: has joined #RubyOnRails
[16:15:20] [Butch]: has joined #RubyOnRails
[16:15:41] mary5030: has joined #RubyOnRails
[16:17:18] Detch: has joined #RubyOnRails
[16:18:14] mutuma: has joined #RubyOnRails
[16:19:17] DCio: So i need help crafting an ActiveRecord query. I have 3 models: Surveys, Responses, and Qsets. Surveys have_many :responses and have_many :qsets, through: :responses. Responses have_many :qsets. Qsets have two columns, q_id and answer. I wish to find all Responses that have qsets with q_id X and answer Y. Is this possible with just an ActiveRecord query?
[16:20:26] corioliss: has joined #RubyOnRails
[16:21:14] jhass: isn't that just Response.joins(:qsets).where(qsets: {q_id: X, answer: Y}) ?
[16:23:22] biske: has joined #RubyOnRails
[16:23:40] DCio: didnt know i could nest like that
[16:23:45] roolo: has joined #RubyOnRails
[16:23:53] DCio: with the qsets: {q_id: X, answer: Y}
[16:24:15] moshe_: has joined #RubyOnRails
[16:24:24] johntrails: someoen point me in the right direction. I have a view that you can get there through 2 entry points.. One is directly via a link on my app... the other is a redirection from a method in a coontroller. I need to do something like "if user landed on this page via controler, then display this message, other wise, display nothing"
[16:24:50] johntrails: how can I tell my view whether or not the user got to that view directly, or was redirected via another controller
[16:25:20] kitsuneyo: dbugger, yeah the fixtures use weird id numbers, not sure why that is
[16:25:24] DCio: redirection will also make it perform the controller method
[16:26:11] kies^: has joined #RubyOnRails
[16:26:16] DCio: you want to use render not redirect if you want to be able to get to 1 page through 2 different controller methods
[16:26:52] johntrails: i have a method that runs through a process,, after that process finishes, i wanted to be redirected to page "A"
[16:27:17] beauby: has joined #RubyOnRails
[16:27:24] johntrails: I can also get to page "A" directly, without having to go through that process, which sits on a different controller than the controller dedicated to page "A"
[16:27:34] doodlehaus: has joined #RubyOnRails
[16:28:45] nertzy: has joined #RubyOnRails
[16:29:10] johntrails: what I really want to do is just flash a message once we landed on page A "if entry point = render from foreign controller then display "Welcome, Orders are finished"
[16:29:11] Sigma00: johntrails: request.fullpath == name_of_path
[16:29:23] johntrails: if entry point from link, display nothing
[16:29:40] hnanon: has joined #RubyOnRails
[16:30:15] pramsky: has joined #RubyOnRails
[16:32:41] maz-dev_: has joined #RubyOnRails
[16:32:41] hnanon: I have an Account model and a Customer model.
[16:32:54] hnanon: When creating an account, I also want to create a customer.
[16:33:09] maz-dev_: has joined #RubyOnRails
[16:33:28] hnanon: However, the account id is not getting saved in the Customer table.
[16:34:25] renegadeandy: Hi all. Can you help explain this to me : https://gist.github.com/renegadeandy/d0735ebc16e5afa13c6c - I am trying to pass a configuration file to my thin server on a CMD line
[16:34:25] hnanon: Account has_one customer, Customer belongs_to Account
[16:34:30] hnanon: Account accepts_nested_attributes_for :customer
[16:34:38] hadees: has left #RubyOnRails: ()
[16:35:22] hnanon: There are no input fields in the form for customer (no customer attributes; I just want to create the customer, for now).
[16:36:21] moshef: anyone here experienced with using OmniAuth with multiple models? I???ve done everything stated here https://github.com/plataformatec/devise/wiki/OmniAuth-with-multiple-models but it doesnt seem to work. The omniauth routes are not being generated, so I???m getting undefinied ???user_omniauth_authorize_path???. I tried to manually add route for authorize but ran into other issues..
[16:38:02] tenderlove: has joined #RubyOnRails
[16:39:26] asheinfeld: has joined #RubyOnRails
[16:40:08] arooni-mobile: has joined #RubyOnRails
[16:41:38] Jacky: has joined #RubyOnRails
[16:44:49] ustrajunior: has joined #RubyOnRails
[16:45:08] NBarnes: has joined #RubyOnRails
[16:46:14] jonee: has joined #RubyOnRails
[16:48:15] [H]unt3r: has joined #RubyOnRails
[16:49:32] hahuang65: has joined #RubyOnRails
[16:49:42] hahuang65: I just did an upgrade from Rails 4.1 to 4.2 and now a ton of my Rspec tests complain whenever I use `url_for()` that I'm "Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true".... Anyone know what this is about?
[16:50:05] ngscheurich: has joined #RubyOnRails
[16:50:40] baweaver: has joined #RubyOnRails
[16:50:46] mrchris: has joined #RubyOnRails
[16:52:47] andatche: has joined #RubyOnRails
[16:52:59] andybernard: has joined #RubyOnRails
[16:54:39] prestorium: has joined #RubyOnRails
[16:54:41] rakm: has joined #RubyOnRails
[16:55:37] baweaver: has joined #RubyOnRails
[16:56:08] tubbo: hahuang65: what kind of tests?
[16:56:16] ustrajunior: has joined #RubyOnRails
[16:56:30] lethan: has joined #RubyOnRails
[16:56:36] djbkd: has joined #RubyOnRails
[16:59:17] nettoweb: has joined #RubyOnRails
[16:59:34] hahuang65: tubbo: they're view specs
[17:00:03] treehug88: has joined #RubyOnRails
[17:00:13] greenride: has joined #RubyOnRails
[17:00:19] djbkd: has joined #RubyOnRails
[17:00:48] hahuang65: tubbo: I've added `Rails.application.routes.default_url_options[:host] = "test.host"` to my rails_helper, and it fixes it, but I'm left wondering why I need to add that, and why something changed?
[17:01:17] hahuang65: It could be totally something in rspec that changed since that got upgraded too, but at this point I have no confidence that this is a test-only change.
[17:01:32] lindii_: has joined #RubyOnRails
[17:02:30] djbkd_: has joined #RubyOnRails
[17:04:06] andybernard: has joined #RubyOnRails
[17:05:03] Dbugger: Hey guys. It seems sending mailers is messing with my Controller tests. Is there a way to mock them? Or maybe the dont need to be mocked, and maybe Im messing with my implementation?
[17:05:27] tubbo: dbugger: define "messing with"
[17:06:49] Dbugger: tubbo, nevermind, I set "config.action_mailer.default_url_options" in production.rb and development.rb, but not on test.rb. That was my problem. :P Sorry
[17:07:27] srinidhi: has joined #RubyOnRails
[17:08:34] tubbo: hahuang65: yeah i've only needed to add default_url_options configuration when i'm using mailers in my tests or in dev.
[17:08:38] Detch: has joined #RubyOnRails
[17:08:54] tubbo: so you probably have view specs that are attempting to send emails, that's my best guess
[17:09:24] mary5030: has joined #RubyOnRails
[17:09:51] badmadrad: has joined #RubyOnRails
[17:10:27] hahuang65: tubbo: nope, it's not. It's just generating URLs, it's not the action_mailer default url options. It's Rails.application.routes default url options. But the Google search results is overwhelmingly for action mailer
[17:10:34] togg719: has joined #RubyOnRails
[17:10:36] IrishGringo: has joined #RubyOnRails
[17:11:19] fgo: has joined #RubyOnRails
[17:11:20] Cache_Money: universa1: I wasn't crazy. FYI I had to use active_model_serializer '0.9.2' to get it to work https://github.com/drapergem/draper/issues/651
[17:11:31] mary5030: has joined #RubyOnRails
[17:12:09] DelDotB: has joined #RubyOnRails
[17:14:01] tubbo: hahuang65: yeah that's because action mailer is the only tool that needs to generate URLs outside of the controller. can you post the view spec and the controller/view template that it is testing to gist?
[17:14:08] diegorv: has joined #RubyOnRails
[17:15:26] benlieb: has joined #RubyOnRails
[17:15:54] towski_: has joined #RubyOnRails
[17:17:38] EminenceHC: has joined #RubyOnRails
[17:17:45] StartupHub: has joined #RubyOnRails
[17:18:25] jenrzzz: has joined #RubyOnRails
[17:21:08] sarink: has joined #RubyOnRails
[17:22:01] choke: has joined #RubyOnRails
[17:22:50] erich: has joined #RubyOnRails
[17:22:57] baweaver: has joined #RubyOnRails
[17:23:19] northfurr: has joined #RubyOnRails
[17:26:13] northfurr: has joined #RubyOnRails
[17:27:00] nettoweb: has joined #RubyOnRails
[17:29:15] maz-dev_: has joined #RubyOnRails
[17:31:44] mloy: has joined #RubyOnRails
[17:32:13] bronson: has joined #RubyOnRails
[17:32:28] asheinfeld: has joined #RubyOnRails
[17:33:01] d2dchat: has joined #RubyOnRails
[17:33:02] shinnya: has joined #RubyOnRails
[17:33:17] DoubleMalt: has joined #RubyOnRails
[17:33:24] mloy: Hi all, I feel like this is a dumb question but I've been googling and reading through docs and can't find the answer. What do I need to write in a Rails migration to create a 2D array in a PSQL table?
[17:34:05] jeadre: has joined #RubyOnRails
[17:34:43] mloy: My current solution is awful because I'm just serializing a text column, so I have to pull the entire array out to work with it.
[17:36:02] kidoz: has joined #RubyOnRails
[17:36:17] kegan_: has joined #RubyOnRails
[17:37:16] RegulationD: has joined #RubyOnRails
[17:41:34] hahuang65: tubbo: I actually cannot. This company has really strict compliance rules :
[17:41:42] hahuang65: tubbo: it's frustrating at times.
[17:42:10] tubbo: hahuang65: PCI compliance? yeah i feel your pain
[17:42:19] tubbo: but i'm not into playing 20 questions
[17:44:08] Kallis: has joined #RubyOnRails
[17:45:29] Kallis: has joined #RubyOnRails
[17:47:07] bronson: has joined #RubyOnRails
[17:48:53] oflannabhra: has joined #RubyOnRails
[17:48:59] RegulationD: has joined #RubyOnRails
[17:52:38] mloy: Just realized that since all of my rows are going to be of the same length I can use a 1D array as a workaround
[17:52:57] sloggerkhan: has joined #RubyOnRails
[17:52:59] mloy: and just keep in mind row length when calling array values
[17:55:15] oflannabhra: has joined #RubyOnRails
[17:55:47] [Butch]: has joined #RubyOnRails
[17:56:14] petricore: has joined #RubyOnRails
[17:56:38] Detch: has joined #RubyOnRails
[17:56:52] kegan_: why do csrf meta tags have to come after the js include tag
[17:59:51] cajone: has joined #RubyOnRails
[18:00:09] dopie: <%= select_tag "month", Time.now.year .. 10.years.from_now.year %>
[18:00:13] dopie: how can i get this to work?
[18:00:24] dopie: <%= select_tag "month", Time.now.year .. 10.years.from_now.year %>
[18:00:27] dopie: there we go
[18:03:12] dopie: <%= select_tag "month", Time.now.year .. 10.years.from_now.year %>
[18:04:18] hahuang65: tubbo: haha, no worries. Thanks for the offer to help though. I'll figure it out sooner or later
[18:05:32] choke: has joined #RubyOnRails
[18:07:37] atmosx: Since I wrote a simple auth scheme all my User controller tests fail (should fail)... Is it okay if go with something like: def setup; @user = users(:one); log_in(@user); @update = opts;end ? This fixes the tests but I get some deprecation error becuase I'm not usind @user.id (because now @user is an AR object or something).
[18:07:49] atmosx: Is this a good practice?
[18:08:22] bashyou: has joined #RubyOnRails
[18:10:50] quazimodo: has joined #RubyOnRails
[18:11:21] [Butch]: has joined #RubyOnRails
[18:11:53] roolo: has joined #RubyOnRails
[18:12:02] war_pigs: has joined #RubyOnRails
[18:13:07] cball: has joined #RubyOnRails
[18:13:24] fgo: has joined #RubyOnRails
[18:14:19] mhib: has joined #RubyOnRails
[18:15:04] Sonicrida: has joined #RubyOnRails
[18:16:50] sloggerkhan: Anyone know how to make their actioncable server log to std out in dev?
[18:18:52] jeanlinux: has joined #RubyOnRails
[18:19:02] asheinfeld: has joined #RubyOnRails
[18:19:30] tubbo: atmosx: totally confused
[18:19:33] drale2k_: has joined #RubyOnRails
[18:20:05] tubbo: atmosx: what's the deprecation error?
[18:20:15] user1138: has joined #RubyOnRails
[18:21:05] tubbo: SloggerKhan: https://github.com/rails/actioncable/blob/master/lib/action_cable/server/base.rb#L11-L14
[18:22:05] paulcsmith: has joined #RubyOnRails
[18:23:07] doodlehaus: has joined #RubyOnRails
[18:24:10] bashyou: has joined #RubyOnRails
[18:24:11] sloggerkhan: So I realized it defaulted to the rails logger and that the reason my rails logger wasn't logging stdout was that action_cable didn't load a specific rails env (or at least not dev, I guess?), so I trued setting Rails.logger to Logger.new(STDOUT), which did indeed make it log to stdout, however it's causing `undefined method `tagged' for #<Logger` errors now, so evidently I'm likely doing something naive.
[18:25:21] atmosx: tubbo: here https://gist.github.com/atmosx/06455853a1e9a2e1ebda see the output
[18:25:22] pragmatism: has joined #RubyOnRails
[18:25:58] poli_: has joined #RubyOnRails
[18:27:27] atmosx: DEPRECATION WARNING: You are passing an instance of ActiveRecord::Base to `find`. Please pass the id of the object by calling `.id`. (called from set_user at
[18:27:50] atmosx: I can use .id not a big prob, but I'm kinda worried about using a helper method on my tests. Is this common?
[18:28:19] jeanlinux: has joined #RubyOnRails
[18:29:29] DLSteve: has joined #RubyOnRails
[18:30:10] tubbo: atmosx: where is log_in defined?
[18:30:45] atmosx: at app/helpers
[18:30:45] jeadre: has joined #RubyOnRails
[18:30:54] atmosx: I'm explicitly including it, "include SessionsHelper"
[18:32:57] kies^: has joined #RubyOnRails
[18:34:30] ustrajunior: has joined #RubyOnRails
[18:34:39] tubbo: atmosx: oh i see what you're doing...your main issue here is just that your helper is in the wrong place. instead of placing it in app/helpers, put it in test/support/auth_helper.rb or something. not sure how minitest handles "support files" but at the top of my spec_helper requires my auth helpers (and other things)
[18:34:42] toretore: has joined #RubyOnRails
[18:34:45] greenride: has left #RubyOnRails: ()
[18:34:56] tubbo: then include your helper into ActiveSupport::TestCase so it's available everywhere
[18:35:40] _spiderman: has joined #RubyOnRails
[18:36:21] Detch: has joined #RubyOnRails
[18:37:01] umgrosscol: has joined #RubyOnRails
[18:37:38] _spiderman: has joined #RubyOnRails
[18:37:38] carlosoliveira: has joined #RubyOnRails
[18:42:23] NBarnes: has joined #RubyOnRails
[18:44:12] asheinfeld: has joined #RubyOnRails
[18:44:25] irctc380: has joined #RubyOnRails
[18:44:46] prestorium: has joined #RubyOnRails
[18:44:58] oscarbr92: has joined #RubyOnRails
[18:45:30] bruno-: has joined #RubyOnRails
[18:45:39] constantlurking: has joined #RubyOnRails
[18:45:56] elv: has joined #RubyOnRails
[18:46:25] tomdp: has joined #RubyOnRails
[18:47:12] oscarbr92: I'm using rails 4.1.8 and I'm trying to use update_attribute to update a field in the database, but it won't do it
[18:47:30] mary5030: has joined #RubyOnRails
[18:47:44] carlosoliveira: has joined #RubyOnRails
[18:47:51] northfurr: has joined #RubyOnRails
[18:48:12] constantlurking: has left #RubyOnRails: ()
[18:48:52] lurkmaster: has joined #RubyOnRails
[18:49:13] lurkmaster: has left #RubyOnRails: ()
[18:49:19] carlosoliveira: has left #RubyOnRails: ()
[18:49:19] lurkmaster: has joined #RubyOnRails
[18:49:28] kegan_: if I have just the model listing and I want to generate the rest of its scaffolding
[18:49:37] kegan_: do i keep it singular
[18:49:48] tomdp: has left #RubyOnRails: ()
[18:50:04] kegan_: i need a view and thus a controller too, rails g listing ?
[18:50:23] kegan_: err, with a generator
[18:50:58] choke: has joined #RubyOnRails
[18:51:30] oscarbr92: https://gist.github.com/OscarBastardo/62ff4a6161a42b05b552
[18:52:26] lurkmaster: guys I'm getting a weird error when i try to generate a new rails app
[18:52:27] lurkmaster: http://pastebin.com/p4zZZ91g
[18:52:48] notori0us: has joined #RubyOnRails
[18:53:01] nbarnes_: has joined #RubyOnRails
[18:53:09] atmosx: tubbo: nice ty
[18:53:19] notori0us: Howdy folks. Has anyone done deployments with AWS elastic beanstalk?
[18:53:34] lurkmaster: didn't realize pastebin was banned. pastie link: http://pastie.org/10366950
[18:53:42] lurkmaster: someone help, i can't even start a new app
[18:53:54] notori0us: For some reason, migrations don't seem to be running on the prod database (AWS RDS), when I go connect there's no tables.
[18:54:13] jgpawletko: has joined #RubyOnRails
[18:55:54] baweaver: has joined #RubyOnRails
[18:56:03] lurkmaster: i have a feeling this is a simple error, i just don't know how to go about it
[19:00:17] mloy: has joined #RubyOnRails
[19:01:27] oflannabhra: has joined #RubyOnRails
[19:09:05] pullphinger15: has joined #RubyOnRails
[19:09:16] sarink: has joined #RubyOnRails
[19:09:31] DCio: So im using a rake task to convert CSV files into database entries. At the moment it is so damn inefficient and takes so long, but I cant really figure out how I can speed it up. The CSV fiels are typically about 1500 Rows x 800 Columns. Id like to at least get the time down to about the 5-20 minute range per file if possible. Here is the code I am currently using: https://gist.github.com/dciotoli/2faf9cfde9740f051a64
[19:09:56] arooni-mobile: has joined #RubyOnRails
[19:10:51] broman: i installed everything on my cpanel but when i access my application address, it returns me a directory listing and the "Apache/2.4.16 (Unix) OpenSSL/1.0.1e-fips Phusion_Passenger/5.0.16 mod_bwlimited/1.4 Server at 192.99.201.197 Port 80" signature
[19:12:36] choke: has joined #RubyOnRails
[19:13:43] codepete: has joined #RubyOnRails
[19:13:50] User458764: has joined #RubyOnRails
[19:14:31] fgo: has joined #RubyOnRails
[19:15:21] mrchris: so apparently before_save is not called on nested attributes unless something changes?
[19:15:31] sonofdirt: has joined #RubyOnRails
[19:16:05] tubbo: __chris: yes, that is expected behavior.
[19:16:16] tubbo: the nested model hasn't saved, therefore why would you call save on it?
[19:16:55] mrchris: I'm adding a temp property via attr_accessor and i want to do something based on the value of that temp prop
[19:17:15] broman: i installed everything on my cpanel but when i access my application address, it returns me a directory listing and the "Apache/2.4.16 (Unix) OpenSSL/1.0.1e-fips Phusion_Passenger/5.0.16 mod_bwlimited/1.4 Server at xx.xx.xxx.xx Port 80" signature
[19:17:31] mrchris: so, before_save { real_prop = "foo" if my_var == "test" }
[19:18:32] asheinfeld: has joined #RubyOnRails
[19:18:52] pullphinger: has joined #RubyOnRails
[19:19:06] pullphinger: has joined #RubyOnRails
[19:19:45] mrchris: does anyone know a way to force the callbacks?
[19:20:19] zpe: has joined #RubyOnRails
[19:21:07] andybernard: what would be wrong with calling save on the parent?
[19:21:17] towski_: has joined #RubyOnRails
[19:23:12] mrchris: andybernard, hi. what do you mean?
[19:23:52] DCio: So im using a rake task to convert CSV files into database entries. At the moment it is so damn inefficient and takes so long, but I cant really figure out how I can speed it up. The CSV fiels are typically about 1500 Rows x 800 Columns. Id like to at least get the time down to about the 5-20 minute range per file if possible. Here is the code I am currently using: https://gist.github.com/dciotoli/2faf9cfde9740f051a64
[19:24:04] andybernard: so if i am understanding your problem correctly, you want to call a before_save on a nested model
[19:24:23] andybernard: but you want the nested model to trigger the before save when it saves, not when the parent saves?
[19:24:24] mrchris: andybernard, correct
[19:24:35] mrchris: strike that
[19:25:17] mrchris: Im not concerned with that the parent is doing. I need to fire an after_save on the children
[19:25:27] rhizome: why not modify the children from the parent?
[19:25:59] andybernard: well even if the parent stays the same, still calling a save on it will trigger the child callbacks
[19:26:07] greengriminal: has joined #RubyOnRails
[19:26:36] mrchris: the problem is the children are not "changing" because the value that _is_ changing is a temp variable
[19:26:51] mrchris: so when .changed? is called it returns false
[19:26:52] rhizome: but the save is occurring on the parent, right?
[19:27:28] rhizome: what determines whether the temp variable changes?
[19:27:30] andybernard: ahh ok thats different than i thought
[19:27:50] mrchris: rhizome, attr_accessor :my_temp_var
[19:27:56] mrchris: that does not persist
[19:28:11] rhizome: what determines whether the accessor changes?
[19:28:31] mrchris: an input field on a form
[19:28:38] mrchris: it is passed via params
[19:29:01] andybernard: ok i think i understand now
[19:29:21] andybernard: so you have a param being passed, but since its not part of the child, when the parent is saved it doesn't trigger a child call back
[19:29:43] mrchris: that is correct
[19:29:57] andybernard: does a parent have one child or many?
[19:30:50] rhizome: how about not setting the accessor and just dealing with it when it's received? params[:foo].blank? ? default_value : params[:foo]
[19:31:06] riskish: has joined #RubyOnRails
[19:31:42] andybernard: any way we could see the code?
[19:32:01] andybernard: easier than 20 questions :p
[19:32:15] MEATCHICKEN: has joined #RubyOnRails
[19:32:22] bruno-: has joined #RubyOnRails
[19:32:47] MEATCHICKEN: One of my models has a callback that send a request to an api service..this is messing up my rspec test
[19:32:54] MEATCHICKEN: Should I skip callbacks or is there another solution?
[19:33:02] andybernard: mock the api call
[19:33:10] andybernard: thats what i meant haha
[19:33:16] netzfisch: has joined #RubyOnRails
[19:33:22] j_mcnally: has joined #RubyOnRails
[19:33:28] MEATCHICKEN: andybernard: How so? The API call is in the model..in an after_save
[19:33:33] MEATCHICKEN: after_save :send_to_api
[19:34:17] andybernard: meatchicken: https://robots.thoughtbot.com/how-to-stub-external-services-in-tests
[19:34:32] kegan_: at what precise point does something fail validation
[19:34:46] andybernard: kegan_: that is a very broad question
[19:34:59] kegan_: i don't know how to ask better questions about rails yet
[19:35:14] rhizome: the precise point probably doesn't matter too much, then
[19:35:31] kegan_: is it when the object is saved
[19:35:32] andybernard: does before the object saves help you any?
[19:35:41] andybernard: right before it saves it validates
[19:36:21] kegan_: so it's only for AR
[19:36:21] mrchris: andybernard, rhizome http://pastie.org/private/ocmkntah8h8ez6yzhoisa
[19:36:27] kegan_: and I can have a temporary object in memory
[19:36:35] kegan_: which is invalid, say, during the create method execution
[19:36:45] kegan_: but may become valid somewhere later in that block
[19:37:17] mrchris: andybernard, all of this madness because the children are added to the form dynamically
[19:37:33] kegan_: what I mean to say is if I pass params that do not include an attribute that is validated for, can I still assign it later before that object is saved...
[19:37:33] andybernard: alright, im taking a look
[19:37:35] rhizome: it's just a bare class?
[19:37:38] EminenceHC: has joined #RubyOnRails
[19:37:51] mrchris: rhizome, I've stripped out the sensitive stuff
[19:37:53] asheinfeld: has joined #RubyOnRails
[19:38:05] mrchris: its not a bare class
[19:38:16] mrchris: just showing the focal point
[19:38:22] andybernard: kegan_: not everything on an object needs to be validated
[19:39:33] kegan_: I'm only validating one attribute
[19:39:52] mrchris: andybernard, sorry, i forgot a line- http://pastie.org/private/qbeoe95qv3jfnswfcfm0bg
[19:40:17] mrchris: (the has_many declaration)
[19:40:37] DCio: anyone think they can make my CSV uploading code more efficient? its pretty garbage at the moment
[19:40:43] strcmp1: has joined #RubyOnRails
[19:40:45] DCio: but i cant think of a way to make it faster
[19:40:51] andybernard: DCio did you post it already?
[19:40:59] andybernard: i had a look at it but havent gotten the chance to refactor it
[19:41:06] doodleha_: has joined #RubyOnRails
[19:41:14] andybernard: not sure if i will get to it though :/
[19:41:14] crdpink: has joined #RubyOnRails
[19:41:29] saphafee: has joined #RubyOnRails
[19:41:40] lsone: has joined #RubyOnRails
[19:42:00] DCio: andybernard: no problem. If you dont have time to refactor it want to just let me know if you see anything glaring that should be fixed?
[19:42:09] saphafee: has left #RubyOnRails: ()
[19:42:11] andybernard: could you repost the link again?
[19:42:27] nzst: has joined #RubyOnRails
[19:42:35] DCio: https://gist.github.com/dciotoli/2faf9cfde9740f051a64. Dealing with CSV files roughly 1500 rows X 800 cols
[19:43:11] nzst: Hi, I would like to have some different config options set by default in Rails.application.configure block when generating a rails app, what's a good way to go about this? I also have different environments with different environment fiels
[19:43:11] beauby: has joined #RubyOnRails
[19:43:12] andybernard: __chris: curious, does this solve your problem? autosave: true to the has many
[19:43:14] ivanskie: has joined #RubyOnRails
[19:43:19] saphafee: has joined #RubyOnRails
[19:43:19] saphafee: has left #RubyOnRails: ()
[19:43:19] saphafee: has joined #RubyOnRails
[19:43:19] saphafee: has left #RubyOnRails: ()
[19:43:19] saphafee: has joined #RubyOnRails
[19:43:19] saphafee: has left #RubyOnRails: ()
[19:43:19] saphafee: has joined #RubyOnRails
[19:43:19] saphafee: has left #RubyOnRails: ()
[19:43:19] saphafee: has joined #RubyOnRails
[19:43:28] mrchris: ill try it
[19:43:52] mary5030: has joined #RubyOnRails
[19:44:14] mrchris: i think autosave is on by default
[19:44:36] andybernard: yeah i had a feeling
[19:44:38] mary5030: has joined #RubyOnRails
[19:44:54] DCio: So i did a little test, and its clear that creating the activerecord object is whats eating up all the time
[19:45:09] zpe: has joined #RubyOnRails
[19:45:21] ucoolaip: has joined #RubyOnRails
[19:45:21] ucoolaip: has left #RubyOnRails: ()
[19:45:21] ucoolaip: has joined #RubyOnRails
[19:45:21] ucoolaip: has left #RubyOnRails: ()
[19:45:21] ucoolaip: has joined #RubyOnRails
[19:45:21] ucoolaip: has left #RubyOnRails: ()
[19:45:21] ucoolaip: has joined #RubyOnRails
[19:45:23] tubbo: DCio: yeah, that's pretty common
[19:45:59] mrchris: i think i figured it out
[19:46:02] DCio: tubbo: is there any way around that?
[19:46:11] mrchris: thanks guys
[19:46:21] tubbo: DCio: if you're using postgres, i would highly suggest learning more about the COPY FROM CSV query, and bypass rails altogether. but if you need model validations and callbacks, there's really no other way to do it.
[19:46:45] aengaiwu: has joined #RubyOnRails
[19:46:45] aengaiwu: has left #RubyOnRails: ()
[19:46:45] aengaiwu: has joined #RubyOnRails
[19:46:45] aengaiwu: has left #RubyOnRails: ()
[19:46:45] aengaiwu: has joined #RubyOnRails
[19:46:45] aengaiwu: has left #RubyOnRails: ()
[19:46:51] tubbo: DCio: this is one of the reasons why building too much into your model layer can hurt in the long run, fwiw. not that you've done so in this case, just making the slippery slope argument :)
[19:46:57] andybernard: DCio you may be able to save some time by parsing the row without having that loop. may not save much time though
[19:47:07] aengaiwu: has joined #RubyOnRails
[19:47:07] aengaiwu: has left #RubyOnRails: ()
[19:47:07] aengaiwu: has joined #RubyOnRails
[19:47:08] aengaiwu: has left #RubyOnRails: ()
[19:47:08] aengaiwu: has joined #RubyOnRails
[19:47:08] aengaiwu: has left #RubyOnRails: ()
[19:47:25] aengaiwu: has joined #RubyOnRails
[19:47:25] aengaiwu: has left #RubyOnRails: ()
[19:47:25] aengaiwu: has joined #RubyOnRails
[19:47:25] aengaiwu: has left #RubyOnRails: ()
[19:47:25] aengaiwu: has joined #RubyOnRails
[19:47:26] aengaiwu: has left #RubyOnRails: ()
[19:47:33] tubbo: i don't really see why the CSV can't just be imported into the db table wholesale
[19:47:34] DCio: andybernard: yeah i thought about that, but then i realized i'd still be making the same # of activerecord objects
[19:47:49] andybernard: yes that wouldn't solve the ActiveRecord creation problem
[19:47:50] aengaiwu: has joined #RubyOnRails
[19:47:50] aengaiwu: has left #RubyOnRails: ()
[19:47:50] aengaiwu: has joined #RubyOnRails
[19:47:50] aengaiwu: has left #RubyOnRails: ()
[19:47:50] aengaiwu: has joined #RubyOnRails
[19:47:50] aengaiwu: has left #RubyOnRails: ()
[19:48:03] aengaiwu: has joined #RubyOnRails
[19:48:03] aengaiwu: has left #RubyOnRails: ()
[19:48:03] aengaiwu: has joined #RubyOnRails
[19:48:03] aengaiwu: has left #RubyOnRails: ()
[19:48:03] aengaiwu: has joined #RubyOnRails
[19:48:03] aengaiwu: has left #RubyOnRails: ()
[19:48:28] andybernard: Dico: https://www.coffeepowered.net/2009/01/23/mass-inserting-data-in-rails-without-killing-your-performance/
[19:48:44] DCio: that link is from 2009 but ill look at it
[19:50:34] bePolite: has joined #RubyOnRails
[19:51:33] andybernard: __chris: sorry I couldnt be more help
[19:51:43] mrchris: thanks for your hel
[19:51:55] DCio: andybernard: that link actually was very helpful!
[19:51:59] DCio: gave me some good ideas
[19:52:09] bstrarm: has joined #RubyOnRails
[19:52:37] jenrzzz: has joined #RubyOnRails
[19:53:20] hahuang65: has joined #RubyOnRails
[19:54:46] choke: has joined #RubyOnRails
[19:55:53] ohhaetii: has joined #RubyOnRails
[19:55:54] ohhaetii: has left #RubyOnRails: ()
[19:55:54] ohhaetii: has joined #RubyOnRails
[19:55:54] ohhaetii: has left #RubyOnRails: ()
[19:55:54] ohhaetii: has joined #RubyOnRails
[19:55:54] ohhaetii: has left #RubyOnRails: ()
[19:56:00] tubbo: DCio: haha...the semantics of a database have not changed between 2009 and now ;)
[19:56:11] ohhaetii: has joined #RubyOnRails
[19:56:11] ohhaetii: has left #RubyOnRails: ()
[19:56:11] ohhaetii: has joined #RubyOnRails
[19:56:11] ohhaetii: has left #RubyOnRails: ()
[19:56:11] ohhaetii: has joined #RubyOnRails
[19:56:11] ohhaetii: has left #RubyOnRails: ()
[19:56:54] DCio: yay i found a gem that saved my day
[19:57:13] DCio: all hail activerecord-import!
[19:58:00] oscarbr92: anybody knows why update_attribute() method won't work with boolean attributes?
[19:58:15] oscarbr92: rails 4.1.8 with sql server db
[19:58:29] oscarbr92: it's not updating the flag in the db
[19:58:48] lsone: has joined #RubyOnRails
[19:58:59] centrx: oscarbr92, Is the query being issued in the log?
[19:59:54] shinnya: has joined #RubyOnRails
[20:00:03] roolo: has joined #RubyOnRails
[20:00:07] oscarbr92: centrx: no, it just shows BEGIN TRANSACTION and COMMIT TRANSACTION inmediately after
[20:00:31] Hates_: has joined #RubyOnRails
[20:01:00] Hates_: has joined #RubyOnRails
[20:01:14] The_Phoenix: has joined #RubyOnRails
[20:01:16] centrx: oscarbr92, Maybe the flag was already false/true ?
[20:01:17] oscarbr92: works with strings and time fields, though
[20:03:24] roolo_: has joined #RubyOnRails
[20:03:54] oscarbr92: centrx: no my friend. I've been testing it and directly querying the db with the managment studio and It does not change a bit (no pun intended)
[20:04:46] cornerma1: has joined #RubyOnRails
[20:05:12] nettoweb: has joined #RubyOnRails
[20:05:42] pixelhandler: has joined #RubyOnRails
[20:05:57] jenrzzz: has joined #RubyOnRails
[20:06:49] pullphinger: has joined #RubyOnRails
[20:07:45] rhizome: how have you been testing?
[20:08:14] mrchris: has joined #RubyOnRails
[20:08:27] beauby: has joined #RubyOnRails
[20:08:59] diegoviola: has joined #RubyOnRails
[20:09:15] codepete: has joined #RubyOnRails
[20:09:29] nya: has joined #RubyOnRails
[20:10:44] _spiderman: has joined #RubyOnRails
[20:11:04] roolo: has joined #RubyOnRails
[20:11:55] arup_r: has joined #RubyOnRails
[20:12:09] bap1313: has joined #RubyOnRails
[20:12:33] kadoppe: has joined #RubyOnRails
[20:12:38] arup_r: What AR equivalent class name of the table schema_migrations ?
[20:13:33] tubbo: arup_r: it doesn't have one
[20:13:37] sandstrom: has joined #RubyOnRails
[20:13:48] tubbo: it's just an internal thing that active_record uses to keep track of what state your db is probabl yin
[20:13:50] tubbo: probably in*
[20:14:57] arup_r: well I want to store the count of `select count(*) from schema_migrations;` in a variable in my Rake task .. How to do it ?
[20:15:03] arup_r: What method should I use ?
[20:15:32] mrmylanman: has joined #RubyOnRails
[20:15:38] fgo: has joined #RubyOnRails
[20:15:58] MEATCHICKEN: arup_r: Just make run that query lol
[20:16:41] choke: has joined #RubyOnRails
[20:16:42] MEATCHICKEN: count = ActiveRecord::Base.connection.execute('select count(*) from schema_migrations;')
[20:16:48] MEATCHICKEN: Not tested at all.
[20:16:48] arup_r: If I have AR model. I can get the count so easily
[20:17:01] arup_r: I forgot it
[20:19:01] Coldblackice: has joined #RubyOnRails
[20:19:22] arup_r: meatchicken, I am hungry.. your name is delicious.. :p
[20:19:33] arup_r: anyway that query gave me `#<PG::Result:0xba2f318 status=PGRES_TUPLES_OK ntuples=1 nfields=1 cmd_tuples=1>
[20:19:35] asheinfeld: has joined #RubyOnRails
[20:20:25] momomomomo: has joined #RubyOnRails
[20:21:07] yfeldblum: has joined #RubyOnRails
[20:22:16] arup_r: getting `1` while doing `ActiveRecord::Base.connection.exec_query('select count(*) from schema_migrations;').length`
[20:22:25] arup_r: not correct.. it is also
[20:22:33] arup_r: http://api.rubyonrails.org/classes/ActiveRecord/Result.html#method-i-length
[20:23:07] togg719: has joined #RubyOnRails
[20:23:30] MEATCHICKEN: e=ActiveRecord::Base.connection.execute("select count(*) from schema_migrations")
[20:23:41] MEATCHICKEN: e.each {|x| puts x}
[20:23:44] MEATCHICKEN: x being the count
[20:24:12] MEATCHICKEN: well what do you need this for?
[20:24:15] MEATCHICKEN: Sounds like a strange usecase
[20:25:50] arup_r: rollback all migrations... So I was thinking to query the DB and get the count and then use the ount as rake db:rollback STEP=count
[20:26:05] MEATCHICKEN: arup_r: there is already a rake task to rollback everything
[20:26:12] Hates__: has joined #RubyOnRails
[20:26:15] arup_r: Wanna to write my own Rake task like db:roll_back_all
[20:26:28] arup_r: What is that meat ?
[20:26:44] arup_r: I didn't find any
[20:27:15] juanpaucar: has joined #RubyOnRails
[20:27:17] prestorium: has joined #RubyOnRails
[20:27:48] arup_r: this ActiveRecord::Base.connection.exec_query('select * from schema_migrations;').length is correct
[20:28:14] arup_r: I want to rollback only.. not db:drop db:create those stuff
[20:28:45] rhizome: the difference being?
[20:28:55] MEATCHICKEN: arup_r: create a task that just calls db:drop, db:create then
[20:29:08] MEATCHICKEN: you'll be in a clean slate
[20:29:28] MEATCHICKEN: reset if you also want to migrate back up
[20:31:08] arup_r: ok not writing mine.. I'll use what we have in our disposal
[20:32:23] arup_r: thanks meat
[20:32:43] elv: has joined #RubyOnRails
[20:33:14] bruno-: has joined #RubyOnRails
[20:34:31] htmldrum: has joined #RubyOnRails
[20:34:34] atmosx: arup_r: can you eat meat?
[20:35:03] atmosx: arup_r: isn't that some religious thing there that you can't eat this or that? Or maybe I'm mistaken.
[20:35:11] arup_r: I love it ... meat n chicken both.. I can cook also it very weel
[20:35:36] asheinfeld: has joined #RubyOnRails
[20:35:54] arup_r: atmosx, you are close.. but that's cow we don't as we are Hindu :)
[20:35:59] atmosx: I don't cook I only eat :-P
[20:36:01] DCio: guys you're making me hungry :(
[20:36:16] atmosx: arup_r: ah, just cow right? like muslims don't eat pigs or something
[20:36:26] atmosx: arup_r: can you drink cow milk?
[20:36:48] atmosx: milk + cornflakes = champion's breakfast!
[20:37:42] hahuang65: If I've got a postgres table with a column called "title" which is of type text, and I'd like to change it to "titles" and convert it to an array of strings, what's a good way to do that>
[20:38:05] whooza_: has joined #RubyOnRails
[20:38:06] arup_r: atmosx, muslims eat cow.. they are opposite of Hindu :)
[20:38:55] arup_r: somehow we are reverse of each other.. anyway leave this topic... it can create something which caused ban of me.. :/
[20:39:03] csmb: hahuang65: write a migration that alters the table
[20:39:19] hadees: has joined #RubyOnRails
[20:39:22] hahuang65: csmb: yes, but how to alter it to change the type and keep the data
[20:39:23] arup_r: rename_column
[20:39:37] atmosx: if my routs are: resources :users do; resources :borrower_profiles ; end (nested) what is borrower_profiles index? I'm kinda lost with rails routes...
[20:39:39] arup_r: hahuang65, ^^
[20:39:58] andybernard: that is some horribly formatted code lol
[20:40:00] hahuang65: arup_r: uhhh
[20:40:10] csmb: also, you could make a new column, then write a script to move the old data to the new column
[20:40:14] csmb: then rm the old column
[20:40:16] hahuang65: arup_r: that's not the hard part, I want to convert the data inside, not just change the column name
[20:40:27] csmb: that's an option if you'd like to be extra robust
[20:40:39] arup_r: string to text.. not harmful it seems
[20:40:41] andybernard: atmosx: your index is still borrower_profiles#index
[20:41:05] andybernard: resources :borrower_profiles without the 'only:' will include all rails default routes
[20:42:19] northfurr: has joined #RubyOnRails
[20:42:28] yfeldblum: has joined #RubyOnRails
[20:42:36] hahuang65: arup_r: what?
[20:42:46] atmosx: andybernard: how does this fail if index works? https://gist.github.com/atmosx/845052f6e11d81d047ee#file-borrower_profiles_controller_test-rb-L8 (with No Route Matches)
[20:43:13] choke: has joined #RubyOnRails
[20:43:17] hahuang65: arup_r: I want this: "abc" => ["abc"]
[20:43:20] nertzy: has joined #RubyOnRails
[20:43:32] atmosx: andybernard: oh you mean, adding resources :borrower_profiles ?
[20:43:42] arup_r: I missed it
[20:43:48] atmosx: I don't want that, I want to adjust the test to look for the proper routes.
[20:43:59] arup_r: go what csmb said
[20:44:30] arup_r: but yes, that can cause lots of Nomethod error very soon.. when old column will be dropped
[20:45:43] nettoweb: has joined #RubyOnRails
[20:45:43] arup_r: but create a column to back up.. then empty the data inside the old clmn.. then use migration rename_coulmn
[20:45:43] atmosx: andybernard: I think I figured: http://stackoverflow.com/questions/1451135/rails-how-to-modify-tests-for-a-nested-resource
[20:46:01] arup_r: and again restore it from new column to old column using array..
[20:46:11] arup_r: and then kick the new column from your table
[20:46:30] hadees: has joined #RubyOnRails
[20:46:37] arup_r: In this case no error from the App atleast not NoMethod error
[20:47:22] arup_r: remember I am not a certified Rails dev.. so be careful with my advices .. ;)
[20:47:33] cac: has joined #RubyOnRails
[20:48:15] mrchris: so for anyone wondering how i did it
[20:49:00] mrchris: in my form i set "created_at" to blank, then in before_save I restore_attributes([:created_at]).
[20:49:05] csmb: hah arup_r is right, hahuang65. That's certainly one way to do it
[20:49:14] mrchris: andybernard, ^
[20:50:02] VeryBewitching: has joined #RubyOnRails
[20:50:03] hahuang65: arup_r: cool, thanks for the advice
[20:50:07] hahuang65: csmb: thanks
[20:50:18] csmb: hahuang65: glad to help out
[20:50:22] hahuang65: arup_r: yeah we'll have a ton of errors on deploy if I just rename it since we have hot-restarts
[20:50:25] war_pigs: has joined #RubyOnRails
[20:50:28] Lightsword: has joined #RubyOnRails
[20:50:47] arup_r: ACTION not responsible for any loos of data or data corruptions.
[20:51:46] hahuang65: hehe no worries, gonna test it thoroughly.
[20:52:35] arup_r: csmb, wanna to PM you.. :)
[20:53:26] qejk: has joined #RubyOnRails
[20:54:28] andybernard: __chris: that doesn't seem ideal but if it works it works
[20:54:41] mrchris: andybernard, total hack :D
[20:55:12] meoblast001: has joined #RubyOnRails
[20:55:20] bulldawgden: has joined #RubyOnRails
[20:56:17] nettoweb: has joined #RubyOnRails
[20:56:48] baweaver: has joined #RubyOnRails
[20:58:05] chinmay_dd: has joined #RubyOnRails
[21:02:07] maz-dev_: has joined #RubyOnRails
[21:02:41] jgpawletko: has joined #RubyOnRails
[21:04:21] axl_: has joined #RubyOnRails
[21:05:08] andybernard: atmosx: I appear to have completely misunderstood your problem :p
[21:07:03] crdpink2: has joined #RubyOnRails
[21:10:41] atmosx: andybernard: I have come to the conclusion that, I'm not very good at explaining myself :-P
[21:10:51] np0: has joined #RubyOnRails
[21:12:03] baweaver: has joined #RubyOnRails
[21:14:46] asheinfeld: has joined #RubyOnRails
[21:15:00] elv: has joined #RubyOnRails
[21:15:19] alphaatom: has joined #RubyOnRails
[21:16:17] alphaatom: has joined #RubyOnRails
[21:16:40] fgo: has joined #RubyOnRails
[21:18:48] poli: has joined #RubyOnRails
[21:21:00] ledestin: has joined #RubyOnRails
[21:21:43] x-light: has joined #RubyOnRails
[21:23:50] axl_: has left #RubyOnRails: ()
[21:24:34] elv: has joined #RubyOnRails
[21:24:34] arooni-mobile: has joined #RubyOnRails
[21:26:24] beauby: has joined #RubyOnRails
[21:26:38] arooni-mobile: has joined #RubyOnRails
[21:26:57] codepete: has joined #RubyOnRails
[21:27:29] baweaver: has joined #RubyOnRails
[21:28:01] dopamean_: has joined #RubyOnRails
[21:29:42] bronson: has joined #RubyOnRails
[21:31:36] bronson: has joined #RubyOnRails
[21:31:45] meoblast001: has joined #RubyOnRails
[21:33:36] Sonicrida: has left #RubyOnRails: ()
[21:33:45] Sonicrida: has joined #RubyOnRails
[21:33:52] bronson: has joined #RubyOnRails
[21:34:03] bruno-: has joined #RubyOnRails
[21:34:41] arooni-mobile: has joined #RubyOnRails
[21:34:42] choke: has joined #RubyOnRails
[21:35:02] baweaver: has joined #RubyOnRails
[21:35:23] Maletor: has joined #RubyOnRails
[21:36:36] rubynoob: has joined #RubyOnRails
[21:36:42] bronson: has joined #RubyOnRails
[21:36:44] hnanon: has joined #RubyOnRails
[21:37:12] hnanon: Can someone tell me why my nested model is not being saved to the db:
[21:37:15] hnanon: https://gist.github.com/anonymous/c6e50a1446a9e5e16431
[21:38:09] nettoweb: has joined #RubyOnRails
[21:38:28] bronson: has joined #RubyOnRails
[21:38:39] allcentury: has joined #RubyOnRails
[21:38:57] hnanon: Customer belongs_to Account
[21:39:06] bstrrm: has joined #RubyOnRails
[21:39:12] hnanon: Account accepts_nested_attributes_for :customer
[21:39:27] Sonicrida: Does anybody know what type of data is returned by a checkbox field made with the simple_form gem?
[21:39:49] iamse7en: has joined #RubyOnRails
[21:40:05] DelDotB: has joined #RubyOnRails
[21:40:23] bronson: has joined #RubyOnRails
[21:40:29] andybernard: what TYPE of data?
[21:41:16] Sonicrida: andybernard, I have a bunch of options and you can check more than one
[21:41:17] beefcakeba: has joined #RubyOnRails
[21:41:32] andybernard: oh sorry, checkbox not radio :[
[21:41:39] Sonicrida: but nothing is getting put in the database whenever I try to submit the form
[21:41:46] andybernard: did you check params?
[21:42:05] Sonicrida: I think? what do you mean?
[21:42:11] andybernard: it SHOULD return the value of the checkbox
[21:42:23] bronson: has joined #RubyOnRails
[21:42:34] Sonicrida: well I'm reading here in the documentation of the gem
[21:42:34] andybernard: go into your favorite irb (i use pry) and check the params to see what is getting passed into the update/create action
[21:42:47] Sonicrida: it says it returns it as "has_many/has_and_belongs_to_many associations" for the column type
[21:42:49] pontiki: or look in the logfile
[21:42:56] andybernard: logfile would work too
[21:43:18] helpa: Just the tips: http://logs.ryanbigg.com/tips
[21:43:51] Sonicrida: any idea how to do that on heroku?
[21:44:01] andybernard: do you not have it locally?
[21:44:09] bronson: has joined #RubyOnRails
[21:44:13] andybernard: your previous comment didnt make any sense
[21:44:17] Sonicrida: nope :( I kinda got thrown onto this rails project
[21:44:26] andybernard: oh thats always fun :p
[21:44:52] pontiki: they told you to do your debugging on heroku?
[21:44:54] andybernard: has many / has_and_belongs_to_many refers to the models, not necessarily the data
[21:45:03] Sonicrida: "ruby is a beginners language" they said. "you'll be fine it's easy to learn"
[21:45:20] andybernard: yeah ruby is easy to pick up, but rails is more than just ruby :p
[21:45:22] Sonicrida: well they didn't have a local environment setup
[21:45:32] pontiki: um... why don't you set one up?
[21:45:38] sonofdirt: has joined #RubyOnRails
[21:45:41] pontiki: that's part of learning, too
[21:45:44] Sonicrida: the previous dev had some cloud ide but he's gone now
[21:45:53] Sonicrida: and I couldn't figure out how to do it on windows
[21:46:03] bronson: has joined #RubyOnRails
[21:46:20] andybernard: nonononono rails on windows is terrible
[21:46:24] Sonicrida: yeah I've heard
[21:46:29] andybernard: i had to do it once, never ever ever again haha
[21:46:46] andybernard: itll probably be difficult to get any type of params out of a heroku app
[21:46:54] andybernard: you really need it locally
[21:47:04] Sonicrida: I tried to get into rails once 2 years ago and learned it sucks on windows anded up becoming a js dev
[21:47:13] Sonicrida: here I am now getting thrown into a rails project lol
[21:47:14] pontiki: using cloud 9 (http://c9.io) or nitrous (http://nitrous.io) or koding (http://koding.com) if you don't want to set one up on your own machine
[21:47:39] pontiki: Vagrant + VirtualBox + a linux distro if you want something local, but being productive
[21:47:58] bronson: has joined #RubyOnRails
[21:48:00] Sonicrida: I'll use cloud9
[21:48:00] hnanon: Can someone take a look at my form? I'm trying to pass nested attributes and they're not being saved.
[21:48:12] Sonicrida: I had something on there but couldn't get the postgres to work
[21:48:31] pontiki: Linux Mint + VagrantBox for a full-up Linux desktop and development environtment
[21:48:31] fryguy: you should take the time to set up a VM yourself
[21:48:42] andybernard: dual boot and ubuntu :p
[21:48:52] rhizome: you're going to get nowhere trying to work directly on heroku
[21:49:06] ftj: has joined #RubyOnRails
[21:49:46] bronson: has joined #RubyOnRails
[21:49:49] Sonicrida: I'll have to do that but I don't have much time atm
[21:49:57] Sonicrida: so i think c9 might be faster
[21:50:48] pontiki: c9 is a good choice
[21:51:24] mblair: has joined #RubyOnRails
[21:51:29] andybernard: moving away from windows is the better choice :p
[21:51:43] bronson: has joined #RubyOnRails
[21:52:09] pontiki: you can look at the logs on heroku, assuming you have the heroku toolbelt installed; not sure how one works with heroku apps without it. interestingly, the command is `heroku logs`
[21:52:57] pontiki: andybernard: while that's true from a technical standpoint, too many people don't have that option economically
[21:53:35] Sonicrida: yeah unfortunately
[21:53:39] bronson: has joined #RubyOnRails
[21:53:48] andybernard: linux is free!
[21:53:48] juanpaucar: has joined #RubyOnRails
[21:53:54] Sonicrida: I'm not planning on making a full career switch into rails devleopment and I prefer windows
[21:54:01] andybernard: i totally understand haha
[21:54:09] Sonicrida: it's worked fine so far for just doing front-end + js stuff I suppose
[21:54:09] andybernard: i actually have all 3 os's
[21:54:27] pontiki: going with dual boot or VM, though, is very viable
[21:54:28] Sonicrida: pontiki, the heroku logs was exactly what I needed thank you!
[21:54:38] Sonicrida: it's showing me everything here this is awesome
[21:55:00] roolo: has joined #RubyOnRails
[21:55:01] pontiki: i went out and installed the toolbelt just to run `heroku help` so i could see
[21:55:28] bronson: has joined #RubyOnRails
[21:56:07] Sonicrida: if I have data being sent as ["bla 1", "bla 2", "bla 3"]
[21:56:12] Sonicrida: that's an array of strings right?
[21:57:45] bronson: has joined #RubyOnRails
[21:57:57] darrencauthon: has joined #RubyOnRails
[21:59:38] bronson: has joined #RubyOnRails
[21:59:41] sonofdirt: has joined #RubyOnRails
[22:00:55] manfrin`laptop: has joined #RubyOnRails
[22:01:31] bronson: has joined #RubyOnRails
[22:01:37] manfrin`laptop: has joined #RubyOnRails
[22:03:22] bronson: has joined #RubyOnRails
[22:03:46] annlewis: has joined #RubyOnRails
[22:03:53] hnanon: Do I need :account_id in this line:
[22:03:56] hnanon: params.require(:account).permit(:email, :password, :password_confirmation, customer_attributes: [:id, :account_id, :shipping_address_name])
[22:04:05] bruno-: has joined #RubyOnRails
[22:04:17] manfrin`laptop: if you have account_id in a field on your form/whatever it submitting, then yeah
[22:04:28] manfrin`laptop: if you're building from a parent account and don't need it in the child, then no
[22:04:33] Sonicrida: so pontiki wouldn't this be the right way to make a column for that data? add_column :users, :interested_areas, :string, array: true, default: '{}'
[22:04:34] hnanon: customer belongs to account
[22:04:44] manfrin`laptop: I got a quick jquery issue, small gist:
[22:04:44] manfrin`laptop: https://gist.github.com/manfrin/4380ee10f58bbb243f05
[22:05:13] pontiki: Sonicrida: i came in on the "how do i heroku" bit. i don't know your problem at all
[22:05:20] bronson: has joined #RubyOnRails
[22:05:20] hnanon: Yeah, its from a parent account, but no customer attributes are being saved and the account_id attribute in the customer table is empty.
[22:05:55] CBX: has joined #RubyOnRails
[22:06:18] pontiki: if it's just a question of "how do i store an array of strings?" then yes, almost: the default is [], not {}
[22:06:48] pontiki: you might want to use text instead of string, depending on how large that list of strings might be, too
[22:06:52] manfrin`laptop: hnanon try puts'ing your params in your controller, see what's coming through
[22:07:02] pontiki: string is just VARCHAR(255)
[22:07:09] bronson: has joined #RubyOnRails
[22:07:30] hnanon: I see the params, but they're not nested and I don't see a customer id nor an account id.
[22:07:53] hnanon: I think it might be my form.
[22:08:04] Llama4146: has joined #RubyOnRails
[22:08:07] Sonicrida: I'll try that pontiki and see if that works thanks!
[22:09:02] bronson: has joined #RubyOnRails
[22:09:03] manfrin`laptop: https://gist.github.com/manfrin/4380ee10f58bbb243f05
[22:09:10] manfrin`laptop: anyone help with this jquery?
[22:09:39] VeryBewitching: pontiki: That depends on the database
[22:10:30] pontiki: VeryBewitching: it does, but i'm pretty sure it's postgres
[22:11:02] bronson: has joined #RubyOnRails
[22:11:04] VeryBewitching: pontiki: varchar and text in that case are the same, unless a length is specified.
[22:11:17] VeryBewitching: MySQL discerns between the two.
[22:11:25] mikecmpbll: has joined #RubyOnRails
[22:11:58] baweaver: has joined #RubyOnRails
[22:12:48] bronson: has joined #RubyOnRails
[22:14:06] Sonicrida: it is postgres pontiki
[22:14:32] pontiki: so when i look at a string type in PG, it says "character varying", while a text type is "text"
[22:14:39] pontiki: are you telling me those are the actually the same thing?
[22:14:45] bronson: has joined #RubyOnRails
[22:14:57] VeryBewitching: pontiki: According to the docs, yes.
[22:15:02] pontiki: fascinating
[22:15:16] VeryBewitching: SQL doesn't actually have a 'text' type
[22:15:24] baweaver: pontiki: easy there Spock :P
[22:16:39] bronson: has joined #RubyOnRails
[22:17:48] fgo: has joined #RubyOnRails
[22:18:53] bronson: has joined #RubyOnRails
[22:18:58] jeanlinux: has joined #RubyOnRails
[22:19:28] pontiki: that's Mrs. Spock to you, lemur
[22:20:22] bronson: has joined #RubyOnRails
[22:21:13] mrchris: has joined #RubyOnRails
[22:22:19] bronson: has joined #RubyOnRails
[22:22:37] Sonicrida: hmm pontiki so I changed the columns to be text columns and changed the default to "[]"
[22:22:39] pontiki: seriously?!?!
[22:22:59] mary5030_: has joined #RubyOnRails
[22:22:59] andybernard: has joined #RubyOnRails
[22:23:16] Sonicrida: still doesn't work for me though unfortunately
[22:23:25] ngscheurich: has joined #RubyOnRails
[22:23:28] Sonicrida: the data is still showing up in postgres as []
[22:23:36] andybernard: whoopsie. dont you hate when you code so hard your entire computer crashes?
[22:23:53] pontiki: you have showed me no code, Sonicrida
[22:24:00] pontiki: Sonicrida: !ncnh
[22:24:01] helpa: Sonicrida: If you don't provide any code, it becomes really difficult for us to help you. Providing code to reproduce the problem increases your chances of getting great, accurate help immensely.
[22:24:08] bronson: has joined #RubyOnRails
[22:24:31] pontiki: all i've seen is some disjointed fragments
[22:24:36] andybernard: what does that even mean?
[22:24:51] pontiki: no code no help
[22:24:57] elv: has joined #RubyOnRails
[22:24:58] andybernard: i literally just saw it haha
[22:25:04] andybernard: im totally stealing that
[22:25:17] andybernard: but you did a bang before it, so does that mean no code yes help?
[22:25:30] VeryBewitching: andybernard: It's a command for helpa
[22:25:35] helpa: Nom nom. Thanks, VeryBewitching!
[22:25:59] doublemalt_: has joined #RubyOnRails
[22:26:01] bronson: has joined #RubyOnRails
[22:26:24] VeryBewitching: He only likes certain folk.
[22:26:43] netzfisch: has joined #RubyOnRails
[22:26:46] pontiki: you must be licensed to bot
[22:27:00] pontiki: speak to Radar about it
[22:27:42] beauby: has joined #RubyOnRails
[22:27:52] andybernard: Radar: I want the bot to love me
[22:28:01] bronson: has joined #RubyOnRails
[22:28:22] helpa: Nom nom. Thanks, baweaver!
[22:28:32] andybernard: rub it in why don't ya?
[22:29:46] _spiderman: has joined #RubyOnRails
[22:29:48] bronson: has joined #RubyOnRails
[22:30:35] ckinniburgh_: has joined #RubyOnRails
[22:30:53] WillAmes: has joined #RubyOnRails
[22:31:40] bronson: has joined #RubyOnRails
[22:31:45] elv: has joined #RubyOnRails
[22:33:52] bronson: has joined #RubyOnRails
[22:34:25] choke: has joined #RubyOnRails
[22:34:28] hnanon: Can someone take a look at a nested form for me?
[22:35:44] bronson: has joined #RubyOnRails
[22:37:36] bronson: has joined #RubyOnRails
[22:37:52] hnanon: https://gist.github.com/anonymous/c6e50a1446a9e5e16431#file-account_form-erb-html
[22:38:49] Moonlight-Angel: has joined #RubyOnRails
[22:39:32] bronson: has joined #RubyOnRails
[22:41:23] bronson: has joined #RubyOnRails
[22:41:44] pulgalipe: has joined #RubyOnRails
[22:43:15] bronson: has joined #RubyOnRails
[22:43:47] Maletor: has joined #RubyOnRails
[22:45:12] bronson: has joined #RubyOnRails
[22:47:01] bronson: has joined #RubyOnRails
[22:47:58] elv: has joined #RubyOnRails
[22:48:55] bronson: has joined #RubyOnRails
[22:50:53] bronson: has joined #RubyOnRails
[22:51:52] dopie: has joined #RubyOnRails
[22:52:23] mois3x: has joined #RubyOnRails
[22:52:43] bronson: has joined #RubyOnRails
[22:53:18] war_pigs: has joined #RubyOnRails
[22:54:05] MartinElvar: has joined #RubyOnRails
[22:54:34] bronson: has joined #RubyOnRails
[22:55:12] jenrzzz: has joined #RubyOnRails
[22:55:43] rhizome: hnanon: what's the problem?
[22:55:51] twilling: has joined #RubyOnRails
[22:56:04] hnanon: Customer attributes are not being saved.
[22:56:24] hnanon: Including the account_id.
[22:56:25] rhizome: what does the log say?
[22:56:31] bronson: has joined #RubyOnRails
[22:57:14] cac: has joined #RubyOnRails
[22:57:34] hnanon: Nothing out of the ordinary. No errors.
[22:57:52] hnanon: The nested attributes are just not being saved.
[22:58:21] bronson: has joined #RubyOnRails
[23:00:16] bronson: has joined #RubyOnRails
[23:00:57] andybernard: hnanon: on create or update?
[23:01:36] Zackio: has joined #RubyOnRails
[23:02:11] bronson: has joined #RubyOnRails
[23:02:20] andybernard: did you add the customer params to the params.require?
[23:03:48] andybernard: oh yes you did
[23:04:03] bronson: has joined #RubyOnRails
[23:04:25] hnanon: I get the feeling it's my form.
[23:04:33] hnanon: But I can't see it.
[23:04:56] hnanon: I've been staring at the same files for two hours and can't seem to see what I'm doing wrong.
[23:04:57] andybernard: your form looks fine to me
[23:05:25] VeryBewitching: hnanon: What do the server logs say for the Parameters hash?
[23:05:54] bronson: has joined #RubyOnRails
[23:07:04] renanoronfle: has joined #RubyOnRails
[23:07:04] hnanon: params hash: https://gist.github.com/anonymous/387e29c05120c340972c
[23:07:13] andybernard: hnanon: im going to create a rails app and test your code myself
[23:07:41] hnanon: andybernard: You don't have to do that.
[23:07:54] bronson: has joined #RubyOnRails
[23:08:02] hnanon: I got a bunch of interdependent stripe stuff going on.
[23:08:38] tds5016: has joined #RubyOnRails
[23:09:34] tds5016: hi all. I'm using Sunspot, and for some reason when I try to run Sunspot.index(my_array_of_things) it just returns "Killed" after a few seconds. does anyone know what might cause this behavior?
[23:09:43] bronson: has joined #RubyOnRails
[23:09:43] andybernard: your code shouldnt be too hard to isolate
[23:10:02] mois3x: has joined #RubyOnRails
[23:10:04] VeryBewitching: hnanon: Weird. In your controller action trying doing a puts params.inspect
[23:10:10] VeryBewitching: That's where I'd start.
[23:10:25] VeryBewitching: account_params.inspect too
[23:11:36] bronson: has joined #RubyOnRails
[23:11:38] noodman: has joined #RubyOnRails
[23:13:30] bronson: has joined #RubyOnRails
[23:14:21] baweaver: has joined #RubyOnRails
[23:15:19] bronson: has joined #RubyOnRails
[23:17:13] bronson: has joined #RubyOnRails
[23:17:44] stardiviner: has joined #RubyOnRails
[23:18:18] hnanon: Why is there no "id" in my params?
[23:18:32] Inside: has joined #RubyOnRails
[23:18:46] Inside: has joined #RubyOnRails
[23:18:55] fgo: has joined #RubyOnRails
[23:19:14] bronson: has joined #RubyOnRails
[23:19:27] pulgalipe: has joined #RubyOnRails
[23:19:47] DoctorMonocular: has joined #RubyOnRails
[23:20:04] twilling: has joined #RubyOnRails
[23:20:31] charliesome: has joined #RubyOnRails
[23:20:37] fedexo: has joined #RubyOnRails
[23:21:02] bronson: has joined #RubyOnRails
[23:21:46] elv: has joined #RubyOnRails
[23:22:26] andybernard: hnanon: id is automatic from rails
[23:22:52] bronson: has joined #RubyOnRails
[23:22:57] hnanon: But shouldn't I see it in the params?
[23:24:13] andybernard: hnanon: no. and i solved your problem
[23:24:44] andybernard: replace @customer = @account.build_customer with @customer = @account.customer
[23:24:53] bronson: has joined #RubyOnRails
[23:24:53] andybernard: and you aren't saving @account anywhere
[23:25:11] andybernard: so save @account and don't do build_customer and you'll be fine
[23:26:30] andybernard: id doesn't get set until save so it can't possibly be in params
[23:26:36] EminenceHC: has joined #RubyOnRails
[23:26:39] bronson: has joined #RubyOnRails
[23:27:14] hnanon: Doesn't this line save @account? if @account.save
[23:27:46] andybernard: i have no idea. ive never seen it in the respond_to block before...
[23:27:56] andybernard: but if you save @account where you save @customer itll save both
[23:28:27] beauby: has joined #RubyOnRails
[23:28:35] bronson: has joined #RubyOnRails
[23:29:59] andybernard: if you save @customer before @account, the customer won't have an account_id since the account hasn't been saved
[23:30:04] DelDotB: has joined #RubyOnRails
[23:30:26] hnanon: andybernard: Thank you!
[23:30:30] bronson: has joined #RubyOnRails
[23:30:33] hnanon: It's working as expected now.
[23:30:49] andybernard: hnanon: told ya all i needed to do was create a project
[23:30:54] hnanon: Did you create a new app to test?
[23:31:10] andybernard: yes i did, then used pry to take a look at exactly what was happening
[23:31:13] hnanon: Haha. Yeah. I really appreciate your efforts and time.
[23:31:21] andybernard: it was a VERY butchered version of what you had
[23:31:42] hnanon: I need to start learning to to use pry.
[23:31:50] andybernard: no problem :p I needed something to pass the last hour of work
[23:32:18] bronson: has joined #RubyOnRails
[23:32:26] andybernard: alright, im off. glad i got it working for you hnanon
[23:32:39] hnanon: Have a good evening.
[23:32:59] Coldblackice: has joined #RubyOnRails
[23:33:54] choke: has joined #RubyOnRails
[23:34:13] bronson: has joined #RubyOnRails
[23:34:26] superlou: has joined #RubyOnRails
[23:35:19] Rubie: has joined #RubyOnRails
[23:35:50] Schalla: has joined #RubyOnRails
[23:36:08] bronson: has joined #RubyOnRails
[23:36:27] ecksit: has joined #RubyOnRails
[23:38:00] bronson: has joined #RubyOnRails
[23:39:55] bronson: has joined #RubyOnRails
[23:41:39] user1138: has joined #RubyOnRails
[23:41:51] bronson: has joined #RubyOnRails
[23:43:07] roolo: has joined #RubyOnRails
[23:43:40] ecksit: hello, i am trying to use the http accept header for "respond_to" in my rails 4.2.2 app however i cannot seem to find any worth while articles on how to do that. is someone able to point me in the right direction?
[23:43:40] bronson: has joined #RubyOnRails
[23:44:20] edwinvdgraaf: has joined #RubyOnRails
[23:44:54] bruno-: has joined #RubyOnRails
[23:45:32] bronson: has joined #RubyOnRails
[23:46:45] edwinvdgraaf: has joined #RubyOnRails
[23:47:27] bronson: has joined #RubyOnRails
[23:48:15] twilling: has joined #RubyOnRails
[23:48:53] northfurr: has joined #RubyOnRails
[23:49:17] bronson: has joined #RubyOnRails
[23:50:17] northfurr: has joined #RubyOnRails
[23:50:29] mary5030: has joined #RubyOnRails
[23:50:42] edwinvdg_: has joined #RubyOnRails
[23:51:14] bronson: has joined #RubyOnRails
[23:51:37] zedro: has joined #RubyOnRails
[23:52:37] asheinfeld: has joined #RubyOnRails
[23:53:08] helpa: has joined #RubyOnRails
[23:54:57] bronson: has joined #RubyOnRails
[23:56:54] bronson: has joined #RubyOnRails
[23:57:10] [H]unt3r: has joined #RubyOnRails
[23:58:07] nya: has joined #RubyOnRails
[23:58:51] bronson: has joined #RubyOnRails
[23:59:43] andybernard: has joined #RubyOnRails