« Back to channel list

#RubyOnRails - 29 June 2015

« Back 1 day Forward 1 day »
[00:02:55] sevenseacat: has joined #RubyOnRails
[00:03:12] thmsmtylr: has joined #RubyOnRails
[00:03:36] artto: has joined #RubyOnRails
[00:05:10] iksf: has joined #RubyOnRails
[00:06:11] pgatt: has joined #RubyOnRails
[00:06:25] workmad3: has joined #RubyOnRails
[00:08:05] iksf: has joined #RubyOnRails
[00:10:20] hotpancakes: has joined #RubyOnRails
[00:11:17] yfeldblum: has joined #RubyOnRails
[00:12:08] vasilakisfil_: has joined #RubyOnRails
[00:12:48] ariedler: has joined #RubyOnRails
[00:13:00] ashleyis: has joined #RubyOnRails
[00:15:46] ght: Question: Is it possible to load one html document at the beginning of a controller action and then another at the end?
[00:16:18] ght: So that I can render a "loading" page at the beginning of the controller action then load the actual page once complete?
[00:17:08] platosha: has joined #RubyOnRails
[00:17:23] rickmasta: has joined #RubyOnRails
[00:18:09] pontiki: ght: the only way i know to do that is to build the actual page asyncronously
[00:18:27] ght: Hmm, ok.
[00:18:28] pontiki: which means multiple ajax calls
[00:18:33] sevenseacat: do the loading part in your browser, hook into the page loading event
[00:18:58] ght: Yes, I've been researching utilizing ajax to render a "loading" page at the beginning of my controller action, since the action takes a bit to load as it retreives data from a remote API.
[00:19:00] Oog: now the question is how abstracted - could have two base classes - charge and refund that then have StripeCharge, PaypalCharge, StripeRefund, PaypalRefund etc
[00:19:11] Oog: or have a single base class of Transaction
[00:19:18] Oog: thoughts?
[00:19:33] ght: sevenseacat: Thank you. Do you happen to have an example of this exact prodcedure? I've been researching online for hours and have yet to find a working solution.
[00:19:38] ght: I'm utilizing Rails 4.2.x.
[00:19:45] ght: If not, I'll just continue researching, I appreciate the assistance.
[00:20:39] ght: I'm utilizing ajax in the view for other functionality but for some reason I don't seem able to hide / show this image for "loading" I grabbed at http://ajaxload.info/
[00:20:42] ariedler: ght: rails follows the request-response pipeline cause it is a HTTP server is why you can't render something before on the server side :)
[00:20:43] Radar: ght: What you're asking for sounds incredibly complex.
[00:21:09] ght: Radar: a "loading" page sounds incredibly complex?
[00:21:13] sevenseacat: if you're using turbolinks, you can write some js to listen to one of these events https://github.com/rails/turbolinks#events
[00:21:27] sevenseacat: eg. page:before-change, and then you can put up the loading part
[00:21:30] ariedler: sevenseacat: random note, have they fixed up Turbolinks yet?
[00:21:50] sevenseacat: if you're not using turbolinks, you can possibly just do it with jquery
[00:21:56] Radar: ght: why do you need a "loading" page? Why does your second page take so long to load?
[00:22:01] yaw: ght I think Radar finds it complex because you want Rails to send a pre-response before the real response
[00:22:40] Oog: im thinking it might be cleaner to have two base classes Payment and Refund
[00:22:42] ght: sevenseacat: Unfourtantely, I had to disable turbolinks to get this other jQuery to work
[00:23:11] ariedler: ght: why do you WANT a loading page?
[00:23:20] sevenseacat: other people are asking good questions
[00:23:34] ght: lol, it's required for what this particular project is doing. Not required, but desirable due to throttling restrictions of the remote API.
[00:23:38] ght: And the amount of data pulled.
[00:24:15] ght: They're asking the standard theoretical questions, I've already through through the process, I just need assistance with rendering a "loading" image while the controller action executes, I'll continue researching, thank you.
[00:24:36] yaw: Oog it depends on how you associate the models
[00:24:43] ariedler: ght: split it into two requests is the best method
[00:24:56] Radar: Ok everyone. ght has decided he has the best solution in mind so there's no need to help him anymore.
[00:25:02] Oog: i think i could do it either way - im thinking two base models is cleaner
[00:25:15] ght: Radar: Correct, I don't need assitance with the question I didn't ask.
[00:25:15] yaw: Oog you haven't shared any code so far so it's difficult to recommend anything ;)
[00:25:18] sevenseacat: or load the page via ajax, and that way you can use jquery_ujs's ajax events to do the same thing
[00:25:25] ght: All good, thank you for your time.
[00:25:46] ght: sevenseacat: Will research that, thank you.
[00:25:59] ariedler: sevenseacat: after many weeks of seeing your name I just realized its "seven sea cat"
[00:26:36] Oog: yaw: there is no code yet lol
[00:26:40] Oog: im trying to figure out how to do it
[00:27:08] ariedler: Oog: do it one way, fail (potentially), and learn.
[00:27:53] alexggordon: has joined #RubyOnRails
[00:28:07] urbanmonk: has joined #RubyOnRails
[00:28:35] yaymukund: has joined #RubyOnRails
[00:29:28] Oog: i actually think theyre basically the same since the base class is so minimal
[00:30:02] pontiki: i can't actually think of any reason you need a separate model based upon whether the transaction is a credit or a debit
[00:30:42] Oog: no i just realized with this MTI model the base class has an id field for each possible sub type like stripe_charge_id stripe_refund_id paypal_charge_id paypal_refund_id etc so that could get messy
[00:31:08] Oog: if i split it into two base classes each base class would have 1/2 the number of id fields and they would all be related. that might be betteer
[00:31:12] darrencauthon: has joined #RubyOnRails
[00:32:27] Oog: i think im going with two bases Payment and Refund
[00:37:07] cornerma1: has joined #RubyOnRails
[00:38:18] ariedler: pontiki: maybe credit and debit are different banks or account types :)
[00:39:17] TinkerTyper: has joined #RubyOnRails
[00:39:18] pontiki: you can store that in the model, you should at least have the transaction linked to a bank/merchant/processor and an account
[00:40:03] ariedler: pontiki: there is always a circumstance where that does not make sense :P :)
[00:40:21] pontiki: ariedler: you're just saying the obvious
[00:40:41] pontiki: but i haven't heard one
[00:41:23] charliesome: has joined #RubyOnRails
[00:42:24] ght: Question: Is it possible to set an instance variable to be utilized with a rails view via an AJAX trigger? For example, say I have a controller action that renders a view, and on $(document).ready ->
[00:42:42] ght: I automatically trigger a call to a URL on my site that processes some data.
[00:43:03] ght: Yes, disregard, I know how to do this.
[00:43:38] sevenseacat: disregarded :)
[00:44:33] Frem: has joined #RubyOnRails
[00:45:58] Rodya_: has joined #RubyOnRails
[00:46:37] Oog: does foreign_key imply index? or do i use both? t.belongs_to :order, :index => true, :foreign_key => true
[00:46:51] sevenseacat: you need to use both.
[00:47:21] pontiki: belongs_to implies the foreign_key
[00:47:30] Oog: pontiki: it doesnt i checked
[00:47:55] Oog: i mean maybe implies at the rails level but it doesnt make it at the db level
[00:48:59] pontiki: what dbms?
[00:49:18] Oog: postgres
[00:49:47] sevenseacat: belongs_to has never enforced a FK at the db level
[00:49:51] sevenseacat: and it still doesnt
[00:50:14] pontiki: in the db migration?
[00:52:04] bf4: has joined #RubyOnRails
[00:52:20] darrencauthon: has joined #RubyOnRails
[00:55:00] toretore: has joined #RubyOnRails
[00:56:19] pontiki: nope, you're right
[00:57:24] Oog: i know i was surprised too - i have to go back and add all my fks...
[00:58:24] sevenseacat: db-level foreign keys were only added in in rails 4.2
[00:58:52] alexggordon: has joined #RubyOnRails
[00:59:13] Oog: you mean foreign_key option?
[00:59:33] sevenseacat: anything to do with db-level foreign keys
[00:59:42] sevenseacat: before that they were only done in the application layer
[01:00:16] Oog: wow didnt know
[01:01:05] Oog: i guess thats why i didnt create them
[01:01:32] nickenchuggets: has joined #RubyOnRails
[01:01:32] nickenchuggets: has joined #RubyOnRails
[01:02:25] doodlehaus: has joined #RubyOnRails
[01:04:17] artto: has joined #RubyOnRails
[01:08:55] ClevelandShow: has joined #RubyOnRails
[01:09:28] ur5us: has joined #RubyOnRails
[01:16:00] bmurt: has joined #RubyOnRails
[01:19:26] graft: has joined #RubyOnRails
[01:21:40] ur5us: has joined #RubyOnRails
[01:23:32] ClevelandShow: has left #RubyOnRails: ()
[01:24:19] alexggordon: has joined #RubyOnRails
[01:25:15] beauby: has joined #RubyOnRails
[01:28:59] mrchris: has joined #RubyOnRails
[01:29:54] s2013: has joined #RubyOnRails
[01:36:23] konsolebox: has joined #RubyOnRails
[01:38:48] erich: has joined #RubyOnRails
[01:42:22] jsrn__: has joined #RubyOnRails
[01:44:16] bf4: has joined #RubyOnRails
[01:45:26] s2013: has joined #RubyOnRails
[01:45:55] chipotle: has joined #RubyOnRails
[01:46:06] ProLoser: has joined #RubyOnRails
[01:46:07] ght: FYI, in case anyone is curious, this post led me to the resolution I needed regarding loading the partial via an ajax call: http://stackoverflow.com/questions/6701623/how-to-asynchronously-load-a-partial-page-in-rails
[01:46:47] ght: Therefore the portion of the page that required the time consuming API call (that needs to be run every time the page is loaded to ensure it has the current data) can be called after the rest of the page is generated
[01:47:35] ght: The last step I'm determining is how to hide a "loading your information" div after page load, which I'll probably do by sticking that ajax call in a function executed after document ready
[01:47:49] ght: Anyway, thanks as always for the help, you guys are tremendous.
[01:48:54] frishi: has joined #RubyOnRails
[01:50:36] rickmasta: has joined #RubyOnRails
[01:55:27] workmad3: has joined #RubyOnRails
[01:55:45] baweaver: has joined #RubyOnRails
[01:56:35] sevenseacat: yeah thanks to all the guys out there for helping ght out
[01:56:44] sevenseacat: and those of you who arent guys can get stuffed
[01:56:45] bklane: has joined #RubyOnRails
[01:58:09] yfeldblum: has joined #RubyOnRails
[01:58:15] dstarh: has joined #RubyOnRails
[01:59:57] Aeyrix: sevenseacat: http://www.merriam-webster.com/dictionary/guy
[02:00:19] sevenseacat: sorry, but thats complete bullshit.
[02:00:29] Aeyrix: Oh okay, I'll inform them.
[02:01:03] sevenseacat: "guys" is a masculine term.
[02:01:06] Aeyrix: Do they have a postbox at the Massachusetts University?
[02:01:34] Aeyrix: http://www.oxforddictionaries.com/definition/english/guy
[02:01:37] Aeyrix: Or how about the Oxford University?
[02:01:44] Aeyrix: I know they have a postbox. I've visited.
[02:01:54] iamjarvo_: has joined #RubyOnRails
[02:05:03] artto: has joined #RubyOnRails
[02:06:54] PlasmaStar: has joined #RubyOnRails
[02:07:38] darrencauthon: has joined #RubyOnRails
[02:08:50] one_zero: has joined #RubyOnRails
[02:09:13] urbanmonk: has joined #RubyOnRails
[02:09:21] beauby: has joined #RubyOnRails
[02:12:23] eggoez: has joined #RubyOnRails
[02:14:00] lala_: has joined #RubyOnRails
[02:16:53] acti0nman: has joined #RubyOnRails
[02:17:49] Cache_Money: has joined #RubyOnRails
[02:19:16] hfp_: has joined #RubyOnRails
[02:20:40] l4u-: has joined #RubyOnRails
[02:21:43] hfp_work: has joined #RubyOnRails
[02:23:18] RegulationD: has joined #RubyOnRails
[02:24:34] yaymukund: has joined #RubyOnRails
[02:32:50] beauby: has joined #RubyOnRails
[02:35:10] alexggordon: has joined #RubyOnRails
[02:39:55] bklane: has joined #RubyOnRails
[02:40:47] pwnz0r: has joined #RubyOnRails
[02:43:50] pwnz0r: has joined #RubyOnRails
[02:44:28] iamjarvo: has joined #RubyOnRails
[02:49:06] findaway: has joined #RubyOnRails
[02:53:17] bruno-: has joined #RubyOnRails
[02:55:11] bf4: has joined #RubyOnRails
[02:57:03] LeoDee: has joined #RubyOnRails
[03:01:25] kies: has joined #RubyOnRails
[03:04:00] charliesome: has joined #RubyOnRails
[03:04:23] findaway: has joined #RubyOnRails
[03:05:54] artto: has joined #RubyOnRails
[03:06:39] rickmasta: has joined #RubyOnRails
[03:08:26] darrencauthon: has joined #RubyOnRails
[03:10:11] beauby: has joined #RubyOnRails
[03:10:42] creakybones: has joined #RubyOnRails
[03:12:59] braincrash: has joined #RubyOnRails
[03:16:52] Pupeno: has joined #RubyOnRails
[03:17:06] lessless: has joined #RubyOnRails
[03:19:49] fwaokda: has joined #RubyOnRails
[03:20:30] bklane: has joined #RubyOnRails
[03:23:16] michael_mbp: has joined #RubyOnRails
[03:23:50] nickenchuggets: so, I read somewhere that... rails migrations aren't always expected to be reliable, or something
[03:24:47] nickenchuggets: that between two different databases, say a development database, and a production database... it's expected for the two to become inconsistent
[03:25:08] Aeyrix: That doesn't really make sense.
[03:25:22] nickenchuggets: that's what I've read on stack overflow, which, didn't exactly make sense to me either
[03:25:25] Aeyrix: They're supposed to be identical schemas, otherwise that defeats the purpose of the environments.
[03:25:43] sevenseacat: link to this rambling nonsensical post?
[03:25:51] sevenseacat: so we can smack it down
[03:26:01] nickenchuggets: I'll see if I can find it
[03:26:04] Aeyrix: sevenseacat: Isn't it true after a point? In terms of reliability.
[03:26:15] Aeyrix: Or at least in terms of "don't use migrations now, use <x> else."
[03:26:16] sevenseacat: I dont see why it would be.
[03:26:21] sevenseacat: no. always use mugrations.
[03:26:23] Aeyrix: I'm about 80% sure that's somewhere in the rails docs.
[03:26:28] Aeyrix: Oh, okay.
[03:26:30] Aeyrix: Maaaybe the other way around.
[03:26:31] cajone: has joined #RubyOnRails
[03:26:35] sevenseacat: if you want to change a database schema, use migrations.
[03:26:39] pragmatism: +1 sevenseacat
[03:26:44] cajone: has left #RubyOnRails: ()
[03:26:55] pragmatism: Worked with Hobo too, but not a _huge_ fane.
[03:26:56] smathy: has joined #RubyOnRails
[03:27:29] nickenchuggets: well, the issue I'm having is... I have a production and development database
[03:27:35] Aeyrix: nickenchuggets: They should be identical in terms of schema.
[03:27:39] nickenchuggets: I made some changes on the development side, ran the migrations, etc
[03:27:42] Aeyrix: Also your nick is awesome, I just realised what iti s.
[03:28:01] nickenchuggets: but now... when I try to run the migrations on the production side, it tells me this one particular table doesn't exist
[03:28:14] Aeyrix: Paste the error to gist.github.com.
[03:28:20] Aeyrix: Also migrations code, please.
[03:28:28] nickenchuggets: so I'm starting to think, maybe somehow on the production side... the migration that dropped that table was already run some time in the past
[03:28:51] nickenchuggets: because the table shouldn't exist, and it doesn't, which is great, but it's holding up *all* migrations
[03:29:04] pragmatism: you can re-run a specific migration.
[03:29:06] nickenchuggets: all consecutive migrations are held up now
[03:29:18] pragmatism: up, or down.
[03:29:21] sevenseacat: or you ran a migration in development, deleted it without rolling it back, and then never ran it in production
[03:29:35] nickenchuggets: huh, interesting
[03:29:42] nickenchuggets: I think I recall something like that happening
[03:29:48] pragmatism: womp womp :)
[03:29:56] nickenchuggets: where I was like, "okay, I'm gonna delete this migration"
[03:30:04] nickenchuggets: yeah, I think I did :p
[03:30:10] pragmatism: re-run the upmigration for that table.
[03:30:42] pragmatism: (hopefully you're using a VCS)
[03:30:45] nickenchuggets: hmm, still trying to understand this
[03:31:07] nickenchuggets: so I shouldn't need to db:reset?
[03:31:11] nickenchuggets: because, I don't want to do that
[03:31:19] nickenchuggets: that seems... unnecessary and more painful
[03:31:19] pragmatism: bundle exec rake db migration:up/down <MIGRATION_TIMESTAMP>
[03:31:31] nickenchuggets: so just do the one?
[03:31:34] sevenseacat: personally, I think your dev database should always be nukable, so I would nuke it and recreate ut
[03:31:42] Aeyrix: While we're on this topic, how do you roll a DB back to zero and restart it?
[03:31:45] Aeyrix: Can you do that entirely in rake?
[03:31:48] Aeyrix: I generally jump into pg.
[03:31:53] pragmatism: Yeah. recreating a deleted table won't interrupt production traffic.
[03:31:59] pragmatism: Obviously, do your QA.
[03:32:05] nickenchuggets: well, I could... bring a copy of my production db down into development
[03:32:19] Aeyrix: Good enough, yeah.
[03:32:20] nickenchuggets: and I could nuke my dev database
[03:32:21] Aeyrix: Then it's 1 : 1
[03:32:22] pragmatism: Make sure you can duplicate the failure before you do anything.
[03:32:34] nickenchuggets: so that should bring them both to a consistent state
[03:32:40] pragmatism: Presumably :)
[03:33:02] pragmatism: Running it successfully locally first is a good idea.
[03:33:33] sevenseacat: Aeyrix: rake db:reset will drop it and recreate it, or you can roll it back with rake db:rollback VERSION=0 i think
[03:33:34] pragmatism: Ideally, you would have a staging environment that is a duplicate of your production architecture to run this on first.
[03:33:46] pragmatism: @Aeyrix it's a production issue.
[03:33:49] Aeyrix: sevenseacat: Gotcha, thanks. :D
[03:33:50] pragmatism: he can't drop.
[03:33:51] smathy: has joined #RubyOnRails
[03:33:55] pragmatism: *they can't drop
[03:33:56] Aeyrix: pragmatism: Sorry, that was tangential.
[03:33:58] Aeyrix: It was my own question.
[03:34:09] sevenseacat: its not a production issue, its a development issue.
[03:34:21] sevenseacat: they ran a migration in dev, deleted it, and mucked up their dev db.
[03:34:30] pragmatism: > nickenchuggets> so I'm starting to think, maybe somehow on the production side... the migration that dropped that table was already run some time in the past
[03:34:59] sevenseacat: [11:29:21] sevenseacat: or you ran a migration in development, deleted it without rolling it back, and then never ran it in production
[03:35:00] pragmatism: Sorry, jumped in the middle here: my understanding is that a migration isn't running in production.
[03:35:06] sevenseacat: you really did.
[03:35:07] nickenchuggets: I'm actually still not entirely sure what went wrong
[03:35:25] Aeyrix: nickenchuggets: Which DB schema is working as per your current application?
[03:35:39] nickenchuggets: that one is current and working
[03:35:41] Aeyrix: So it's your production one that is broken, correct?
[03:35:50] nickenchuggets: it's 2 migrations behind
[03:36:08] nickenchuggets: the 2 most recent ones have a status of "down"
[03:36:13] defswork: has joined #RubyOnRails
[03:36:33] sevenseacat: everyone else seems to have a handle on this. back to work for me.
[03:37:21] pragmatism: sevenseacat interested in your solution
[03:37:39] sevenseacat: [11:31:34] sevenseacat: personally, I think your dev database should always be nukable, so I would nuke it and recreate ut
[03:37:42] nickenchuggets: so if I nuke my dev db, copy production into dev... then I can sorta, fix it from there I take it
[03:38:15] nickenchuggets: then I know if I fix it on dev, it *should* be fixed on production
[03:38:25] nickenchuggets: makes sense to me
[03:38:43] pragmatism: Figure out how to back up your production DB first.
[03:39:02] pragmatism: You want a way to set things back to current production very quickl.y
[03:43:56] workmad3: has joined #RubyOnRails
[03:46:17] nickenchuggets: okay, awesome, now my dev db matches production
[03:46:55] nickenchuggets: could I now just... delete the migration
[03:47:06] nickenchuggets: the next future migration
[03:47:21] sevenseacat: if you havent run it anywhere, you can delete it
[03:47:26] sevenseacat: if you have run it, roll it back before deleting it
[03:47:37] nickenchuggets: at this point, it hasn't been run
[03:48:12] nickenchuggets: rake db:migrate:status is the same on dev and production
[03:48:17] nickenchuggets: the 2 most recent migrations are down
[03:48:34] nickenchuggets: the next migration to be run... is the one that drops a database that no longer exists in either dev or production
[03:48:46] Aeyrix: Heh, rm that.
[03:48:52] Aeyrix: hooold on
[03:48:59] nickenchuggets: although, I think I did this before
[03:49:02] Aeyrix: it drops a db that's already dropped?
[03:49:03] nickenchuggets: which is kinda weird
[03:49:10] Aeyrix: is there a migration that creates that db/
[03:49:13] lxsameer: has joined #RubyOnRails
[03:49:13] lxsameer: has joined #RubyOnRails
[03:49:14] nickenchuggets: yeah, the next 'down' migration to be run is one that drops a db
[03:49:28] sevenseacat: a db or a db table?
[03:49:34] Aeyrix: table, sorry
[03:49:43] Aeyrix: So there's a create
[03:49:48] Aeyrix: but not a delete (that has run)
[03:49:53] Aeyrix: but your table doesn't exist?
[03:50:28] jfarmer: has joined #RubyOnRails
[03:50:29] Aeyrix: There's another problem here, then.
[03:50:29] nickenchuggets: not sure how that happened
[03:50:46] nickenchuggets: I wanted to drop the table because... I renamed the table some time in the past
[03:50:52] nickenchuggets: yet this 'renamed table' lingered
[03:51:00] Aeyrix: You renamed it manually?
[03:51:05] nickenchuggets: I used a migration
[03:51:19] Aeyrix: I think we're going to have to see your migration history and your current tables schema tbh.
[03:51:50] Aeyrix: I mean if it's working, then there's really not much of a problem right now.
[03:51:55] nickenchuggets: ok, so do you want the output of rake db:migrate:status ?
[03:51:57] Aeyrix: But I imagine it may crop up when you run a complete rollout in the future.
[03:52:09] Aeyrix: I won't lie, I don't know. I was hoping someone who knew more about it could jump in. :P
[03:52:30] nickenchuggets: I'm gonna dig around just a bit more
[03:52:59] nickenchuggets: what's strange is...
[03:53:06] nickenchuggets: current schema version is the latest version
[03:53:13] nickenchuggets: yet the 2 most recent migrations are down
[03:53:20] nickenchuggets: so, that can't be right, can it?
[03:53:35] nickenchuggets: shouldn't the schema version be set to the most recent migration applied?
[03:54:12] sevenseacat: honestly, I don't even know what the problem is now.
[03:54:14] yfeldblum: has joined #RubyOnRails
[03:55:13] nickenchuggets: I think both sides have the most recent schema
[03:55:26] nickenchuggets: i.e. the schema that has had all migrations applied
[03:55:33] jfarmer: nickenchuggets Unless it's critical that the migration history remain in tact, you can always get your database schema into the correct state and consolidate all the migrations
[03:55:33] nickenchuggets: also, I use heroku
[03:55:36] nickenchuggets: so I'm wondering if...
[03:55:51] nickenchuggets: heroku did some kind of... stuff with my schema when I deployed to heroku
[03:55:55] bf4: has joined #RubyOnRails
[03:55:58] Aeyrix: Doubtful.
[03:56:02] jfarmer: nickenchuggets Odds of that are almost nil
[03:56:16] nickenchuggets: so there's no hook that fiddles with the database when deploying to heroku?
[03:56:43] nickenchuggets: I'm looking at the current db/schema.rb file and it has the same version as the very last migration (which is in 'down' status)
[03:57:00] nickenchuggets: that doesn't seem right
[03:57:16] sevenseacat: we cant see what you're looking at, you know
[03:57:50] nickenchuggets: right, I realize that
[03:58:05] sevenseacat: so how about you show us what you're looking at? paste it into a gist like you've been asked to do
[03:58:47] ProLoser: has joined #RubyOnRails
[03:58:50] nickenchuggets: maybe my code is super secret
[03:58:57] helpa: Clearly explain what is happening and create a Gist (http://gist.github.com), (formatted neatly please: http://bit.ly/1q75oia) of the code that is causing the problem you are encountering, as well as any useful output like stacktraces.
[03:58:59] JoshGlzBrk: has joined #RubyOnRails
[03:58:59] kahunaio: has joined #RubyOnRails
[03:59:17] sevenseacat: theres something in the rules about 'if your code is secret, go hire a consultant'
[03:59:28] drale2k: has joined #RubyOnRails
[03:59:36] sevenseacat: dammit helpa.
[04:00:59] nickenchuggets: I think I can figure it out
[04:03:03] Aeyrix: sevenseacat: !rule3.2
[04:03:11] sevenseacat: helpa says no.
[04:03:12] Aeyrix: I have no access though lel
[04:03:16] helpa: NO FAKE CODE. If you're under an NDA, we cannot help you with your problem. Go hire a consultant.
[04:03:26] Aeyrix: Radar: gief bot pls
[04:06:38] artto: has joined #RubyOnRails
[04:09:37] darrencauthon: has joined #RubyOnRails
[04:09:43] bklane: has joined #RubyOnRails
[04:12:22] erich: has joined #RubyOnRails
[04:12:41] RegulationD: has joined #RubyOnRails
[04:12:42] strcmp1: has joined #RubyOnRails
[04:16:14] raunicolae: has joined #RubyOnRails
[04:16:40] Radar: Aeyrix: I am not the one who gives. If you want the bot, you just have to look deep, deep into your heart and believe that you have access.
[04:16:51] Aeyrix: But what if I don't believe?
[04:17:12] Radar: try harder
[04:17:19] raunico3: has joined #RubyOnRails
[04:17:29] Aeyrix: I don't have the strength to believe in the heart of the cards.
[04:20:14] Aeyrix: it's official
[04:20:16] Aeyrix: hated by bot
[04:21:21] jglover: has joined #RubyOnRails
[04:21:39] kahunaio: has joined #RubyOnRails
[04:22:15] jglover: So, im just using devise with angular js for the first time. going through http://www.ademartutor.com/authentication-with-devise-and-angularjs/ this tutorial. Everything seems alright, except for that whenever I login it gives me a 401. Every single time, and I've checked and rechecked and made sure that the password was correct and still nothing
[04:22:25] jglover: does devise have some really really verbose logging i can turn on or something?
[04:22:44] rickmasta: has joined #RubyOnRails
[04:23:19] sevenseacat: what do your logs actually say?
[04:24:28] jglover: Started POST "/users/sign_in.json" for at 2015-06-28 21:24:05 -0700
[04:24:31] jglover: Processing by Devise::SessionsController#create as JSON Parameters: {"user"=>{"username"=>"lol@jonah.com", "password"=>"[FILTERED]"}, "session"=>{"user"=>{"username"=>"lol@jonah.com", "password"=>"[FILTERED]"}}}
[04:24:35] jglover: Completed 401 Unauthorized in 1ms
[04:24:37] jglover: oh sorry, ill make a gist next time
[04:27:39] sevenseacat: and are you sure you have that username and password correct?
[04:27:59] Radar: Why are there params[:session] AND params[:user]?
[04:28:06] sevenseacat: angular. *shrugs*
[04:28:38] _3by8: has joined #RubyOnRails
[04:28:47] jglover: i see the issue actually. I finally got a 406 after using email rather than username
[04:28:47] seuros: has joined #RubyOnRails
[04:29:03] jglover: i thought I had configured devise to auth using username but i guess not
[04:29:06] sevenseacat: so your params were wrong
[04:29:20] jglover: sevenseacat: yeah
[04:29:27] jglover: well, really i configured devise wrong
[04:29:45] Radar: heh lucky you get a 406 for that now :) In earlier versions of Devise it would just tell you "invalid email or password"
[04:30:16] jglover: I got the 406 for some other reason, a new bug to fix. But it's better than the 401.
[04:34:08] _3by8: In an ActiveRecord class called User, you can use a method, "validates", that takes a symbol as an argument, e.g. "validates :name, presence: true". I'm confused about the use of the symbol. Does it reference the key from when you created the model?
[04:36:27] jglover: iirc, the key references the model attribute, "name" in this case, in it's current state. So I can do something like: jonah = User.build(:name => nil)
[04:36:36] jglover: and then if I do jonah.valid? it will be false
[04:36:48] jglover: because of course, you have a presence validation on name
[04:37:57] jglover: does that make sense _3by8 ?
[04:38:04] _3by8: jglover: yes, thank you
[04:39:54] jglover: has joined #RubyOnRails
[04:42:41] bruno-: has joined #RubyOnRails
[04:47:04] towski_: has joined #RubyOnRails
[04:47:35] nickenchuggets: yay, I fixed it
[04:47:38] nickenchuggets: my migration issue
[04:47:58] nickenchuggets: I just rm'd the migration that was trying to drop a non-existent table
[04:48:10] bratsche: has joined #RubyOnRails
[04:48:12] frek818: has joined #RubyOnRails
[04:48:31] nickenchuggets: and... I also made sure the currently checked-in version of db/schema.rb didn't have the recent migrations applied
[04:48:55] nickenchuggets: I think I might add db/schema.rb to .gitignore
[04:49:13] nickenchuggets: which, doesn't sound right, but
[04:49:19] Radar: "# It's strongly recommended that you check this file into your version control system."
[04:49:24] Radar: from db/schema.rb
[04:49:52] Tempesta: has joined #RubyOnRails
[04:50:54] nickenchuggets: okay, so what if I have two environments, production and development, and I commit the most current db/schema.rb, and deploy to production, is the production side going to go, "welp, looks like we're already migrated up to the most recent version, nothing to do!" thus not running the migrations that need to be ran on production?
[04:51:37] nickenchuggets: because that seems to be the issue I was having
[04:51:52] nickenchuggets: or it seemed like it might have had something to do with it
[04:51:56] erich: has joined #RubyOnRails
[04:51:56] earthquake: has joined #RubyOnRails
[04:52:30] Radar: No, not true.
[04:52:33] Cache_Money: has joined #RubyOnRails
[04:52:36] nickenchuggets: in case that would have happened... what I ended up doing was not committing the most recent db/schema.rb file, saving it for later... after my production side has been migrated, *just in case* that is how the production side would react to the newest version of db/schema.rb
[04:52:40] Radar: It will check schema_migrations in the database and migrate up to what is specified in db/schema.rb (afaik)
[04:52:50] idd2d: has joined #RubyOnRails
[04:52:52] sevenseacat: here we go again
[04:52:52] Radar: or it *might* migrate up to the latest
[04:53:02] Radar: always commit db/schema.rb
[04:53:06] nickenchuggets: okay, well now it all makes sense
[04:53:21] Radar: praise Matz
[04:53:24] nickenchuggets: problem solved, myth busted, and sevenseacat can continue working
[04:53:40] raunicolae: has joined #RubyOnRails
[04:53:44] nickenchuggets: that's a wrap, folks
[04:54:06] raunicolae: has left #RubyOnRails: ()
[04:55:48] melonstorm: has joined #RubyOnRails
[04:55:55] haukur: has joined #RubyOnRails
[04:56:08] eggoez: has joined #RubyOnRails
[05:00:25] xrlabs: has joined #RubyOnRails
[05:00:38] Shoutsid: has joined #RubyOnRails
[05:01:08] Aeyrix: s n a r k
[05:07:21] artto: has joined #RubyOnRails
[05:10:20] darrencauthon: has joined #RubyOnRails
[05:14:08] alexggordon: has joined #RubyOnRails
[05:15:14] XCMer: has joined #RubyOnRails
[05:15:21] rickmasta: has joined #RubyOnRails
[05:16:40] nigelx344: has joined #RubyOnRails
[05:17:07] nigelx344: hey guys I got a question
[05:17:22] nigelx344: so when I have two databases, i only want to migrate one of them
[05:17:37] Shoutsid: has joined #RubyOnRails
[05:17:42] nigelx344: is there a way to run rake db:migrate to a certain database?
[05:18:02] asdffffff: has joined #RubyOnRails
[05:19:10] XCMer: what are the two databases, devel & production?
[05:20:28] nigelx344: Sorry I'm a noob
[05:20:38] solars: has joined #RubyOnRails
[05:20:56] XCMer: So you have 1 sqlite db, and two models...
[05:21:09] XCMer: How many migration files do you have? One for each?
[05:22:06] nigelx344: two sqlite db and two models*
[05:22:55] XCMer: Where have you added the 2 sqlite dbs?
[05:23:06] XCMer: Just want to understand the setup a bit first.
[05:23:15] arup_r: has joined #RubyOnRails
[05:23:27] nigelx344: Well, I have one db
[05:23:32] nigelx344: that holds user login/pass
[05:23:32] nothingmuch: has joined #RubyOnRails
[05:23:33] nigelx344: called User
[05:23:40] nigelx344: then I have one that holds visitor IP
[05:23:49] nigelx344: called ipdatum
[05:23:58] XCMer: So that makes 2 models
[05:24:08] XCMer: Have you edited the default database setup for rails?
[05:24:11] arup_r: can anyone help me on this? http://stackoverflow.com/questions/31108055/user99851820-expected-got-actioncontrollerparameters73867970-while-up
[05:24:24] nigelx344: No I haven't
[05:24:37] sevenseacat: then you dont have two dbs
[05:24:44] nigelx344: My goal is to run rails g migration into ipdatum
[05:24:48] sevenseacat: you have one database
[05:25:13] nigelx344: Are they called tables
[05:25:22] sevenseacat: you'll have two tables in the database, yes
[05:25:23] sevenseacat: one for each model
[05:25:52] nigelx344: Sorry for the misunderstanding im basically rushing through tutorials
[05:25:56] jas02: has joined #RubyOnRails
[05:25:57] nigelx344: and not looking closely enough
[05:25:58] XCMer: rake db:migrate VERSION=20080906120000
[05:26:03] sevenseacat: dont rush them.
[05:26:05] XCMer: allows you to run a migration up to some level
[05:26:12] XCMer: but that's something you won't need this early
[05:26:13] sevenseacat: they are as long as they need to be, for a reason.
[05:26:52] XCMer: Also, learning a bit about relational databases would help
[05:27:11] bacattak: has joined #RubyOnRails
[05:27:16] XCMer: just the basic terms, so that you can understand them when some tutorial refers to them
[05:27:26] nigelx344: Yeah, got a link on google on it
[05:27:57] nigelx344: but to execute rails g migration newValue:string
[05:28:03] nigelx344: into a certain table
[05:28:14] sevenseacat: the first argument to `rails g migration` is the name of the migration
[05:28:16] nigelx344: basically adding a column into a table
[05:28:29] sevenseacat: if you name it correctly, it will do what you want
[05:28:38] sevenseacat: or you can edit the migration to add the column to a table
[05:28:49] sevenseacat: http://guides.rubyonrails.org/active_record_migrations.html#changing-tables
[05:30:12] nigelx344: Would editing the original migration file work?
[05:30:18] hanss: does find_or_create_by skip validations when done in the console? If I do it through the view my validation errors pop up but it saves when done in console.
[05:30:37] sevenseacat: nigelx344: don't do that. create a new migration.
[05:30:41] Pupeno: has joined #RubyOnRails
[05:30:41] Pupeno: has joined #RubyOnRails
[05:30:48] sevenseacat: hanss: it does not.
[05:30:52] sandstrom: has joined #RubyOnRails
[05:30:55] seuros1: has joined #RubyOnRails
[05:31:08] nigelx344: let me try it out
[05:32:43] workmad3: has joined #RubyOnRails
[05:32:56] earthquake: has joined #RubyOnRails
[05:33:49] Tempesta: has joined #RubyOnRails
[05:35:03] nigelx344: Oh damn it works
[05:35:15] nigelx344: Yo thanks sevenseacat and XCMer ^_^
[05:35:32] jas02_: has joined #RubyOnRails
[05:35:40] dcunit3d: has joined #RubyOnRails
[05:35:50] nigelx344: Hmm is https://www.railstutorial.org/ a good guide on RoR?
[05:36:42] sevenseacat: I'm not a fan of it. I prefer R4IA. dlsclaimer: I am one of the authors
[05:36:44] helpa: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[05:37:50] nigelx344: I'll look over it doesn't seem too long
[05:37:59] nigelx344: its cool that you guys make it free :P
[05:38:08] bacattak: has joined #RubyOnRails
[05:38:19] User458764: has joined #RubyOnRails
[05:38:49] sevenseacat: 1) its not free, and 2) its a 600 page book
[05:38:51] nigelx344: i took a look again
[05:39:05] Radar: nigelx344: As one of the other authors of Rails 4 in Action: I beg you to please buy the book we spent time on :)
[05:39:06] nigelx344: i wondered through
[05:39:14] nigelx344: on the top and
[05:39:45] nigelx344: i always wonder how long it must've taken people
[05:39:53] nigelx344: to write these guides and put it into a book
[05:40:39] nigelx344: ill consider radar
[05:40:42] sevenseacat: I've been working on the project since November last year, but that was only updating and rewriting content for Rails 4.
[05:40:51] Radar: nigelx344: I've been working on Rails x in Action books since 2010.
[05:40:55] nigelx344: I have like no $ and my parents are the ones buying me stuff
[05:41:12] nigelx344: Thats crazy
[05:41:49] XCMer: But a good book is a good investment
[05:41:55] XCMer: You'll probably not require anything more than that
[05:42:02] Radar: I quit a couple of times, but I signed the initial contract in 2010.
[05:42:14] XCMer: I'm not a big fan of most of the tutorials on the web
[05:42:34] sevenseacat: ACTION doesn't quit and is seeing this thing through.
[05:42:46] sevenseacat: nigelx344: do you have a GitHub account?
[05:42:47] XCMer: Thumbs up for sevenseacat
[05:42:52] nigelx344: lol I went on railstutorial and after a chapter i started jumping around the web on how to do random stuff
[05:43:04] sevenseacat: what's your username?
[05:43:21] nigelx344: is there a way i can private message
[05:43:25] nigelx344: cause it contains my full name
[05:43:40] sevenseacat: sure. if you double click on my name it should open up a private message window.
[05:43:45] sevenseacat: depending on your client
[05:44:14] Radar: nigelx344: Go to the server window and type /msg sevenseacat <your message here>
[05:44:39] nigelx344: Thanks Radar ^_^
[05:44:53] nigelx344: the only thing i have on there
[05:44:58] nigelx344: is my chat client i was so proud of
[05:45:08] nigelx344: and some java text based game when i was starting out in programming
[05:45:38] sevenseacat: nigelx344: if you check your email, you should have an invitation to read the book on GitHub.
[05:46:31] XCMer: Thumbs up again to sevenseacat
[05:46:32] nigelx344: you guys have souce files
[05:46:39] XCMer: of course they do :P
[05:46:40] nigelx344: for every chap in the book
[05:47:04] sevenseacat: you can read them directly on GitHub, or clone the book and build a PDF/HTML/epub/etc. file locally
[05:47:20] jfarmer: has joined #RubyOnRails
[05:47:23] Shoutsid: has joined #RubyOnRails
[05:47:38] sevenseacat: if you like the book, do consider buying it. we have worked quite hard. :)
[05:48:03] Radar: nigelx344: Yes because we're not going to subject ourselves to Microsoft Word.
[05:48:15] Radar: I mean subjecting ourselves to Manning was already bad enough.
[05:48:52] Radar: I think I'd rather go walk around in Chernobyl for a day than use Word to write anything longer than an essay.
[05:49:16] XCMer: Thankfully we have a lot of text-only format
[05:49:23] sevenseacat: the complete code as shown in the book is also available here: https://github.com/rubysherpas/r4ia_examples
[05:49:28] nigelx344: do you guys work for any companies
[05:49:33] nigelx344: like google and stuff
[05:49:41] XCMer: Google works for us
[05:49:48] Radar: I work for a company called Marketplacer http://marketplacer.com/
[05:50:06] sevenseacat: I work for a Sydney-based consultancy called reinteractive. http://reinteractive.net
[05:50:15] nigelx344: DAT MOVING VIDEO BG
[05:50:36] nigelx344: yo these websites are hella
[05:50:37] baweaver: ACTION stares blankly
[05:50:45] sevenseacat: we've blown his mind.
[05:50:50] baweaver: ACTION wanders off
[05:51:04] baweaver: http://blog.tdg5.com/crafting-your-first-pry-plugin/ - This was pretty impressive, as an aside.
[05:51:04] sevenseacat: we won't mention where baweaver worls.
[05:51:18] baweaver: Sony, but anyways.
[05:51:36] Radar: Does anyone make the joke "Speak up sony?"
[05:51:39] baweaver: googling my name is going to bring it up anyways
[05:51:41] sevenseacat: I keep meaning to get better at using debuggers
[05:51:42] Radar: just out of curiousity
[05:51:51] baweaver: haven't heard that one yet.
[05:51:58] doge__: Can wait to get my hand on the book. Amazon estimated delivery date is on 11th date
[05:52:12] sevenseacat: 11th of what month? >_>
[05:52:36] sevenseacat: mmmm that ain't gonna happen
[05:52:42] nigelx344: amazon prime
[05:52:45] nigelx344: is where its at dawg
[05:53:03] yaymukund: has joined #RubyOnRails
[05:53:09] baweaver: sevenseacat is a cat, there are no dogs here
[05:53:21] baweaver: I'm a beaver
[05:53:42] doge__: Your estimated delivery date is:
[05:53:44] doge__: Saturday, July 11, 2015 -
[05:53:46] doge__: Wednesday, July 15, 2015
[05:54:16] iamjarvo: has joined #RubyOnRails
[05:54:31] doge__: 11th is saturnday so hopefully it will be delivered by the next monday
[05:54:57] XCMer: which editor do you guys use?
[05:55:03] nigelx344: never used tests
[05:55:08] nigelx344: I use sublime
[05:55:13] baweaver: http://www.amazon.com/Functional-Programming-Scala-Paul-Chiusano/dp/1617290653 - I ordered that one a bit back, we'll see how it goes.
[05:55:15] nigelx344: with that iterm2
[05:55:43] XCMer: Vim's great
[05:55:45] XCMer: Any emacs guys?
[05:56:03] baweaver: dabbled while learning Lisp and Haskell
[05:56:19] nigelx344: how old r u guys
[05:56:31] XCMer: Your age * 2
[05:56:43] null__: how do most style guides handle chaining a bunch of methods? (eg @bla = Bla.joins(:bla2).where(bla2: { :active => true }).uniq.order('blaz'))
[05:56:43] sevenseacat: about the same.
[05:56:44] krz: has joined #RubyOnRails
[05:56:48] null__: give each method its own line?
[05:56:55] sevenseacat: we're also not all guys, do remember.
[05:57:06] sevenseacat: Aeyrix: quiet you.
[05:57:06] nigelx344: ohhh sorry :$
[05:57:11] baweaver: null__: normally
[05:57:17] XCMer: null__ You can have multiple functions on a line
[05:57:24] sevenseacat: don't want to have this debate again lol
[05:57:28] XCMer: and add a new line when it extends beyond
[05:57:35] null__: okay doke thanks
[05:57:39] baweaver: null__: http://baweaver.com/blog/2015/05/04/sublime-scoping-with-rails/ - that's what I tend to do when it gets long
[05:57:47] baweaver: or involves logic checks or other shenanigans
[05:58:13] null__: that's interesting actually
[05:58:34] null__: I think I'll try doing that and see how it feels
[05:59:12] baweaver: experiment with a bit, that's just my approach to dealing with it
[05:59:36] nigelx344: i was about to go with php
[05:59:40] nigelx344: before i started ruby
[05:59:54] XCMer: Thank god for that
[05:59:57] nigelx344: but then i thought that
[06:00:00] nigelx344: ruby on rails sounded cooler
[06:00:20] sevenseacat: it does. and no-one will laugh at you for using it. except node hipsters.
[06:00:21] XCMer: The framework ppl are after today in PHP is laravel
[06:00:25] XCMer: And it's a rails clone anyway
[06:00:31] XCMer: without ruby's language features
[06:00:33] nigelx344: what about django
[06:00:34] sevenseacat: freaking node hipsters.
[06:00:40] sevenseacat: django's decent
[06:00:42] XCMer: Django is moving bakwards
[06:00:45] nigelx344: i know py more than ruby
[06:00:49] sevenseacat: is it? i havent looked for a while
[06:00:51] nigelx344: but ror is used more so
[06:00:57] XCMer: I mean, 1.7 was a big hype
[06:01:01] XCMer: but didn't add much
[06:01:02] nigelx344: and its coolio to learn a new lang
[06:01:02] baweaver: If you know Python it's not a huge jump
[06:01:16] baweaver: people still say coolio?
[06:01:24] RegulationD: has joined #RubyOnRails
[06:01:25] nigelx344: no its to mock old ppl
[06:01:26] nigelx344: fellow kids
[06:01:34] sevenseacat: learning new languages is never a waste of time
[06:01:42] sevenseacat: do kids even know who coolio is?
[06:01:51] hmsimha: has joined #RubyOnRails
[06:01:52] nigelx344: yes when something is rad!
[06:01:52] hmsimha_: has joined #RubyOnRails
[06:01:56] baweaver: sevenseacat: brainfsck, hodor, esoterics.
[06:01:58] sevenseacat: I'll take that as a no
[06:02:12] sevenseacat: baweaver: I speak fluent Hodor.
[06:02:18] baweaver: ACTION doesn't want to admit he grew up around that
[06:02:31] baweaver: sevenseacat: http://www.hodor-lang.org/
[06:02:34] nigelx344: lol Capybara
[06:02:39] yardenbar: has joined #RubyOnRails
[06:02:43] baweaver: it's in node too
[06:02:44] baweaver: just for you
[06:03:06] hanss: Cookin' with Coolio...
[06:03:15] baweaver: you want to know what all the cool kids are using?
[06:03:58] rvanlieshout: has joined #RubyOnRails
[06:04:05] baweaver: https://github.com/azac/cobol-on-wheelchair
[06:04:12] baweaver: (they took the website down ;-;)
[06:04:29] sevenseacat: yeah I heard of cobol on cogs
[06:05:33] roolo: has joined #RubyOnRails
[06:07:40] baweaver: Playing with Play, Yesod, Phoenix, and a few others for fun
[06:07:45] Radar: doge__: You're going to be disappointed if you expect the book to be shipped by July.
[06:08:40] sevenseacat: unfortunately so.
[06:08:56] Aeyrix: ACTION already has the book.
[06:08:59] sevenseacat: the typesetters are still working on it at the moment.
[06:09:19] Aeyrix: Radar: I was gonna get your latest book
[06:09:29] Aeyrix: FastMail charged me $30, delivered me nothing, and haven't refunded me yet.
[06:09:39] glennt: has joined #RubyOnRails
[06:09:43] Aeyrix: That $30 will go to book when I get it back.
[06:09:57] sevenseacat: i buy far too many books.
[06:10:02] Aeyrix: I don't buy books.
[06:10:09] Aeyrix: Except recently. :>
[06:10:27] sevenseacat: I almost need another Kindle because mine is full. :(
[06:10:42] Aeyrix: I honestly just read them in PDF form on my laptop. <_<
[06:10:59] sinkensabe: has joined #RubyOnRails
[06:11:05] darrencauthon: has joined #RubyOnRails
[06:11:25] baweaver: darrencauthon: you're up late
[06:11:49] trollga: has joined #RubyOnRails
[06:12:07] sevenseacat: I read a lot of epubs on my laptop too. technical books arent so good on the kindle.
[06:12:16] eGGsha: has joined #RubyOnRails
[06:12:29] Aeyrix: I kind of want to get a kindle.
[06:12:33] Aeyrix: Maybe one day.
[06:12:41] Aeyrix: They're p expensive when I already have a laptop.
[06:12:59] sevenseacat: a lot more portable than a laptop.
[06:13:21] Aeyrix: I always have a bag with me.
[06:13:47] Aeyrix: If I didn't, I'd consider it more.
[06:13:53] Aeyrix: e.g., Train rides to / from work.
[06:13:59] Aeyrix: But because of my hours, the train is pretty empty.
[06:14:04] sevenseacat: being a girl and shit, I carry a handbag that my Kindle is always in.
[06:14:12] Aeyrix: I misread Kindle as Knife
[06:14:15] bacattak_: has joined #RubyOnRails
[06:14:21] sevenseacat: that too. can never be too safe.
[06:14:29] Aeyrix: Habits from old West Melbourne? ;)
[06:14:38] Aeyrix: There was a fkn driveby shooting that way the other day.
[06:14:51] Aeyrix: Turning into Chicago more and more every day.
[06:14:52] sevenseacat: I never felt unsafe on the streets of Melbourne. even going to/from work in the middle of the night
[06:15:07] sevenseacat: I probably wasnt smart enough to know better.
[06:16:03] sevenseacat: used to work the evening shifts in St Kilda, then catch tram/train home
[06:16:18] baweaver: they're a bit touchy on weapons around here.
[06:16:32] Aeyrix: As long as you don't look like a tourist in St. Kilda you'll be fine.
[06:17:34] doge__: A bummer. I was hoping to be able to read it on my Rhodos trip starting on 16th of July. Given that it's safe to go at the time
[06:21:33] sevenseacat: doge__: if you had bought the ebook direct from Manning, you could be reading it right now :)
[06:21:52] eoy: has joined #RubyOnRails
[06:22:12] kirillaa: has joined #RubyOnRails
[06:23:01] kirillaa: has left #RubyOnRails: ()
[06:24:13] Ropeney: the kobo hd is great for technical epubs
[06:24:15] doge__: Shipping to Finland isn't that cheap + if I buy from outside the EU I have to pay extra taxes and have to be in contact with customs office
[06:24:37] pyface: has joined #RubyOnRails
[06:24:40] sevenseacat: always wanted to go there.
[06:24:43] doge__: Otherwise I would have bought it from Manning
[06:25:14] Ropeney: radar: Your multitenancy is proving to be a good read :) you had one formatting mistake so far though :P
[06:25:22] Radar: a mistake? IN MY BOOK?!
[06:25:26] Radar: ACTION faints
[06:25:27] Aeyrix: ACTION calls the cops.
[06:25:53] Radar: ambulance plz
[06:26:12] doge__: /kick Ropeney
[06:27:01] Ropeney: i know, i giggled after misteak though
[06:27:01] Radar: Ropeney: pg. no and maybe screenshot of the mistake plz
[06:27:14] Aeyrix: > misteak
[06:27:16] Radar: Ropeney: A few people emailed me telling me about that :)
[06:27:52] Ropeney: i can't remember page atm, was just a section of code, i expect without the markup around it
[06:27:53] Aeyrix: That reminds me, I found some kangaroo Radar.
[06:27:57] Radar: Aeyrix: :O
[06:28:06] Aeyrix: I'll find the company when I get home.
[06:28:11] Aeyrix: I got kangaroo burgers though.
[06:29:42] Ropeney: i can't remember page atm, was just a section of code, i expect without the markup around it
[06:30:04] ndrei: has joined #RubyOnRails
[06:31:34] Radar: Ropeney: Find it and Aeyrix will reward you handsomely with homecooked roo burgers.
[06:31:52] Aeyrix: Drinks are on you next meetup.
[06:32:03] Ropeney: i like the idea of a roo burger
[06:32:04] sevenseacat: you mean Aeyrix will actually attend a meetup?
[06:32:10] Aeyrix: I knew this was coming.
[06:32:24] Radar: No he'll come up with a mysterious illness again for the 3rd time in a row.
[06:32:36] tvw: has joined #RubyOnRails
[06:32:41] Aeyrix: If I get sick again I'm gonna be pissed tbh
[06:34:04] Ropeney: radar: page 25
[06:34:20] Radar: Ropeney: thanks
[06:34:55] Ropeney: radar: http://imgur.com/DgE7cqg
[06:34:57] Radar: You'd think that book would be perfect after the ~year it's been published for
[06:35:13] ur5us: has joined #RubyOnRails
[06:35:21] ur5us: has joined #RubyOnRails
[06:35:26] Ropeney: I'm happy with it, just things you spot when you read it word for word :)
[06:36:12] Aeyrix: demand refund
[06:36:15] Aeyrix: this isn't the product you paid for
[06:36:25] Ropeney: Aeyrix: I demand my roo burger
[06:36:40] Aeyrix: Standard or express mail?
[06:36:55] Ropeney: pigeon express
[06:37:14] comrad: has joined #RubyOnRails
[06:40:11] pwnz0r: has joined #RubyOnRails
[06:40:15] sevenseacat: ACTION spends an hour diagnosing and fixing a failing spec, re-runs build, two more fail
[06:40:19] sevenseacat: ACTION grinds teeth
[06:40:22] kahunaio: has joined #RubyOnRails
[06:45:06] Bertg: has joined #RubyOnRails
[06:45:52] artto: has joined #RubyOnRails
[06:47:55] robbyoconnor: has joined #RubyOnRails
[06:50:07] skroon: has joined #RubyOnRails
[06:52:40] netzfisch: has joined #RubyOnRails
[06:54:41] arBmind: has joined #RubyOnRails
[06:55:15] Rubie: has joined #RubyOnRails
[06:58:20] i: has joined #RubyOnRails
[06:58:35] Etriaph: Does anyone know if simple-captcha does indeed work with Rails 4?
[06:58:44] vasilakisfil_: has joined #RubyOnRails
[07:00:19] doodlehaus: has joined #RubyOnRails
[07:00:40] hotpancakes: has joined #RubyOnRails
[07:00:57] gauke: has joined #RubyOnRails
[07:02:31] doodlehaus: has joined #RubyOnRails
[07:04:16] Aeyrix: I'd recommend using something that hooks in to ReCAPTCHA instead, from an anti-bot security PoV.
[07:04:22] Aeyrix: https://github.com/ambethia/recaptcha/
[07:04:27] doodleha_: has joined #RubyOnRails
[07:04:40] sandstrom: has joined #RubyOnRails
[07:04:48] konsolebox: has joined #RubyOnRails
[07:06:19] doodlehaus: has joined #RubyOnRails
[07:06:20] Sylario: has joined #RubyOnRails
[07:08:14] doodlehaus: has joined #RubyOnRails
[07:10:10] doodlehaus: has joined #RubyOnRails
[07:11:48] darrencauthon: has joined #RubyOnRails
[07:12:08] doodlehaus: has joined #RubyOnRails
[07:12:31] Rukeal: has joined #RubyOnRails
[07:12:38] mike___1234: has joined #RubyOnRails
[07:12:46] sandelius: has joined #RubyOnRails
[07:13:16] alex88: has joined #RubyOnRails
[07:13:17] djellemah: has joined #RubyOnRails
[07:14:06] doodleha_: has joined #RubyOnRails
[07:14:41] krz: has joined #RubyOnRails
[07:15:59] doodlehaus: has joined #RubyOnRails
[07:17:56] doodlehaus: has joined #RubyOnRails
[07:18:26] Trefex: has joined #RubyOnRails
[07:18:37] Scriptonaut: has joined #RubyOnRails
[07:18:52] cac: has joined #RubyOnRails
[07:19:54] doodleha_: has joined #RubyOnRails
[07:20:35] User458764: has joined #RubyOnRails
[07:20:54] Etriaph: I looked at reCaptcha, simple-captcha does not require registration for an API key with Google.
[07:21:04] Etriaph: Not that I'm personally opposed, but my client might be.
[07:21:14] Etriaph: He doesn't like Google :D
[07:21:30] workmad3: has joined #RubyOnRails
[07:21:47] doodlehaus: has joined #RubyOnRails
[07:23:32] Ergo: has joined #RubyOnRails
[07:23:43] doodleha_: has joined #RubyOnRails
[07:25:39] doodlehaus: has joined #RubyOnRails
[07:27:36] doodleha_: has joined #RubyOnRails
[07:28:55] emilkarl: has joined #RubyOnRails
[07:29:00] abuzze: has joined #RubyOnRails
[07:29:29] doodlehaus: has joined #RubyOnRails
[07:30:15] sevenseacat: ACTION is deep inside service object hell
[07:30:55] darutoko: has joined #RubyOnRails
[07:31:24] doodlehaus: has joined #RubyOnRails
[07:31:37] abuzze: has joined #RubyOnRails
[07:32:19] bruno-: has joined #RubyOnRails
[07:33:10] fluchtreflex: has joined #RubyOnRails
[07:33:10] fluchtreflex: has joined #RubyOnRails
[07:33:23] doodleha_: has joined #RubyOnRails
[07:35:17] doodlehaus: has joined #RubyOnRails
[07:35:39] Scriptonaut: has joined #RubyOnRails
[07:36:59] Etriaph: Are the service objects call()ing to you?
[07:37:15] doodleha_: has joined #RubyOnRails
[07:37:34] malomalo: has joined #RubyOnRails
[07:37:44] User458764: has joined #RubyOnRails
[07:38:28] XCMer: has joined #RubyOnRails
[07:38:30] nothingmuch: has joined #RubyOnRails
[07:39:13] doodlehaus: has joined #RubyOnRails
[07:39:24] Guest60948: has left #RubyOnRails: ()
[07:40:06] ur5us: has joined #RubyOnRails
[07:40:33] workmad3: has joined #RubyOnRails
[07:41:06] doodlehaus: has joined #RubyOnRails
[07:43:00] doodlehaus: has joined #RubyOnRails
[07:44:59] doodlehaus: has joined #RubyOnRails
[07:46:54] doodlehaus: has joined #RubyOnRails
[07:48:52] doodlehaus: has joined #RubyOnRails
[07:50:18] RegulationD: has joined #RubyOnRails
[07:50:30] User458764: has joined #RubyOnRails
[07:50:44] doodlehaus: has joined #RubyOnRails
[07:51:06] sandstrom: has joined #RubyOnRails
[07:51:51] jfoxCZ: has joined #RubyOnRails
[07:52:44] doodlehaus: has joined #RubyOnRails
[07:54:37] doodleha_: has joined #RubyOnRails
[07:55:29] Benni: has joined #RubyOnRails
[07:56:34] doodlehaus: has joined #RubyOnRails
[07:57:10] hotpancakes: has joined #RubyOnRails
[07:58:32] doodlehaus: has joined #RubyOnRails
[07:58:54] sandelius: has joined #RubyOnRails
[07:58:59] jsrn_: has joined #RubyOnRails
[08:00:29] doodleha_: has joined #RubyOnRails
[08:02:23] doodlehaus: has joined #RubyOnRails
[08:04:20] doodleha_: has joined #RubyOnRails
[08:05:01] blackmes1: has joined #RubyOnRails
[08:05:18] Macaveli: has joined #RubyOnRails
[08:05:47] blackhuey: has joined #RubyOnRails
[08:05:49] hotpancakes: has joined #RubyOnRails
[08:06:14] doodlehaus: has joined #RubyOnRails
[08:08:09] doodlehaus: has joined #RubyOnRails
[08:10:06] doodlehaus: has joined #RubyOnRails
[08:11:04] krz: has joined #RubyOnRails
[08:12:01] doodlehaus: has joined #RubyOnRails
[08:12:34] darrencauthon: has joined #RubyOnRails
[08:12:40] aufi: has joined #RubyOnRails
[08:13:46] michael_mbp: has joined #RubyOnRails
[08:13:59] doodlehaus: has joined #RubyOnRails
[08:15:32] bacattak: has joined #RubyOnRails
[08:16:03] doodleha_: has joined #RubyOnRails
[08:17:49] doodlehaus: has joined #RubyOnRails
[08:19:48] doodlehaus: has joined #RubyOnRails
[08:21:45] doodleha_: has joined #RubyOnRails
[08:22:37] x-light: has joined #RubyOnRails
[08:23:22] mwangialexx: has joined #RubyOnRails
[08:23:37] doodlehaus: has joined #RubyOnRails
[08:24:37] sinkensabe: has joined #RubyOnRails
[08:25:18] marr: has joined #RubyOnRails
[08:25:35] doodleha_: has joined #RubyOnRails
[08:26:49] gaussblurinc1: has joined #RubyOnRails
[08:27:29] doodlehaus: has joined #RubyOnRails
[08:28:08] srinidhi: has joined #RubyOnRails
[08:29:26] doodleha_: has joined #RubyOnRails
[08:30:04] mhb: Hi, I am using postgresql for development. I have a model like : Subscription leader:references follower:references, however, the follower and follower foreign keys are specified as : belongs_to :leader, class_name: 'User'; belongs_to :follower, class_name: 'User' BUT when running rake db:migrate it is still trying to find a table called 'leaders' and 'followers'. Any suggestions?
[08:31:22] doodleha_: has joined #RubyOnRails
[08:31:51] sevenseacat: mhb: what is the specific error?
[08:33:17] doodlehaus: has joined #RubyOnRails
[08:33:51] x-light: has joined #RubyOnRails
[08:34:15] sevenseacat: likely something about the foreign keys, but thats a hell of a way to report a problem
[08:34:46] arBmind: has joined #RubyOnRails
[08:35:14] doodleha_: has joined #RubyOnRails
[08:36:14] mhb: sevenseacat: PG::UndefinedTable: ERROR: relation "leaders" does not exist : ALTER TABLE "subscriptions ADD CoNSTRAINT "fk_rails_a986fe9f73" FOREIGN KEY ("leader_id") REFERENCES "leaders" ("id")
[08:36:50] sevenseacat: you need to remove the reference to a foreign key that rails is adding, and substitute your own
[08:37:04] mhb: ohhhhhhhhhhhhhhhhhh
[08:37:06] sevenseacat: http://sevenseacat.net/2015/02/24/add_foreign_key_gotchas.html
[08:37:11] doodlehaus: has joined #RubyOnRails
[08:37:15] mhb: sevenseacat: thank you :)
[08:38:54] nya: has joined #RubyOnRails
[08:39:05] doodlehaus: has joined #RubyOnRails
[08:39:57] Hates_: has joined #RubyOnRails
[08:40:19] Hates_: has joined #RubyOnRails
[08:41:00] doodleha_: has joined #RubyOnRails
[08:41:57] pyface: has left #RubyOnRails: ("Leaving")
[08:42:59] doodlehaus: has joined #RubyOnRails
[08:44:56] doodlehaus: has joined #RubyOnRails
[08:46:52] doodlehaus: has joined #RubyOnRails
[08:48:48] doodlehaus: has joined #RubyOnRails
[08:49:04] IanV0rn: has joined #RubyOnRails
[08:50:32] IanV0rn: has joined #RubyOnRails
[08:50:44] doodlehaus: has joined #RubyOnRails
[08:50:49] cac: has joined #RubyOnRails
[08:52:19] curses: has joined #RubyOnRails
[08:52:39] doodlehaus: has joined #RubyOnRails
[08:52:47] nickenchuggets: has joined #RubyOnRails
[08:54:04] WhereIsMySpoon_: has joined #RubyOnRails
[08:54:35] doodlehaus: has joined #RubyOnRails
[08:55:09] DEA7TH: has joined #RubyOnRails
[08:55:37] blackmes1: has joined #RubyOnRails
[08:56:30] doodlehaus: has joined #RubyOnRails
[08:57:42] curses: Is there an easy way of creating a new table with a custom primary key? I can't seem to find any good info about it..
[08:58:00] Karpah: has joined #RubyOnRails
[08:58:24] doodlehaus: has joined #RubyOnRails
[08:58:47] hotpancakes: has joined #RubyOnRails
[08:59:17] Hates_: curses: why do you want a custom primary key?
[09:00:22] doodlehaus: has joined #RubyOnRails
[09:01:12] curses: Hates_: It's basically a list of unique values that I'm trying to map something to, I figured it would be better than having ID as the primary key
[09:02:20] doodlehaus: has joined #RubyOnRails
[09:02:37] chrissonar: has joined #RubyOnRails
[09:02:39] Hates_: curses: you can certainly do it but I don't think it's worth the hassle. here's the first result from googling, http://ruby-journal.com/how-to-override-default-primary-key-id-in-rails/
[09:02:49] weckl: has joined #RubyOnRails
[09:03:05] Hates_: curses: avoiding the normal id column isn't very Railsy in my opinion.
[09:03:22] Hates_: curses: although it's unavioidable when working with legacy tables
[09:04:12] doodlehaus: has joined #RubyOnRails
[09:04:40] chrissonar: How to blog Rails source code? Using clientside Javascript based formatter like Syntaxhighlighter or generating the (Ruby) code HTML block in the backend?
[09:04:47] curses: Hates_: I may need to rethink the structure of the tables
[09:05:30] chrissonar: With the clientside JA formatter I don't like the lazy formatting (and there is latency).
[09:05:57] chrissonar: But what is a better choice?
[09:06:10] doodlehaus: has joined #RubyOnRails
[09:06:37] hotpancakes: has joined #RubyOnRails
[09:06:51] Hates_: chrissonar: personally I have no trouble with client side
[09:06:55] Hates_: chrissonar: everyone does it
[09:07:30] frek818: has joined #RubyOnRails
[09:07:36] chrissonar: is that true? can't see the clientside formatting e.g. at Throughtbot: https://robots.thoughtbot.com/blog-in-markdown-deploy-with-webhooks
[09:07:38] pontiki: it's so easy to do server side, i never think about doing it client side
[09:07:57] chrissonar: pontiki, is there a gem out there?
[09:08:09] doodlehaus: has joined #RubyOnRails
[09:08:15] pontiki: pygments.rb, which embeds the python pygments
[09:08:38] chrissonar: pontiki, nice. I check them out.
[09:08:54] pontiki: kramdown markdown processor has support for github codefences
[09:08:54] Hates_: chrissonar: do a view source, the code isn't marked up
[09:09:02] lessless: has joined #RubyOnRails
[09:09:38] nothingmuch: has joined #RubyOnRails
[09:10:01] doodlehaus: has joined #RubyOnRails
[09:10:32] Hates_: chrissonar: they're using https://highlightjs.org/
[09:11:57] doodlehaus: has joined #RubyOnRails
[09:13:19] darrencauthon: has joined #RubyOnRails
[09:13:54] doodlehaus: has joined #RubyOnRails
[09:15:51] doodlehaus: has joined #RubyOnRails
[09:16:19] bacattak: has joined #RubyOnRails
[09:16:58] DylanJ: Anyone hiring in Germany? :D
[09:17:04] chrissonar: pontiki, the good with coderay is it is written in Ruby. have you experienced it already?
[09:17:38] chrissonar: DylanJ, where are u located?
[09:17:47] doodleha_: has joined #RubyOnRails
[09:18:25] DylanJ: chrissonar: saarbruecken currently but i'm looking at any city.
[09:19:43] doodlehaus: has joined #RubyOnRails
[09:20:54] Hates_: chrissonar: if you do use serverside, don't take the output and then bung that into Wordpress or whatever.
[09:20:55] chrissonar: DylanJ, I guess my emplayer is still hiring at Hamburg: https://www.medlinq.com/
[09:21:15] chrissonar: Hates_, its for my own blog. no wordpress.
[09:21:28] Hates_: chrissonar: yeah, but I mean don't store it as marked up
[09:21:36] bruno-: has joined #RubyOnRails
[09:21:37] chrissonar: Hates_, until now i was blogginh at google, but the latency of syntaxhighlighter sucks.
[09:21:39] doodlehaus: has joined #RubyOnRails
[09:22:09] chrissonar: Hates_, you mean the complete verbose HTML tags stuff?
[09:22:26] Hates_: chrissonar: ok good :)
[09:23:13] chrissonar: Hates_, furthermore clientside formatting lacks other clients like rss reader.
[09:23:28] brahman: has joined #RubyOnRails
[09:23:28] brahman: has joined #RubyOnRails
[09:23:33] doodleha_: has joined #RubyOnRails
[09:23:49] Hates_: chrissonar: but on the flip side, your code is no longer code
[09:24:09] Hates_: chrissonar: personally I'd rather keep my code tags just full of code
[09:24:26] Hates_: chrissonar: and leave it to the receiving end to process how they wish
[09:24:35] brahman: Morning, I am looking at integrating bootstrap into my project and was wondering which is gem most people use and why? bootstrap-sass seems to get some positive feedback.
[09:24:48] graft: has joined #RubyOnRails
[09:24:55] Hates_: brahman: yeah I'm using bootstrap-sass
[09:25:05] chrissonar: Hates_, o.k. separating source code examplaes from their explanationary text? what is the pro?
[09:25:27] doodlehaus: has joined #RubyOnRails
[09:25:53] brahman: was the decision mainly based around the css pre-processor?
[09:25:57] chrissonar: Hates_, what is the pro having code tags full of code only?
[09:27:25] workmad3: has joined #RubyOnRails
[09:27:27] doodleha_: has joined #RubyOnRails
[09:29:21] doodlehaus: has joined #RubyOnRails
[09:30:27] Hates_: brahman: yeah as we use sass
[09:30:43] Hates_: chrissonar: as you said, the code tag just has code then :)
[09:31:07] wethu: has joined #RubyOnRails
[09:31:17] doodlehaus: has joined #RubyOnRails
[09:33:27] quazimodo: if i have def foo=(foo) and i pass params with foo: "something"
[09:33:39] quazimodo: then if i do errors.add :foo, "Some reason"
[09:33:45] quazimodo: then .save should come back as nil right?
[09:33:59] chrissonar: Hates_, well the source code tag is stored with plain source code in both approaches, isn't it. the difference is rendering and parsing clientside on the one hand and parsing in the backend ans rendering on the other. Or maybe i misunderstood?
[09:34:18] waseem_: quazimodo: !foo
[09:34:18] helpa: quazimodo: Please do not use fake variables for your name such as "foo", "bar" or "x". Use the real names, as if it makes sense to you it probably will make sense to the people helping you.
[09:34:35] Hates_: chrissonar: yeah that's right
[09:34:46] Hates_: chrissonar: the only difference is what the receiving client gets
[09:35:00] quazimodo: waseem_: come on man i'm asking a simple question
[09:35:15] quazimodo: in an AR model, i add to errors via errors.add(:method_name, "Message")
[09:35:22] waseem_: quazimodo: What are you trying to do? What does the real code look like?
[09:35:23] quazimodo: this should stop save and cause save! to raise right
[09:35:45] waseem_: quazimodo: Yes, it should.
[09:36:02] chrissonar: Hates_, o.k. what is the pro for rendering unparsed source code? less HTML to send over the wire?
[09:36:20] brahman: Hates_: k thanks. Will give it a wizz.
[09:37:12] yaw: has joined #RubyOnRails
[09:38:38] quazimodo: it's being stupid
[09:39:09] quazimodo: @company.errors.add :user_emails, "Message" => @company.valid?
[09:39:15] bf4: has joined #RubyOnRails
[09:39:20] RegulationD: has joined #RubyOnRails
[09:39:23] mikecmpbll: has joined #RubyOnRails
[09:39:32] Hates_: chrissonar: the size of the html makes little difference. like I said, the pro to me is that code is the code. in the event of a client having no js and no css it's there are usual
[09:40:23] Hates_: chrissonar: there's nothing wrong with either approach, I just prefer client side
[09:40:27] chrissonar: Hates_, can you imagine a client taking advantage of code text?
[09:40:48] chrissonar: Hates_, i just want to wide my horizon.
[09:41:04] nhhagen: has joined #RubyOnRails
[09:41:27] quazimodo: this is bizzarre
[09:43:57] dici: has joined #RubyOnRails
[09:45:47] MickeySoFine: has joined #RubyOnRails
[09:47:18] Mikosuarus: has joined #RubyOnRails
[09:48:07] bruno-: has joined #RubyOnRails
[09:50:16] skroon: anyone in here using rails with single sign on between other rails apps?
[09:50:32] tno: has joined #RubyOnRails
[09:51:14] Mikosuarus: I have an event model with a menu containing courses that in turn contain dishes and I want to make a page to allow my users to choose a dish from each of those courses and record thier single selection from that course
[09:51:36] Bilbo-baggons: has joined #RubyOnRails
[09:51:42] Mikosuarus: how do I use form_for etc to do that?
[09:52:20] Mikosuarus: I've been looking at f.fields_for but that doesnt seem to get to the items the way I thought they would
[09:53:15] blackmes1: has joined #RubyOnRails
[09:53:18] mikecmpbll: Mikosuarus: can you be more specific?
[09:53:31] mikecmpbll: it's not really clear what you're unable to achieve.
[09:53:45] Mikosuarus: well , I want to show them the list of courses from that event
[09:53:51] bin_005: has joined #RubyOnRails
[09:53:53] Bilbo-baggons: hello there all. I hope you???re all doing well. I wonder if someone can point me in the right direction, I am doing a STI on my user model where i have trainers and assistant trainers, my relationships seem to be working fine, but when I try view the groups of the asssistant trainers I run into issues. I have added my gist here : https://gist.github.com/soilforlifeforms/90785ed2ab92b6a0150c you can see im still trying to get it to work in
[09:54:00] mikecmpbll: Mikosuarus: <%= @event.courses %>
[09:54:37] Mikosuarus: and have them click one of many radio buttons for the dishes so they select one dish per course
[09:54:54] mikecmpbll: right, so what are you stuck on?
[09:55:03] stardiviner: has joined #RubyOnRails
[09:55:07] Mikosuarus: mikecmpbll, @event.menu.courses
[09:55:32] IanV0rn: has joined #RubyOnRails
[09:55:35] Mikosuarus: well I'm finding it hard to visualise how I can create those radio buttons for the dishes
[09:55:50] mikecmpbll: do you know how to create a radio button?
[09:56:35] Mikosuarus: yeah but I'm not sure what the elements name would be so I can have it store which course and what dish they chose
[09:57:01] insu: has joined #RubyOnRails
[09:57:08] mikecmpbll: right, so you need to store these choices?
[09:57:19] Mikosuarus: I've never had to do a form that far across a relationship before :-S
[09:57:26] Mikosuarus: yeah mikecmpbll
[09:57:28] mikecmpbll: have you done the data model for this yet?
[09:57:55] Mikosuarus: yes its all set up and I can CRUD all of them
[09:58:11] G: I must be thinking the wrong way here, I've got a model (lets say for ease of the example) Employees, in this case, an Employee can have multiple managers, and if they are a manager multiple subordinates and I intend for it to be self-referential. I'm assuming I need a join table, but I can't wrap my head around it and my Google-Fu is sending me in circles
[09:58:22] mikecmpbll: Mikosuarus: right, so you have like, a Choice model? or something?
[09:58:24] Mikosuarus: I'm now at the stage where I've emailed to the guest to ask them to make the choices by visiting the site
[09:58:29] G: Anyone able to provide some tips/suggestions for what I should be searching for?
[09:58:42] Mikosuarus: yes I have the choice model also
[09:59:10] mikecmpbll: Mikosuarus: so you're working on the `new` and `create` actions of your choices controller
[09:59:32] eGGsha: has joined #RubyOnRails
[10:00:08] mikecmpbll: what's the schema for your choices table?
[10:00:39] Mikosuarus: I have relationships to the event, guest, menu and dish
[10:00:49] quazimodo: how do the errors that a model gets on one action (say update) get passed into a view that's rendered by another action (say edit) ?
[10:00:59] quazimodo: it surely goes into some sort of flash memory stack right?
[10:01:18] mikecmpbll: Mikosuarus: so make a form that lists the courses and dishes for that event, with radios button groups for the dishes under each course
[10:01:35] gaussblurinc1: has joined #RubyOnRails
[10:02:03] mikecmpbll: Mikosuarus: i see the problem now, it's that you're creating multiple "choices" in one form
[10:02:19] mikecmpbll: multiple forms are often awkward to do in rails, the easiest way is to create a form object that represents all the choices
[10:02:26] Mikosuarus: so how to a pass back which course those choice belong to ?
[10:02:28] mikecmpbll: and use accepts_nested_attributes_for :choices from the form object.
[10:04:37] chipotle: has joined #RubyOnRails
[10:06:03] hotpancakes: has joined #RubyOnRails
[10:06:57] seuros: has joined #RubyOnRails
[10:06:58] borkdude: has joined #RubyOnRails
[10:08:19] sandelius: has joined #RubyOnRails
[10:09:10] bin_005_h: has joined #RubyOnRails
[10:09:45] eGGsha: has joined #RubyOnRails
[10:11:05] Bilbo-baggons: Im still struggling with this STI issue, im not sure if its related to the relations or if it is how I am calling the groups, any advice mikecmpbll:? https://gist.github.com/soilforlifeforms/90785ed2ab92b6a0150c
[10:11:13] nickenchuggets_: has joined #RubyOnRails
[10:12:40] mikecmpbll: Bilbo-baggons: i know very little about STI i'm 'fraid.
[10:13:48] mikecmpbll: Mikosuarus: by the way, to see what I meant about a form object see this SO answer: http://stackoverflow.com/a/973201/1520714
[10:14:07] darrencauthon: has joined #RubyOnRails
[10:14:32] frishi: has joined #RubyOnRails
[10:14:35] bacattak: has joined #RubyOnRails
[10:17:29] curses_: has joined #RubyOnRails
[10:17:58] srinidhi: has joined #RubyOnRails
[10:18:22] ur5us: has joined #RubyOnRails
[10:20:17] gaussblurinc1: has joined #RubyOnRails
[10:20:23] rickmasta: has joined #RubyOnRails
[10:20:46] alotofnoodles: has joined #RubyOnRails
[10:22:28] Mession: has joined #RubyOnRails
[10:22:57] curses: has joined #RubyOnRails
[10:25:19] Mikosuarus: ty mikecmpbll
[10:26:35] trollga: has joined #RubyOnRails
[10:29:32] mostlybadfly: has joined #RubyOnRails
[10:33:40] Rubie: has joined #RubyOnRails
[10:34:43] trollga: has joined #RubyOnRails
[10:37:16] frg133: has joined #RubyOnRails
[10:41:01] weckl: Hi guys. I'm trying to extend functionality of a model witch is inside an engine in my application. I did require MyEngine::Engine.root.join('app', 'models', 'my_model') before the model class in my app and got new relashionships working, but can't define new methods to the class. Can anyone give me some hint. Thanks
[10:41:43] blackmes1: has joined #RubyOnRails
[10:42:35] mrchris: has joined #RubyOnRails
[10:43:00] Mia: has joined #RubyOnRails
[10:47:09] nhhagen: has joined #RubyOnRails
[10:48:04] nhhagen: has joined #RubyOnRails
[10:49:55] aufi_: has joined #RubyOnRails
[10:50:24] errakeshpd: has joined #RubyOnRails
[10:51:37] workmad3: weckl: !code
[10:51:37] helpa: weckl: 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.
[10:54:19] weckl: Sorry. https://gist.github.com/itmiguelfernandes/0bfd16d5621e88717cba
[10:54:20] aufi: has joined #RubyOnRails
[10:55:11] tenderlove: has joined #RubyOnRails
[10:55:34] Bertg: has joined #RubyOnRails
[10:55:37] weckl: I got relationships working but new_method is undefined.
[10:55:39] workmad3: weckl: ok... and how are you then trying to call that method?
[10:56:43] mbuf: has joined #RubyOnRails
[10:56:49] weckl: If I go to console, assign any user to "u" I got u.full_name working (from engine definition) but undefined on u.new_method
[10:57:21] mbuf: I am using Rails 3.2 with MySQL 5.5 and migrations work fine. But, using MySQL 5.6 in RDS causes migrations to get reverted. Has anyone faced a similar problem? http://fpaste.org/237586/ What can cause Rails migrations to get reverted?
[10:57:26] sevenseacat: you need to require your user model file
[10:57:27] rodfersou: has joined #RubyOnRails
[10:57:32] skroon: anyone here doing microsevices with rails?
[10:58:01] blackmes1: has joined #RubyOnRails
[10:58:11] weckl: sevenseacat: Isn't require Woodlock::Engine.root.join('app', 'models', 'user') doing that?
[10:58:22] sevenseacat: thats requiring the engine User model file
[10:58:38] sevenseacat: the engine one will already be loaded
[10:58:52] workmad3: weckl: the engine file is most likely being eager-loaded on boot, which means your local file will never be touched
[10:59:23] weckl: But how come new relationships are defined?
[10:59:24] TinkerTyper: has joined #RubyOnRails
[11:00:17] yaymukund: has joined #RubyOnRails
[11:01:23] weckl: https://gist.github.com/itmiguelfernandes/553d8008f0334c5f73ef
[11:02:12] bonehead: has joined #RubyOnRails
[11:02:17] workmad3: weckl: btw, this sort of thing is why it's pretty typical to namespace models in engines, and then your local customisations can do 'class User < Woodlock::User' rather than try to navigate the perils of autoloaded class names
[11:02:31] weckl: https://gist.github.com/itmiguelfernandes/ae04785a90fcc660fc5c
[11:02:40] weckl: this is user inside the engine.
[11:03:55] workmad3: you do still have issues over making sure your local models are returned though... which can be a PITA on its own
[11:04:34] workmad3: (i.e. extending models from engines, either from inheritance or through monkey-patching, sucks majorly and should ideally not be done)
[11:04:50] arup_r: has joined #RubyOnRails
[11:04:55] darrencauthon: has joined #RubyOnRails
[11:04:55] weckl: workmad3: I tried to create an --mountable engine before but got several problems when trying to integrate ActiveAdmin.
[11:05:49] arup_r: Any help on this ? http://stackoverflow.com/questions/31108055/user99851820-expected-got-actioncontrollerparameters73867970-while-up
[11:05:51] towski_: has joined #RubyOnRails
[11:06:26] cac: has joined #RubyOnRails
[11:06:42] sevenseacat: arup_r: which one's line 26?
[11:07:16] darrenca_: has joined #RubyOnRails
[11:07:43] sevenseacat: also, that code is going to be so screwed if you're missing all of the nested params
[11:08:07] arup_r: ok it is `update!` ...
[11:08:09] sevenseacat: or they're not in the right format
[11:08:54] sevenseacat: cool, so what is @booking before that line?
[11:09:03] sevenseacat: time to do some debugging instead of just posting code and going 'halp'
[11:09:37] arup_r: sevenseacat: the full method is given there
[11:09:41] alexey1: has joined #RubyOnRails
[11:09:42] arup_r: in the post itself
[11:09:46] sevenseacat: i didnt ask what the code said
[11:09:54] sevenseacat: i asked what the variable @booking is
[11:10:04] arup_r: it is a booking object
[11:10:16] sevenseacat: great, show me what it looks like
[11:10:27] sevenseacat: is it even getting used within activeadmin?
[11:10:29] arup_r: didn't get you..
[11:10:43] eGGsha: has joined #RubyOnRails
[11:10:48] sevenseacat: what's telling activeadmin that your @booking object is the one to be saved
[11:10:49] emilkarl: has joined #RubyOnRails
[11:11:12] arup_r: I have registered it as as "Booking" model
[11:11:26] weckl: Thanks anyway guys. I'll try to overcome this.
[11:11:57] sevenseacat: arup_r: so, print out what the @booking variable is
[11:12:02] sevenseacat: before the update! call
[11:12:25] arup_r: I followed it https://github.com/josevalim/inherited_resources#overwriting-actions
[11:13:22] sevenseacat: so you already said. please try answering the questions i ask, instead of just saying the same thing over and over.
[11:13:22] arup_r: ok.. I will print it to the log.. but as far as I know.. I did check it.. `raise @booking.inspect` and it shown me the booking object
[11:14:21] arup_r: the point is update! call is taking `permitted_params` method which is causing the issue.. I need to handle it.. But no idea how to do it..
[11:14:39] sevenseacat: you don't want to answer the questions, okay, nvm.
[11:14:47] arup_r: before update! I did also `permitted_params.except!(:user)` then also the same error
[11:15:06] Aeyrix: arup_r: sevenseacat is asking you simple, pointed questions to diagnose the issue.
[11:15:14] arup_r: sevenseacat: I asnwered you.. it is a booking object '
[11:15:22] mikecmpbll: arup_r: she said print it
[11:15:22] Aeyrix: Actually answer them completely instead of pretending a different question was asked.
[11:15:26] sevenseacat: [19:10:16] sevenseacat: great, show me what it looks like
[11:15:26] Aeyrix: Print it.
[11:16:21] Aeyrix: I knew something had called me to the channel.
[11:16:25] Aeyrix: Didn't think it was this.
[11:17:09] IanV0rn_: has joined #RubyOnRails
[11:17:58] sevenseacat: I don't like these kind of gems because they're a big black box and it's hard to see what they're doing. sometimes the user can also be another black box.
[11:18:03] arup_r: leave it guys.. I'll figure it out by myself..
[11:18:38] Aeyrix: When you want to follow simple instructions instead of typing lots of useless text and then implying the channel isn't helpful, feel free to return.
[11:18:40] errakeshpd: is there any way to initialize 2D array ( myarray = [[],[]],[[],[]] ) 4x4 array
[11:19:03] arup_r: Aeyrix: can you shut up please ?
[11:19:09] sevenseacat: arup_r: watch it.
[11:19:13] Aeyrix: errakeshpd: Of a certain size or arbitrary?
[11:19:38] arup_r: sevenseacat: its ok.. I'll figure out..
[11:19:46] errakeshpd: 4X4 matrix type
[11:20:00] sevenseacat: have fun. like Aeyrix, if you actually want some help instead of nonsensically rambling, feel free to return.
[11:20:03] Detch: has joined #RubyOnRails
[11:20:07] arup_r: I need to check what's going on inside thr `update!` method.. What you are saying I already did last night..
[11:20:08] sevenseacat: *like he said
[11:20:58] Aeyrix: a = [[a, b], [c, d]]
[11:21:12] arup_r: yeah!... I am too lazy to do what I already did.. I just wanna to know is there any other way you guys do this..
[11:21:15] Aeyrix: a[0][1] gets b
[11:22:37] errakeshpd: Aeyrix: its working, any other way ? if for 10X10 ? size should able to mention (row,column) instead of putting brackets
[11:22:49] Aeyrix: Probably yeah.
[11:22:58] symbol: has joined #RubyOnRails
[11:23:03] Aeyrix: Why is there no irb for Android
[11:23:14] eGGsha: has joined #RubyOnRails
[11:23:28] diegoviola: has joined #RubyOnRails
[11:23:52] Aeyrix: >> 1.class
[11:23:56] Aeyrix: Okay wrong chan
[11:24:32] yaymukund: has joined #RubyOnRails
[11:24:38] waseem_: Aeyrix: There is. There is this gem called Calabash that is used to write acceptance tests for Android and iOS applications. It provides a way to interact with the application in an IRB session.
[11:24:39] Aeyrix: errakeshpd Array.new
[11:24:46] arup_r: errakeshpd: we do have Array and Matrix in Ruby.. no 2D/3D array.. rather array of arrays
[11:24:55] ur5us: has joined #RubyOnRails
[11:25:12] arup_r: I meant Core Ruby
[11:25:18] Aeyrix: a = Array.new(10)
[11:25:22] Aeyrix: Fuck it getting my laptop
[11:25:28] Aeyrix: I have the solution but I can't type it
[11:26:10] arup_r: Array.new(10) { [[],[]],[[],[]] }
[11:26:15] arup_r: Aeyrix: ^^
[11:26:28] curses_: has joined #RubyOnRails
[11:26:38] pontiki: i found a table in our project that doesn't have timestamps.
[11:26:40] symbol: has joined #RubyOnRails
[11:26:54] waseem_: pontiki: A join table?
[11:27:00] sevenseacat: pontiki: it happens.
[11:27:09] pontiki: no, waseem_, and actual model :(
[11:27:18] pontiki: thoughts? add them? leave it be?
[11:27:24] sevenseacat: one project I worked on didnt have them on any tables.
[11:27:24] waseem_: pontiki: Time to write a migration then.
[11:27:38] sevenseacat: was a nightmare to try and trace through
[11:28:01] sevenseacat: 'hmm, the data in this record is in a shit state, when was it last updated? whoops, dont know'
[11:28:04] RegulationD: has joined #RubyOnRails
[11:28:45] pontiki: if i migrate, what should i set existing null values to?
[11:29:01] sevenseacat: leave them, I think
[11:29:05] bmurt: has joined #RubyOnRails
[11:29:18] pontiki: i'd be creating them in the migration
[11:29:25] sevenseacat: better to have no data than wrong data
[11:29:28] Aeyrix: if anyone ever says I'm not dedicated
[11:29:29] Aeyrix: to this shit
[11:29:31] Aeyrix: errakeshpd: arr = Array.new(10).each { |a| a = Array.new(10) }
[11:29:33] Aeyrix: Will create a 10x10 array.
[11:29:37] waseem_: pontiki: Depends if those are used to make some critical decision in business logic.
[11:29:55] pontiki: waseem_: obviously, they can't be now since they don't exist
[11:30:05] pontiki: i'm afraid someone in the future might not know that
[11:30:22] Aeyrix: errakeshpd: Of course I'm a readability pedant so I use
[11:30:23] waseem_: pontiki: So those were not used so far. What will happen if you initialize it with nil or now()?
[11:30:37] Aeyrix: as opposed to {|a| }
[11:30:43] Aeyrix: but that's just personal preference
[11:30:44] lapide_viridi: has joined #RubyOnRails
[11:32:07] pontiki: i think either way, there's possibilities for future failure
[11:32:34] Aeyrix: waseem_: Turns out Ruboto IRB is what I was after.
[11:32:41] Aeyrix: But I can't type code for shit on a touchpad that has Swiftkey.
[11:33:16] pontiki: i'm going go with setting the fields to now() in existing records, and document the shit out of it
[11:33:33] waseem_: Aeyrix: Ruboto looks nice.
[11:33:41] arup_r: waseem_: Hi
[11:33:47] quazimodo: has joined #RubyOnRails
[11:33:48] waseem_: arup_r: Hello
[11:34:46] workmad3: Aeyrix: yeah, I don't think any phone keyboard is good for code atm
[11:34:56] Aeyrix: workmad3: I will forever miss BlackBerry physicals.
[11:35:02] waseem_: workmad3: Not even blackberry?
[11:35:02] Aeyrix: idc what anyone says
[11:35:17] Aeyrix: waseem_: Blackberry has gotten garbage.
[11:35:25] workmad3: waseem_: my giant sausage fingers don't cope well with tiny physical keyboards
[11:35:26] waseem_: Although I have written code on my cellphone only once.
[11:35:42] waseem_: workmad3: Use chopsticks. :)
[11:35:46] arup_r: waseem_: Thanks Man. Saying "Hlo".. :) I was just checking if you are active.. :)
[11:36:02] artto: has joined #RubyOnRails
[11:36:07] workmad3: waseem_: but then I'd be reduced to hen-pecking speeds like the rest of the mundanes :P
[11:36:24] waseem_: workmad3: You'll be called the surgeon coder.
[11:36:40] Bertg: has joined #RubyOnRails
[11:37:42] workmad3: waseem_: at least with the on-screen keyboards, they have decent enough heuristics now that my giant sausage fingers don't impact too much... it's pretty good at going "Yup, there's the centre of that sausage, and it's over the k"
[11:38:10] workmad3: waseem_: also, I can't remember... where did they throw symbols on the blackberry physical keyboards?
[11:38:57] waseem_: workmad3: They have a shift key for that. So other keys can be used to type symbols in.
[11:39:35] workmad3: waseem_: but... my little finger is my shift key, and that covers half the keyboard on a mobile!
[11:39:42] waseem_: workmad3: It wont be as fun as a regular sized keyboard though. But when you're on the move or have to do a hotfix while you're pooping. It'll just work.
[11:39:56] waseem_: workmad3: !PEBKAC
[11:40:15] helpa: PEBKAC: Problem Existing Between Keyboard And Chair. Also known as "User Error"
[11:40:18] workmad3: waseem_: I cope OK on Swype on my phone when I do something like chat code on skype on the go :)
[11:40:52] iamjarvo: has joined #RubyOnRails
[11:40:52] waseem_: workmad3: I'd be never be able to do that. :(
[11:41:52] startupality: has joined #RubyOnRails
[11:42:03] yash: has joined #RubyOnRails
[11:43:02] jamiely: has joined #RubyOnRails
[11:44:35] hardtail: has joined #RubyOnRails
[11:51:24] hotpancakes: has joined #RubyOnRails
[11:51:53] shortCircuit__: has joined #RubyOnRails
[11:53:13] shortCircuit__: my shortlists table has profile_id and user_id, have to select the users for a given profile.. I am doingProfile.find(4).shortlists.includes(:user).collect(&:user) , what is a better way. not using collect
[11:53:27] shortCircuit__: rvanlieshout hiiii, how are you!!
[11:53:36] rvanlieshout: User.joins(shortlists: :profile).where(profiles: { id: 4 })
[11:54:20] shortCircuit__: you are a zedi in writing query *bows*
[11:55:08] rustymyers: has joined #RubyOnRails
[11:55:11] Bilbo-baggons: hey there guys, I am trying to build an STI, busy working in my console, but am struggling to get it right. The relations work (trainer > assistant_trainer), but when I try look at the info recorded by the assistant trainers I am having issues. If anyone can point me in the right direction, even what I sohuld be googleing, I would be very thankful. https://gist.github.com/soilforlifeforms/90785ed2ab92b6a0150c
[11:55:19] Aeyrix: You're trying to build a what?
[11:55:58] rvanlieshout: Bilbo-baggons: what's the issue?
[11:56:37] sandelius: has joined #RubyOnRails
[11:56:46] shortCircuit__: how did that work? shortlists: :profile
[11:56:57] rvanlieshout: user has association shorlists
[11:57:00] rvanlieshout: shortlist has association profile
[11:57:10] rvanlieshout: joins to enforce an inner join
[11:57:13] rvanlieshout: cause it should exist
[11:57:13] AugustoCesar: has joined #RubyOnRails
[11:57:18] sevenseacat: shortCircuit__: http://guides.rubyonrails.org/active_record_querying.html#using-array-hash-of-named-associations
[11:57:24] Bilbo-baggons: ok so both trainers and assistant trainers are users. as you can see from the model, and users have groups. so I would like to be able to do trainer.assistant_trainers.groups but this isn???t working. I thought maybe I needed to go trainer.assistant_trainers.each but also didn???t work
[11:57:49] rvanlieshout: Bilbo-baggons: trainer.assistan_trainers.map(&:groups)
[11:58:02] rvanlieshout: that .each might just work, but you're not doing anything with it
[11:58:21] sbhatore1: has joined #RubyOnRails
[11:58:38] Bilbo-baggons: rvanlieshout: thank you so much
[11:59:01] rvanlieshout: although that's not something you want to do in your real code
[11:59:04] arup_r: has joined #RubyOnRails
[11:59:05] rvanlieshout: it's ok for a console, but it's inefficient
[11:59:29] Bilbo-baggons: how would one do it in real code?
[11:59:42] curses: has joined #RubyOnRails
[11:59:45] pabloh: has joined #RubyOnRails
[11:59:51] rvanlieshout: that depends on what you want to get
[11:59:54] Bilbo-baggons: any documentation woud be highly apprechiated
[12:00:13] rvanlieshout: Group.joins(:user).where(users: { id: trainer.assistant_trainer_ids })-ish
[12:00:14] Bilbo-baggons: essentially what I want to allow is that trainers can view and edit assistant trainers data
[12:00:30] rvanlieshout: get it to work first :)
[12:02:40] sbhatore: has joined #RubyOnRails
[12:03:41] abuzze_: has joined #RubyOnRails
[12:04:23] Papierkorb: has joined #RubyOnRails
[12:05:47] ekain: has joined #RubyOnRails
[12:06:09] hotpancakes: has joined #RubyOnRails
[12:06:40] thmsmtylr: has joined #RubyOnRails
[12:07:36] erich: has joined #RubyOnRails
[12:07:36] IanV0rn2341: has joined #RubyOnRails
[12:07:48] XCMer: has joined #RubyOnRails
[12:10:18] anthonys: has joined #RubyOnRails
[12:11:44] wethu: has joined #RubyOnRails
[12:12:50] shortCircuit__: there is another my profile has name, father_name, mother_name, city, I am trying to override those methods and return a titleized value http://pastie.org/private/y8z3scrxoh35quqdvgzw .. but Profile.first.name is doing something starnge :P
[12:13:42] rvanlieshout: why not save them properly?
[12:14:02] rvanlieshout: read_attribute(attr).titelize
[12:14:08] rvanlieshout: send will call the same method again
[12:14:10] shortCircuit__: oh, self.send is recursilve ..
[12:14:23] rvanlieshout: but it's better to save them right
[12:14:32] rvanlieshout: then to process them over and over again
[12:15:00] brahman: Is it possible to have a nested resource withouth the common CRUD routes created for the parent resource? I am using devise to control the authentication of the admin users and just want to have the routes for /admins/:admin_id/users/:user_id/tasks/:id .
[12:15:21] shortCircuit__: yeah I should do that ..
[12:15:41] rvanlieshout: brahman: resources :foobar, only: []
[12:17:08] shortCircuit__: oh.. now I get it, I got it wrong , it will be titleized while saveing.. :P checking write_attribute sorry
[12:17:22] rvanlieshout: change those attributes before_save
[12:17:25] rvanlieshout: in a before_save callback
[12:18:19] shortCircuit__: yeah.. I did that, but since it was lot of similar code so I was thinking of define_method
[12:18:54] rvanlieshout: use the same iteration in the before_save
[12:19:11] rvanlieshout: self.send("#{attr}=", send(attr).titelize)
[12:19:14] brahman: rvanlieshout: That seems to have done the trick.
[12:19:34] krz: has joined #RubyOnRails
[12:20:54] User458764: has joined #RubyOnRails
[12:21:42] Axy: has joined #RubyOnRails
[12:23:53] emilkarl: has joined #RubyOnRails
[12:27:07] camonz: has joined #RubyOnRails
[12:27:47] hardtail: has joined #RubyOnRails
[12:28:15] sankaber: has joined #RubyOnRails
[12:28:30] jschoolcraft: has joined #RubyOnRails
[12:32:23] bruno-: has joined #RubyOnRails
[12:32:57] VaibhavRajput: has joined #RubyOnRails
[12:33:07] VaibhavRajput: has left #RubyOnRails: ()
[12:33:45] jkamenik: has joined #RubyOnRails
[12:34:34] IanV0rn2341: has joined #RubyOnRails
[12:35:13] startupality: if one controller function (inlucidng all the function it calls) seems slow, and i want to speed things up systematicallly by benchmarking before and after, what is the most convient method to do this?
[12:36:20] IanV0rn2_: has joined #RubyOnRails
[12:37:16] startupality: has joined #RubyOnRails
[12:37:26] bruno-: has joined #RubyOnRails
[12:37:37] roolo_: has joined #RubyOnRails
[12:38:44] Valien: has joined #RubyOnRails
[12:39:35] dstarh: has joined #RubyOnRails
[12:40:00] bf4: has joined #RubyOnRails
[12:40:50] IanV0rn2341: has joined #RubyOnRails
[12:43:57] RegulationD: has joined #RubyOnRails
[12:45:12] cornerma1: has joined #RubyOnRails
[12:46:15] bhorn1: has joined #RubyOnRails
[12:46:55] ldnunes: has joined #RubyOnRails
[12:46:58] sinkensabe: has joined #RubyOnRails
[12:47:09] k4nd4lf: has joined #RubyOnRails
[12:48:32] thelastinuit: has joined #RubyOnRails
[12:48:49] brahman: rvanlieshout: Thanks for that, not sure why I didn't think about using that. Lots to get my head round in RoR. All working as expected now.
[12:48:55] emilkarl: has joined #RubyOnRails
[12:50:12] Ropeney: has joined #RubyOnRails
[12:54:50] errakeshpd: arup_r: Aeyrix: The both idea doesn't works.
[12:56:46] bmurt: has joined #RubyOnRails
[12:59:47] bf4: has joined #RubyOnRails
[13:00:49] iamjarvo: has joined #RubyOnRails
[13:01:38] sbhatore: has joined #RubyOnRails
[13:02:44] mrchris: has joined #RubyOnRails
[13:04:26] charliesome: has joined #RubyOnRails
[13:08:12] albatross1: has joined #RubyOnRails
[13:08:29] mike___1234: has joined #RubyOnRails
[13:09:05] pedrosnk: has joined #RubyOnRails
[13:10:50] nfk: has joined #RubyOnRails
[13:11:17] darrencauthon: has joined #RubyOnRails
[13:11:34] Lightsword: has joined #RubyOnRails
[13:11:50] bruno-: has joined #RubyOnRails
[13:14:30] p1k: has joined #RubyOnRails
[13:14:45] eGGsha: has joined #RubyOnRails
[13:14:49] Benni: has joined #RubyOnRails
[13:14:54] p1k: I have a question about transaction rollbacks
[13:15:19] sinkensabe: has joined #RubyOnRails
[13:15:20] p1k: so as far as I understand nesting a transaction raising an error will unroll the parent - unless the exception is handled
[13:15:44] p1k: e.g. raise ActiveRecord::Rollback will be handled --
[13:16:22] drale2k: has joined #RubyOnRails
[13:16:23] p1k: Why is the nested transaction in which the exception is raised also committed though in the later case (https://github.com/rails/rails/blob/4-2-stable/activerecord/lib/active_record/transactions.rb#L166)
[13:18:08] garrypolley: has joined #RubyOnRails
[13:18:44] rvanlieshout: cause not all db engines can handle nested transitions properly
[13:20:28] p1k: so this is because e.g. postgres cannot do a partial rollback without savepoints? but what is rails part in this?
[13:20:33] curses_: has joined #RubyOnRails
[13:20:58] p1k: rvanlieshout: does it literally ignore the exception and continue with the parent transaction if it cannot rollback the child then?
[13:21:25] rvanlieshout: that's a per database thing
[13:21:32] oflannabhra: has joined #RubyOnRails
[13:21:59] blackmes1: has joined #RubyOnRails
[13:22:36] Rubie: has joined #RubyOnRails
[13:23:00] p1k: but what happens to the exception? Does it literally get caught and ignored ?
[13:23:22] nhhagen: has joined #RubyOnRails
[13:23:39] rvanlieshout: the exception is handled by ruby and the db connection could get closed for that matter.
[13:23:47] iamse7en: has joined #RubyOnRails
[13:24:13] coderhs: has joined #RubyOnRails
[13:24:45] IanV0rn2_: has joined #RubyOnRails
[13:25:17] dyoung_: has joined #RubyOnRails
[13:25:19] albatross1: has left #RubyOnRails: ()
[13:26:40] IanV0rn2_: has joined #RubyOnRails
[13:26:51] p1k: rvanlieshout: but that's not the case if the parent has sql after the exception it gets run, and even the sql within the nested block is kept
[13:27:17] rvanlieshout: and what queries are sent to the db?
[13:27:17] p1k: even though if you raise a non-handled exception the entire nested set does get rolled back
[13:27:23] rvanlieshout: it should contain a ROLLBACK
[13:27:51] p1k: the rollback isn't set to the db?
[13:27:52] curses: has joined #RubyOnRails
[13:27:57] p1k: unless I'm missing something
[13:28:02] rvanlieshout: does the log contain it?
[13:28:20] IanV0rn2341: has joined #RubyOnRails
[13:28:40] doodlehaus: has joined #RubyOnRails
[13:28:47] fwaokda: has joined #RubyOnRails
[13:29:26] hotpancakes: has joined #RubyOnRails
[13:29:36] p1k: raise ActiveRecord::ConnectionTimeoutError will Rollback
[13:29:44] p1k: or raise 'foo' for that matter
[13:30:03] IanV0rn2341: has joined #RubyOnRails
[13:30:56] p1k: but raise ActiveRecord::Rollback quite distinctly triggers no Rollback once-so-ever in a nested block
[13:31:35] IanV0rn2341: has joined #RubyOnRails
[13:31:47] commondream: has joined #RubyOnRails
[13:31:51] alotofnoodles: has joined #RubyOnRails
[13:33:09] iamjarvo: has joined #RubyOnRails
[13:33:10] p1k: so is it a rails policy to ignore nested block Rollbacks ? it is documented but I'm having trouble understanding what's behind this and how this fits in with other errors which could be raised
[13:34:26] adanramone: has joined #RubyOnRails
[13:34:52] NiVanc: has joined #RubyOnRails
[13:35:05] ruv: Hey, I am having an issue with creating a new record inside of a model.
[13:35:06] ruv: https://gist.github.com/ruv123/c061112277d7ecc56a27
[13:35:34] ruv: for some reason no matter what I do the create always is evaluating to try.
[13:35:37] ruv: err true
[13:35:51] bratsche: has joined #RubyOnRails
[13:36:33] DylanJ: ruv: why do you think it should return false?
[13:36:55] DylanJ: you only have three validations
[13:36:56] ruv: DylanJ, the record does not exists in the db
[13:37:16] ruv: if self.operatingsystem_id.nil?
[13:37:32] commondream: has left #RubyOnRails: ()
[13:37:38] sevenseacat: thats a mess of code and you're not calling create anywhere
[13:38:08] NiVanc: Hey, I'm just beginning with Rails and had a question about tests. I have a created a controller static_pages. Now I want to test that the link to my sign up page works but I can't get it to work. See gist file: https://gist.github.com/NiVanc/4a45320ff38d94d45da1
[13:38:13] ruv: sevenseacat, yeah I am
[13:38:19] elaptics: ruv: the final statement from the lookup_os is returning truthy
[13:38:19] NiVanc: Anyone that could tell me how to resolve this?
[13:38:37] sevenseacat: ruv: not in that code
[13:38:47] elaptics: sevenseacat: in the lookup_os method - line 22
[13:38:59] sevenseacat: oh that create
[13:39:00] ruv: self.operatingsystem_id = Operatingsystem.create
[13:39:03] sevenseacat: thats vague as shit
[13:39:04] elaptics: ruv: that call to create is returning an object which you're trying to assign to an id
[13:39:20] ruv: but it it never creates
[13:40:13] sevenseacat: are you sure?
[13:40:15] elaptics: well if/when it does it'll be wrong - don't try to assign to the id - assign objects, i.e. self.operatingsystem = Operatingsystem.create
[13:40:32] elaptics: ruv: need to see the operatingsystem class code
[13:41:01] elaptics: could you please add syntax highlighting to the gist too so it's easier to understand
[13:41:06] sevenseacat: theres so much wrong with that code
[13:41:18] sevenseacat: all those attr_accessors will make everything not work
[13:41:44] ruv: so this is an api and I am really new to ruby/rails
[13:42:38] VaibhavRajput: has joined #RubyOnRails
[13:42:53] rvanlieshout: p1k: i would expect rails to send it to the db
[13:42:54] rvanlieshout: what db engine?
[13:43:28] p1k: rvanlieshout: it doesn't this behaviour is documented
[13:43:30] rvanlieshout: no it shouldn't
[13:43:37] rvanlieshout: yeah i see now
[13:43:38] p1k: but it's rather surprising
[13:43:58] ruv: its working now that I removed validations from the operatingsystem model
[13:44:28] rvanlieshout: or use that requires_new?
[13:44:51] RegulationD: has joined #RubyOnRails
[13:45:41] atal421: has joined #RubyOnRails
[13:46:08] rvanlieshout: or switch to ms-sql
[13:49:56] benhuda: has joined #RubyOnRails
[13:51:18] alex88: has joined #RubyOnRails
[13:51:21] wethu: can anyone tell me, or link to good info on what triggers Sprockets::Rails::Helper::AssetFilteredError ?
[13:51:50] sevenseacat: assets being filtered, by the sounds of it.
[13:52:04] emilkarl: has joined #RubyOnRails
[13:52:11] sevenseacat: linking to a file that isnt included in the precompile list
[13:52:22] wethu: so just using anything like image-url it knows
[13:52:38] sevenseacat: images are automatically precompiled.
[13:56:50] wethu: Just a bit confused in config/initializers/assets.rb # Precompile additional assets. application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
[13:57:04] Leef_: has joined #RubyOnRails
[13:57:31] centrx: has joined #RubyOnRails
[13:57:43] wethu: well it complains that app/assets/home.css.scss needs to include home.css in the config.assets.precompile array
[13:57:58] sevenseacat: if you're linking to it directly, then yes.
[13:58:11] wethu: ahhhhhhh! thanks
[13:58:14] sevenseacat: like i said, linking to a file that isn't included in the precompile array and therefore filtered out
[13:59:06] wethu: yeah I'm linking based on controller. that makes sense!
[13:59:19] sevenseacat: yeah dont do that
[14:00:44] wethu: can i ask why thats so bad? apart from the sprockets filtered exception ? curious
[14:01:22] sevenseacat: its kinda pointless
[14:01:27] startupality: has joined #RubyOnRails
[14:01:47] sevenseacat: split things up by function or module, but not by controller
[14:02:11] silas: has joined #RubyOnRails
[14:02:31] axl__: has joined #RubyOnRails
[14:02:57] alexggordon: has joined #RubyOnRails
[14:03:16] darrencauthon: has joined #RubyOnRails
[14:04:15] drale2k: has joined #RubyOnRails
[14:06:23] ramortegui: has joined #RubyOnRails
[14:07:58] hotpancakes: has joined #RubyOnRails
[14:08:06] rjno: has joined #RubyOnRails
[14:09:53] chouhoulis: has joined #RubyOnRails
[14:10:09] mrchris: has joined #RubyOnRails
[14:11:03] chouhoulis: has joined #RubyOnRails
[14:12:26] digitalknk: has joined #RubyOnRails
[14:14:05] sandelius: has joined #RubyOnRails
[14:14:21] ashleyis: has joined #RubyOnRails
[14:14:39] User458764: has joined #RubyOnRails
[14:16:31] eggoez: has joined #RubyOnRails
[14:16:53] RegulationD: has joined #RubyOnRails
[14:20:38] Lightsword: has joined #RubyOnRails
[14:21:05] brahman: has joined #RubyOnRails
[14:21:05] brahman: has joined #RubyOnRails
[14:21:47] brahman: Do you organise all common partials inside a app/views/common directory?
[14:22:36] blackmes1: has joined #RubyOnRails
[14:23:14] Palsson_: has joined #RubyOnRails
[14:23:15] werelivinginthef: has joined #RubyOnRails
[14:23:51] Bilbo-baggons: has joined #RubyOnRails
[14:25:17] chelbs: has joined #RubyOnRails
[14:25:20] brahman: sevenseacat: am looking at putting navigation into a partial to assist writing other views. Where would you put that in app/views/nav/_navbar.html.erb?
[14:25:45] kies: has joined #RubyOnRails
[14:26:04] sevenseacat: typically in the app/views/application folder
[14:27:07] bmurt: has joined #RubyOnRails
[14:27:25] tenderlove: has joined #RubyOnRails
[14:27:53] jkamenik: has joined #RubyOnRails
[14:28:13] brahman: sevenseacat: I do not have that folder. I have app/views/layouts/
[14:28:27] brahman: sevenseacat: are you creating the application folder?
[14:28:35] sevenseacat: if it doesnt exist, then yet.
[14:28:52] brahman: k thanks. will create app/views/application/
[14:28:55] ddv: there is a command called mkdir
[14:29:16] brahman: ddv: ah thanks. That was obviously my next question! :)
[14:29:23] FCser: has joined #RubyOnRails
[14:29:39] brahman: ACTION wonders if the sarcasms was missed
[14:30:28] DaniG2k: has joined #RubyOnRails
[14:30:38] FCser: has joined #RubyOnRails
[14:30:59] DaniG2k: if you were interviewing someone for a rails dev job
[14:31:10] DaniG2k: junior/mid level
[14:31:16] DaniG2k: what kinds of questions would you ask
[14:31:23] sevenseacat: i wouldnt. im not an interviewer.
[14:31:38] DaniG2k: I have an interview coming up
[14:31:39] DaniG2k: trying to prep
[14:32:12] DaniG2k: one company in the past asked me to make a Rails app like bit.ly
[14:32:15] DaniG2k: that shortens urls
[14:32:18] DaniG2k: totally bombed it
[14:32:22] sevenseacat: I haven't interviewed in many years, so
[14:32:34] DaniG2k: sevenseacat: are you freelance?
[14:32:59] sevenseacat: I just haven't been asked to do traditional interviews
[14:33:50] DLSteve: has joined #RubyOnRails
[14:35:43] JohnBat26: has joined #RubyOnRails
[14:37:35] DaniG2k: sevenseacat: if you'd made a quick prototype for a bit.ly like service
[14:37:39] DaniG2k: how would you have tackled it?
[14:38:11] DaniG2k: i made a scaffolding with a url:string field
[14:38:19] DaniG2k: so i can take a string
[14:38:36] sevenseacat: have a Link model that has a url and a shorturl field
[14:38:45] sevenseacat: and maybe a hits field
[14:39:03] alol: has joined #RubyOnRails
[14:39:09] DaniG2k: then I stupidly spent the rest of the time trying to figure out how to assign each url a uniqe identifier
[14:39:26] DaniG2k: I tried with the last 5 digits of MD5 but came into all sorts of difficulties
[14:39:56] DaniG2k: hope I get this next one right though
[14:40:10] sevenseacat: I would have just used SecureRandom.hex or something
[14:40:55] DaniG2k: never heard
[14:41:17] DaniG2k: SecureRandom.hex :O
[14:41:26] sevenseacat: http://ruby-doc.org/stdlib-2.1.2/libdoc/securerandom/rdoc/SecureRandom.html#method-c-hex
[14:41:30] skroon: has joined #RubyOnRails
[14:42:09] DaniG2k: that's awesome
[14:42:15] DaniG2k: would have saved me tons of time -_-
[14:42:19] DaniG2k: oh well, now I know
[14:43:38] jameswork: has joined #RubyOnRails
[14:45:04] s2013: has joined #RubyOnRails
[14:50:02] Benni: has joined #RubyOnRails
[14:51:54] blackmes1: has joined #RubyOnRails
[14:53:33] erts: has joined #RubyOnRails
[14:53:36] mary5030: has joined #RubyOnRails
[14:54:45] mary5030: has joined #RubyOnRails
[14:58:47] symbole: has joined #RubyOnRails
[14:58:52] atmosx: has joined #RubyOnRails
[14:59:35] bruno-: has joined #RubyOnRails
[14:59:53] n008f4g_: has joined #RubyOnRails
[14:59:56] The_Phoenix: has joined #RubyOnRails
[15:00:19] gambl0re: has joined #RubyOnRails
[15:00:30] yaymukund: has joined #RubyOnRails
[15:01:57] disgrntld: has joined #RubyOnRails
[15:02:11] ashleyis_: has joined #RubyOnRails
[15:03:13] atmosx: has joined #RubyOnRails
[15:05:20] Tashi_: has joined #RubyOnRails
[15:06:06] adavia: has joined #RubyOnRails
[15:09:51] mike___1234: has joined #RubyOnRails
[15:10:00] Bertg: has joined #RubyOnRails
[15:11:32] werelivinginthef: has joined #RubyOnRails
[15:11:42] yaymukund: has joined #RubyOnRails
[15:12:00] umdstu: has joined #RubyOnRails
[15:12:50] sonofdirt: has joined #RubyOnRails
[15:13:14] umdstu: so, stupid question, i just added a presence validation on a model, but when i submit the form, it gets a 422 in the controller, rather than performing the render :new. now its been a while since i've done this.. has something changed?
[15:13:39] sevenseacat: depends on what your controller code looks like.
[15:14:26] umdstu: standard... if record.save! else render :new end
[15:14:35] [H]unt3r: has joined #RubyOnRails
[15:14:45] sevenseacat: well thats not right, because save! will throw an exception
[15:14:49] sevenseacat: so please gist your code
[15:15:05] umgrosscol: has joined #RubyOnRails
[15:15:38] ashleyis: has joined #RubyOnRails
[15:16:14] umdstu: sevenseacat: no need, that is the problem, i removed the bang
[15:16:21] umdstu: habit i got into i guess
[15:16:33] sevenseacat: save! wont throw a 422
[15:16:52] sevenseacat: not without some other controller code
[15:17:49] umdstu: you mean aside from the validates :name, presence: true ?
[15:18:00] sevenseacat: thats not controller code.
[15:18:16] umdstu: i'm aware, its in the model
[15:18:29] umdstu: but thats it was causes the controller .save! to throw the 422
[15:18:52] sevenseacat: by itself, it doesn't, but okay. glad your problem is fixed.
[15:19:22] umdstu: sevenseacat: no you're right
[15:19:42] umdstu: my eyes were filtering out a line in the log
[15:19:58] umdstu: its the REST call i do before the save that is throwing the 422
[15:23:16] erichu: has joined #RubyOnRails
[15:24:20] Pazician: has joined #RubyOnRails
[15:24:20] Pazician: has joined #RubyOnRails
[15:24:38] Cache_Money: has joined #RubyOnRails
[15:25:16] ur5us: has joined #RubyOnRails
[15:25:52] bf4: has joined #RubyOnRails
[15:26:08] iooner: has joined #RubyOnRails
[15:26:27] Bertg: has joined #RubyOnRails
[15:28:11] xploshioon: has joined #RubyOnRails
[15:28:12] yaymukund: has joined #RubyOnRails
[15:28:57] xploshioon: hi guys, is there a way to pass a get params in a post form?
[15:29:09] xploshioon: i have this <%= form_for @payment do |f| %>
[15:29:33] xploshioon: but this is a partial to use in edit and new
[15:30:22] xploshioon: so if i put the url in the form ill need to use then 2 forms to go to the 2 url, update and create, or am I wrong?
[15:31:57] chouhoul_: has joined #RubyOnRails
[15:32:09] startupality: has joined #RubyOnRails
[15:32:24] sandstrom: has joined #RubyOnRails
[15:32:39] iooner: has joined #RubyOnRails
[15:33:43] jameswork: has joined #RubyOnRails
[15:34:23] ProLoser: has joined #RubyOnRails
[15:34:45] The_Phoenix1: has joined #RubyOnRails
[15:37:05] Fire-Dragon-DoL: has joined #RubyOnRails
[15:37:22] blackmes1: has joined #RubyOnRails
[15:37:32] acti0nman: has joined #RubyOnRails
[15:38:49] ertse: has joined #RubyOnRails
[15:41:25] centrx: Why would you need two forms?
[15:42:17] tubbo: has joined #RubyOnRails
[15:43:15] lapide_viridi: has joined #RubyOnRails
[15:43:35] tubbo: capybara & poltergeist users...i'm having some issues upgrading to the latest phantomjs (2.0.0).
[15:43:39] Bertg: has joined #RubyOnRails
[15:44:38] eGGsha: has joined #RubyOnRails
[15:44:41] tubbo: i'm using poltergeist 1.6 but when i run tests with the new phantomjs binary, i get Mongoid::Errors::DocumentNotFound exceptions in some of the tests.
[15:46:12] nfk: xploshioon, it's doable
[15:46:35] nfk: xploshioon, i'm not sure, i think i ended up using an if and checking for action or something, not sure, it's been years since i did that
[15:46:41] tubbo: it's like the thread-safety was altered in between versions
[15:46:51] nfk: but i'm certain there's some documentation on how to share forms between new and edit
[15:47:53] philcris_: has joined #RubyOnRails
[15:48:12] tubbo: just render the form partial in your new & edit template?
[15:48:51] tubbo: https://gist.github.com/tubbo/e3ff9f3195e5347e8661
[15:48:52] Schalla: has joined #RubyOnRails
[15:49:16] startupality: has joined #RubyOnRails
[15:49:52] benhuda: has joined #RubyOnRails
[15:50:17] ivanskie: has joined #RubyOnRails
[15:51:41] diegoviola: has joined #RubyOnRails
[15:51:49] diegoviola: has joined #RubyOnRails
[15:52:21] oflannabhra: has joined #RubyOnRails
[15:53:20] pullphinger: has joined #RubyOnRails
[15:53:57] dideler: has joined #RubyOnRails
[15:54:17] Rubie: has joined #RubyOnRails
[15:54:35] bruno-: has joined #RubyOnRails
[15:54:39] baweaver: has joined #RubyOnRails
[15:54:45] p1k: has joined #RubyOnRails
[15:55:24] ararog: has joined #RubyOnRails
[16:00:23] chouhoulis: has joined #RubyOnRails
[16:01:55] AzaToth: has joined #RubyOnRails
[16:04:28] rickmasta: has joined #RubyOnRails
[16:05:02] hotpancakes: has joined #RubyOnRails
[16:07:22] xploshioon: yes @tubbo i am doing that in that way
[16:07:32] _2easy: has joined #RubyOnRails
[16:07:42] xploshioon: the thing is that i need to pass a "get" param in the url
[16:08:11] Diabolik: what's the best API for musician info?
[16:08:14] xploshioon: i saw that i can do that passing the url in the form
[16:08:15] Diabolik: like bios and stuff
[16:08:49] xploshioon: but doing that, my form doesn't work like a partial
[16:08:58] tubbo: xploshioon: can you gist what you have
[16:09:03] xploshioon: i need to create 2 forms then
[16:09:09] xploshioon: yes, wait a minute
[16:11:22] Bertg: has joined #RubyOnRails
[16:12:05] dotty: I have a partial containing some radio buttons, a select and labels for each. I need to output the partial twice in the same view (top and bottom of a page) - but I need the IDs of the radio buttons and select and the for attributes of the labels to be unique - so clicking a label at the bottom of the page doesn't take you to the top.
[16:12:29] hotpancakes: has joined #RubyOnRails
[16:12:38] dotty: Currently I'm doing it by passing in an integer which is being appended to the IDs of each that I'm manually setting (e.g. select_1) - but that doesn't feel great
[16:12:43] xploshioon: @tubbo this is what i am doing https://gist.github.com/xploshioOn/3f14968277d2860118e6
[16:13:17] xploshioon: the thing is, i need to pass a variable like get when i send the form
[16:13:42] xploshioon: a variable in the url
[16:13:48] benhuda: has joined #RubyOnRails
[16:13:54] tubbo: xploshioon: the :username param?
[16:13:54] hsps_: has joined #RubyOnRails
[16:14:00] surrealanalysis: has joined #RubyOnRails
[16:14:16] xploshioon: i was seeing this wrong xD
[16:14:28] xploshioon: i need to pass that param in the redirect in the controller
[16:14:42] bronson: has joined #RubyOnRails
[16:14:46] noodman: has joined #RubyOnRails
[16:14:46] pixelhandler: has joined #RubyOnRails
[16:14:49] zendrix: has joined #RubyOnRails
[16:14:55] xploshioon: the thing was having always the param in the url
[16:15:04] tubbo: xploshioon: i still don't understand what your problem is at all. is ?username=something in your uRL?
[16:15:26] tubbo: xploshioon: like if you're passing username as a GET param, it will be in params[:username]
[16:15:27] xploshioon: so if I receive that username i can redirect passing the param in the controller when this is updated and when this is created too
[16:15:51] annlewis: has joined #RubyOnRails
[16:16:55] tubbo: params[:username] is just whatever the 'username' param in the URL is set to. when you redirect to a different route, that param is cleared.
[16:17:06] tubbo: you'd have to save the username in the session or something to persist it across two different http requests
[16:17:16] hotpancakes: has joined #RubyOnRails
[16:17:46] tubbo: xploshioon: however, don't you think this is a bit insecure?
[16:18:21] tubbo: i mean, why are you allowing people to pass what username they want to change payment for?
[16:18:26] smathy: has joined #RubyOnRails
[16:18:27] tubbo: but that's not really relevant anyway :D
[16:18:28] ProLoser: has joined #RubyOnRails
[16:19:01] xploshioon: yeah, i do have the param in the url, the thing was having that param again when the form was submitted, but I was wrong, i can do that in the controller when I update and create in the redirect
[16:20:47] aarkerio: has joined #RubyOnRails
[16:22:13] hahuang65: has joined #RubyOnRails
[16:22:15] s2013: has joined #RubyOnRails
[16:22:50] dcunit3d: has joined #RubyOnRails
[16:23:53] yardenbar: has joined #RubyOnRails
[16:24:38] bacattak: has joined #RubyOnRails
[16:25:18] tetraktys: has joined #RubyOnRails
[16:26:28] tetraktys: Hey Guys, Bullet warns me for an n+1 query in a belongs_to association. I've gisted the (i think) relevant code here: https://gist.github.com/joostvanrijn/46c2a6422f041e24222f but i can't figure out how to get rid of the warning
[16:26:40] ldnunes: has joined #RubyOnRails
[16:27:06] ararog: has joined #RubyOnRails
[16:27:53] Dbugger: has joined #RubyOnRails
[16:28:08] Dbugger: Hello guys. Can someone please tell me how can I validate a form that has nothing to do with a Model?
[16:31:09] gambl0re: has joined #RubyOnRails
[16:31:27] blackmes1: has joined #RubyOnRails
[16:31:41] XCMer: has joined #RubyOnRails
[16:32:28] anthonys: has joined #RubyOnRails
[16:33:42] tbuehlmann: tetraktys, I don't see how that is an N+1 query
[16:34:41] alex88: has joined #RubyOnRails
[16:36:19] tbuehlmann: dbugger, I suggest you write some kind of tableless model, sometimes called form object
[16:36:28] erich: has joined #RubyOnRails
[16:36:39] tbuehlmann: that can be a simple class with validations
[16:37:02] rhizome: bullet isn't perfect
[16:37:30] szuszuszu: has joined #RubyOnRails
[16:39:18] shinnya: has joined #RubyOnRails
[16:40:07] tetraktys: tbuehlmann, me neither, but why is bullet whining then?
[16:41:45] tetraktys: maybe it has something to do with the .each
[16:42:29] drale2k: has joined #RubyOnRails
[16:44:09] shortCircuit__: has joined #RubyOnRails
[16:47:06] Dbugger: tbuehlmann, do you have a tutorial or link that I can use as guide?
[16:48:05] tbuehlmann: https://robots.thoughtbot.com/activemodel-form-objects
[16:49:19] tbuehlmann: I also like virtus (https://github.com/solnic/virtus) in combination with AM::Validations
[16:50:12] dented42: has joined #RubyOnRails
[16:53:14] anthonys: has joined #RubyOnRails
[16:53:58] frek818: has joined #RubyOnRails
[16:55:25] framling: has joined #RubyOnRails
[16:55:56] krz: has joined #RubyOnRails
[16:57:13] meoblast001: has joined #RubyOnRails
[16:57:25] GnuYawk: has joined #RubyOnRails
[16:58:51] zendrix: has joined #RubyOnRails
[16:59:13] szuszuszu: has joined #RubyOnRails
[17:03:03] arBmind: has joined #RubyOnRails
[17:03:52] momomomomo: has joined #RubyOnRails
[17:05:56] jsrn_: has joined #RubyOnRails
[17:07:09] shortCircuit__: has joined #RubyOnRails
[17:07:37] zendrix: has joined #RubyOnRails
[17:09:05] alexggordon: has joined #RubyOnRails
[17:10:45] krz: has joined #RubyOnRails
[17:16:34] Paradox: has joined #RubyOnRails
[17:16:40] tweeeaks: has joined #RubyOnRails
[17:16:48] nfk: has joined #RubyOnRails
[17:18:04] arBmind: has joined #RubyOnRails
[17:19:57] Paradox: has joined #RubyOnRails
[17:20:14] xploshioon: can i add a new param in my controller?
[17:21:04] xploshioon: i saw this params.require(:comment).permit(:body).merge(user: current_user, commentable: commentable)
[17:21:16] xploshioon: but just in params don't work
[17:21:21] xploshioon: params.merge...
[17:21:41] rhizome: look at the words you're typing before hitting enter, please
[17:21:45] erich: has joined #RubyOnRails
[17:21:52] bronson: has joined #RubyOnRails
[17:22:24] annlewis_: has joined #RubyOnRails
[17:22:33] xploshioon: what is wrong? my english is not so good
[17:23:18] rhizome: sorry. it's not clear what you're asking about.
[17:23:51] blackmes1: has joined #RubyOnRails
[17:24:14] momomomomo_: has joined #RubyOnRails
[17:24:48] hutch78: has joined #RubyOnRails
[17:25:42] xploshioon: ok, let me try to explain
[17:26:07] hutch78: Hi all, I am having some trouble interactiving with ActiveRecord to get what I am looking for. I am trying to create a layered filtering system, so that a user can select categories to filter products by.. i wnt users to select a category, filter results, then when they click another category, FURTHER filter those resuts based on the new category
[17:26:32] hutch78: Here is what I have so far: https://gist.github.com/hutch78/ffef3d8a115bc94db411
[17:26:58] blackmesa: has joined #RubyOnRails
[17:29:24] rhizome: hutch78: i'd use a gem unless i was really committed to reimplementing faceted search from scratch
[17:30:20] xploshioon: i am submiting a form, so in the request i have in the parameters: utf8, authenticity token and the params of my form... i need to add another params in the same level of the authenticity token in the controller
[17:30:25] duderonomy: has joined #RubyOnRails
[17:30:38] hutch78: rhizome, i feel like im so close :(
[17:31:55] towski_: has joined #RubyOnRails
[17:31:56] xploshioon: is possible to add another key-value in params?
[17:32:03] hutch78: rhizome: i know the problem is with line 20, but the documentation on ActiveRecord is not giving me the answers i need
[17:32:04] Dbugger: Guys. how can I validate a email on my Model? "validates :email, email: true" did not work. I got a "Unknown validator: 'EmailValidator'" message
[17:32:19] hahuang65: has joined #RubyOnRails
[17:33:10] xploshioon: what do you want to validate exactly @dbugger?
[17:33:18] hotpancakes: has joined #RubyOnRails
[17:33:23] xploshioon: presences? format?
[17:33:48] tvw: has joined #RubyOnRails
[17:35:11] xploshioon: @rhizome do you know if it's posible? i saw something to add more params with merge but no in the first level
[17:35:26] Dbugger: xploshioon, I want to validate if it really is a valid email
[17:35:26] anjen: has joined #RubyOnRails
[17:35:54] IanV0rn2341: has joined #RubyOnRails
[17:36:22] tubbo: dbugger: email_validator is a separate gem.
[17:36:33] dmmoody: has joined #RubyOnRails
[17:38:17] xploshioon: @dbugger you can do this in your model
[17:38:33] xploshioon: VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
[17:38:35] Dbugger: I see. I found the gem. Thanks you
[17:38:38] xploshioon: and in another line
[17:38:52] xploshioon: validates :email, length: { maximum: 255 }, format: { with: VALID_EMAIL_REGEX }
[17:39:28] alexggordon: has joined #RubyOnRails
[17:40:28] annlewis: has joined #RubyOnRails
[17:40:32] tenderlove: has joined #RubyOnRails
[17:43:31] JoshGlzBrk: has joined #RubyOnRails
[17:44:40] krz: has joined #RubyOnRails
[17:46:24] alex88: has joined #RubyOnRails
[17:46:44] solars: has joined #RubyOnRails
[17:48:16] skroon_: has joined #RubyOnRails
[17:49:47] ruv: has joined #RubyOnRails
[17:52:04] batasrki: has joined #RubyOnRails
[17:53:16] ProLoser: has joined #RubyOnRails
[17:54:33] momomomomo_: has joined #RubyOnRails
[17:55:06] User458764: has joined #RubyOnRails
[17:55:37] hutch78: rhizome: Which gem would i start with for the ???facet search???
[17:55:45] User458764: has joined #RubyOnRails
[17:57:18] batasrki: hutch78: I believe elastic search would do facets
[17:57:53] cmisenas: has joined #RubyOnRails
[17:58:18] srinidhi: has joined #RubyOnRails
[17:58:44] batasrki: as would any sane search library, solr, sphinx, lucene et al
[17:59:33] blackmesa: has joined #RubyOnRails
[17:59:55] baweaver: has joined #RubyOnRails
[17:59:58] loveablelobster: has joined #RubyOnRails
[18:00:27] tubbo: integrating spree with elasticsearch might be tricky though
[18:01:18] s2013: has joined #RubyOnRails
[18:01:31] skroon_: has left #RubyOnRails: ()
[18:01:36] skroon: has joined #RubyOnRails
[18:01:58] diegoviola: Aww.. the manager is threatening his team members over here
[18:02:06] diegoviola: I'm so scared
[18:02:06] startupality: has joined #RubyOnRails
[18:02:20] tubbo: what will you do?
[18:02:24] batasrki: tubbo: ugh, spree
[18:02:25] tubbo: not...get another job!
[18:02:44] batasrki: diegoviola: threats are a big red flag
[18:02:58] batasrki: either that manager is incompetent or under enormous pressure or both
[18:03:00] diegoviola: batasrki: I know, he's a douchebag quite frankly
[18:03:09] diegoviola: batasrki: both
[18:03:10] batasrki: in any case, a loss of control like that means it's time to GTFO
[18:03:13] Hates_: tricky, but using elasticsearch with spree is definitely possible
[18:03:36] diegoviola: batasrki: I'd rather he fires me so he will have to pay me for the next couple of months :P
[18:04:15] diegoviola: batasrki: but the reason he's being a douchebag is that he's trying to make people quit over here, so that he doesn't have to pay anyone
[18:04:25] diegoviola: batasrki: well, I don't think that's the only reason
[18:04:38] baweaver: has joined #RubyOnRails
[18:04:41] rafaelguimaweb_: has joined #RubyOnRails
[18:04:44] diegoviola: but you get the idea
[18:05:04] chelbs: has joined #RubyOnRails
[18:05:43] diegoviola: He just noticed there was some sugar on top of the coffee machine and he was like "Who spilled sugar on the coffee machine? Next time I see that I'll put a camera over there and someone here will have to fly"
[18:06:00] Hates_: sounds like a real hoot
[18:06:07] diegoviola: "The machine was cleaned yesterday"
[18:06:25] diegoviola: I'll spill some more on purpose
[18:08:16] tubbo: diegoviola: make sure you don't give your laptop back when you quit
[18:08:25] tubbo: make them feel how much you really cost ;)
[18:08:48] diegoviola: They didn't gave me a laptop, and they mentioned I'm not allowed to have a laptop here
[18:09:37] momomomomo: has joined #RubyOnRails
[18:10:16] michael_mbp: has joined #RubyOnRails
[18:10:42] batasrki: diegoviola: no need to be petty
[18:10:56] batasrki: diegoviola: do your work, quit or get fired, whatever
[18:11:10] batasrki: diegoviola: but do whatever you need to do with utmost professionalism
[18:11:20] disgrntld: has joined #RubyOnRails
[18:11:32] diegoviola: Sure. Not trying to be petty. :)
[18:11:52] diegoviola: You're right, thanks
[18:12:59] Scriptonaut: haha, someone I work with kept their 3k macbook pro
[18:13:02] Scriptonaut: when they left
[18:13:05] oflannabhra: has joined #RubyOnRails
[18:14:25] Fire-Dragon-DoL: does anyone have a good suggestion on how to test a stats calculation service (basically a simple ruby object)? I suppose there is no other way than creating all the objects in the database, but it's getting quite tedious because we have a lot of stuff to create to get some sort of stamp of a real-world situation (I don't care about speed in this case, I'm referring mostly to the fact
[18:14:26] Fire-Dragon-DoL: that I need to write a lot of fixtures or factories or whatever)
[18:15:27] bananaboydean: has joined #RubyOnRails
[18:16:17] bananaboydean: Hey I was wondering what would be best practices/correct.
[18:16:25] tubbo: bananaboydean: yes.
[18:16:54] bananaboydean: I have a model called StripeAccount which is my wrapper for stripe to call methods and catch errors
[18:17:22] bananaboydean: I validate the token on create and create the stripe customer via an api call
[18:17:42] bananaboydean: for acting on that customer the model must be valid
[18:17:53] hutch78: batasrki: I am reading iup now - seems like i must have been crazy to try and tackle this faceted search myself??? i am wondering though - what are your complaints against Spree commerce ?
[18:18:03] bananaboydean: should I check self.valid? in the begining of the methods inside the model?
[18:18:23] Criten: Anyone here use RDS with heroku?...
[18:18:33] bananaboydean: Criten: I have
[18:18:38] dkphenom: has joined #RubyOnRails
[18:18:52] dc1: has joined #RubyOnRails
[18:19:43] RegulationD: has joined #RubyOnRails
[18:19:45] Criten: bananaboydean: we are trying to get an app to use it for it's main postgresql database but we keep hitting an H10 error (bootup timeout 60s)... any experiance here? all we changed was getting rid of the heroku postgres addon and changed the database.yml to use the credentials for RDS
[18:20:22] tubbo: bananaboydean: so you only want to create the stripe customer if the StripeAccount is valid?
[18:20:25] Criten: Might i add it works fine locally...
[18:20:34] User458764: has joined #RubyOnRails
[18:20:39] bananaboydean: Criten: I was just going to ask that damnit!
[18:20:47] Criten: bananaboydean: wait really? lol
[18:20:54] Criten: oh if it works locally?
[18:21:10] batasrki: hutch78: had a really really bad experience at a freelance engagement with it
[18:21:14] bananaboydean: Is it using ENV vars for passwords or anything like that?
[18:21:30] hotpancakes: has joined #RubyOnRails
[18:21:31] Criten: bananaboydean: yes we are using the heroku ENV vars
[18:21:39] alex88: has joined #RubyOnRails
[18:21:51] bananaboydean: tubbo: It currently only creates the customer if it is valid, I only want to act on that customer if the model is valid
[18:21:53] batasrki: hutch78: I do not like its model of overwriting models
[18:22:00] batasrki: hutch78: and controllers, views, etc
[18:22:26] yaymukund: has joined #RubyOnRails
[18:22:35] hutch78: batasrki: Thank you, I am just starting to work with it and trying to weigh the pros and cons
[18:22:43] benanne: has joined #RubyOnRails
[18:22:49] hutch78: it is our primary e-commerce solution where I???m at
[18:22:50] tubbo: bananaboydean: "act on" that customer?
[18:22:55] batasrki: hutch78: but, that's just my specific experience
[18:23:19] bananaboydean: tubbo: adding subscriptions to the customer(doing things on that customer after they are created)
[18:23:22] hutch78: @batasrki care to elaborate on the freelance engagement? I plan to use it for just that, once I become a bit more time-efficient
[18:23:26] bananaboydean: pulling their info etc
[18:23:31] tubbo: i use spree, and i don't find it too annoying. then again, i'm not doing a lot of customization to it.
[18:23:55] bananaboydean: Criten: We luckly never had that issue though I'd check to make sure you have access policies that allow heroku in
[18:24:02] tubbo: bananaboydean: not sure why you keep needing to check if StripeAccount is valid to act upon a stripe customer..
[18:24:05] hutch78: tubbo: i love it so far, unfortunately though my designers come up with a storefront that is completely unrecognizable from the original spree source
[18:24:40] qejk: has joined #RubyOnRails
[18:24:44] bananaboydean: tubbo: you are right If it is valid every other time(other than creation) it should be valid
[18:24:48] bananaboydean: so I dont need to check
[18:24:59] bananaboydean: just parinoid i guess :P
[18:25:35] tubbo: hutch78: ah, that kinda sucks.
[18:26:00] Criten: bananaboydean: we got it!
[18:26:00] batasrki: hutch78: it was a weird thing, I don't think it's representative of things in general
[18:26:02] tubbo: hutch78: the company i work for, incidentally, has our own ecommerce platform that we wrote in rails. it's very similar to spree except the admin is 1000x better.
[18:26:08] tubbo: also you have to pay for it.
[18:26:30] bananaboydean: Criten: what was it?
[18:26:38] User458764: has joined #RubyOnRails
[18:26:43] momomomomo: has joined #RubyOnRails
[18:26:44] Criten: bananaboydean: so amazon thought it would be nice and auto-add our IP to the IP whitelist
[18:26:54] Criten: so we were like WHY IS THIS WORKING HERE
[18:26:59] Criten: so we dug through the aws stuff
[18:27:00] hutch78: tubbo: We have talked about doing the same thing, unfortunately the primary language where I???m at is still PHP (don???t tell anyone, lol) How do you handle CMS ?
[18:27:02] Criten: and noticed the whiteliast
[18:27:07] Criten: whitelist*
[18:27:19] Criten: added a whildcard one to just allow all for a test
[18:27:20] Criten: and it works
[18:27:35] bananaboydean: Haha, infrastructure issues are annoying espically with "smart" systems
[18:27:39] tubbo: hutch78: it's built into the platform.
[18:27:53] ararog: has joined #RubyOnRails
[18:29:04] hutch78: tubbo: that is awesome.. that platform sounds very valuable. Do you know of any CMS that may integrate well with Spree ?
[18:29:11] bananaboydean: Is it bad to add errors from methods even if they arent via validations?
[18:29:41] bananaboydean: As in a method doesn't complete correctly/runs into an issue so rather than returning a message I do errors.add(:base, msg)
[18:29:43] mikecmpbll: has joined #RubyOnRails
[18:31:26] hotpancakes: has joined #RubyOnRails
[18:33:52] garrypolley: has joined #RubyOnRails
[18:33:54] tubbo: bananaboydean: "returning" a message?
[18:34:17] tubbo: so you literally do `return 'oh noes this didnt work'` when something goes wrong? :)
[18:34:18] hanss: has joined #RubyOnRails
[18:34:28] bananaboydean: haha not literally
[18:34:31] bananaboydean: but literally yes
[18:35:05] bananaboydean: something like return {:success => false, :reason => "#{reason}"}
[18:35:20] tubbo: so every method is just returning a hash at some point
[18:35:37] bananaboydean: it isnt returning anything
[18:35:47] bananaboydean: i was wondering what the best practice is
[18:35:50] tubbo: bananaboydean: !gist an example of what you want to do and we'll tell you if it's a good idea :)
[18:35:50] helpa: bananaboydean: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[18:36:36] chelbs: has joined #RubyOnRails
[18:38:05] blackmesa: has joined #RubyOnRails
[18:39:47] zendrix: has joined #RubyOnRails
[18:41:52] lupine: typically you'd have a class Result, with success? and failure? methods, I've done it with a few client libraries before now
[18:42:16] lupine: I think it fits languages with pattern-matching and unwrapping better
[18:42:28] workmad3: has joined #RubyOnRails
[18:42:29] bananaboydean: lupine: for my question?
[18:43:39] baweaver: has joined #RubyOnRails
[18:43:53] lupine: rust has a Result in its stdlib, for instance, but it also has match x { Ok(e) => { stuff_with_e } }
[18:44:15] lupine: alternatives in ruby are exceptions and multi-value returns
[18:44:48] lupine: was_success, detail = operation(args) is relatively pleasant
[18:46:07] bananaboydean: I didnt know if I should use ActiveModel errors
[18:46:18] bananaboydean: since they are there and nice to work with also
[18:46:23] bananaboydean: im writing a gist to explain now
[18:48:01] batasrki: hey peeps, anyone know how to dynamically control which layout gets rendered for a set of controllers and actions?
[18:48:12] batasrki: we have some bespoke code, but it's brittle to say the least
[18:48:23] yaymukun1: has joined #RubyOnRails
[18:48:49] tubbo: batasrki: you can pass a method to `layout` as a symbol
[18:49:48] rustymyers: has joined #RubyOnRails
[18:49:52] batasrki: tubbo: we do that already, but the actual method is too coarse IMO
[18:50:26] batasrki: it literally does "is the controller name one of these and action name one of these? if so, use this layout, else, this other one"
[18:50:29] hutch78: I am trying to integrate Susnpot for this faceted search, but i am having trouble grasping how I would use it to do this search, when foreign key is located inside a join table ?
[18:50:31] tubbo: so write all your code in an object and then have the method call the object and return the result
[18:50:59] victortyau: has joined #RubyOnRails
[18:52:55] Lightsword: has joined #RubyOnRails
[18:53:21] FCser: has joined #RubyOnRails
[18:54:00] framling: has joined #RubyOnRails
[18:54:16] Zadrel: has joined #RubyOnRails
[18:54:24] dmmoody: has joined #RubyOnRails
[18:55:46] batasrki: anyone read Introduction to General Systems Thinking? Like it?
[18:56:13] bananaboydean: tubbo: https://gist.github.com/FreekingDean/94bf227b20a7947552cf
[18:56:27] bananaboydean: its a really simple example *
[18:56:48] Zadrel: hello there! anyone can tell me whats wrong with this code? https://gist.github.com/rmatuoka/a7b28c84bc23ff49d868 . the error generated usually is risen when i miss some kind of closure, right?
[18:57:00] szu: has joined #RubyOnRails
[18:57:04] blackmesa: has joined #RubyOnRails
[18:57:14] tubbo: bananaboydean: looks good o me
[18:57:25] szu: hey all :)
[18:57:35] bananaboydean: I feel like its wrong, since i am adding errors outside of a validator
[18:57:44] marr: has joined #RubyOnRails
[18:57:48] bananaboydean: It just doesn't make me feel good inside
[18:57:52] tubbo: oh sorry haha hold on
[18:57:57] mordocai: has joined #RubyOnRails
[18:58:06] tubbo: bananaboydean: it's not bad to add validation errors, as long as you will display them later to th euser
[18:58:07] bananaboydean: Zadrel: the last line
[18:58:08] tubbo: the user*
[18:58:24] batasrki: Zadrel: I don't know what the actual error is, but filter = [] makes it a global variable rather than local. You wanna put a var in front of it
[18:58:44] bananaboydean: tubbo: I think all I needed was someone to reassure me in that
[18:59:11] batasrki: bananaboydean: does the exception's to_s method return useful info?
[18:59:15] tubbo: bananaboydean: when i see errors.add() though i assume that we're gonna be handling those errors when valid? returns false.
[18:59:20] Zadrel: batasrki: the lines shown isn't part of the error, they're displayed becouse of the "missing closure", my rails 3.2.13 behaves this way
[18:59:58] Zadrel: bananaboydean: thx, i excluded the "ADICIONAR" and worked; almost every error are dumb things, right? lol
[19:00:08] batasrki: Zadrel: I understand that and I think bananaboydean answered your question. I just gave you a general recommendation
[19:00:38] nzst: has joined #RubyOnRails
[19:00:55] bananaboydean: tubbo: It does sometimes, I will not be handleing them in the sense of doing anything besides displaying something to the user
[19:01:07] Zadrel: batasrki: oh, thx for that then; sorry if i sounded rude, wasn't my intention
[19:01:23] bananaboydean: Zadrel: 99% of the time its something like indentation or a semicolon for other languages
[19:01:24] batasrki: Zadrel: nope, you didn't sound rude.
[19:01:32] tubbo: bananaboydean: that's what i meant, like if those errors aren't being shown to the user then it's pointless
[19:01:46] aarkerio: has joined #RubyOnRails
[19:02:00] bananaboydean: Right, I am sending them directly to the user. I figured that would be the easiest way
[19:02:38] nertzy: has joined #RubyOnRails
[19:02:47] bf4: has joined #RubyOnRails
[19:02:59] bananaboydean: Thanks for the help & knowledge!
[19:04:29] Hates_: has joined #RubyOnRails
[19:04:30] tubbo: no problem
[19:05:38] fmcgeough: has joined #RubyOnRails
[19:06:00] aarkerio: hi! I have a bizarre result when I try this: puts " #{ @user.deliver_date } --- #{ @user.inspect } "
[19:06:01] aarkerio: 2015-03-29 15:01:58 -0400 --- #<User id: 91, first: 'Alan', last: '', address1: nil, deliver_date: nil, created_at: "2015-06-29 19:01:57", updated_at: "2015-06-29 19:01:58"
[19:06:13] pierre_f: has joined #RubyOnRails
[19:06:33] aarkerio: deliver_date is nil even if @user is the same object
[19:06:45] jameswork: has joined #RubyOnRails
[19:07:02] yardenbar: has joined #RubyOnRails
[19:07:16] aarkerio: but @user.deliver_date actually holds the date
[19:07:23] aarkerio: how this is possible?
[19:08:09] phat4life: is @user dirty?
[19:08:29] phat4life: what happens if you do a @user.reload inbetween?
[19:09:36] aarkerio: I'm not familiar with the "dirty" term, what it means?
[19:09:42] weaksauce: aarkerio can you gist your model?
[19:09:44] weaksauce: what version of rails are you using?
[19:10:44] emptyflask: has joined #RubyOnRails
[19:12:32] workmad3: has joined #RubyOnRails
[19:13:36] weaksauce: aarkerio can you gist your model?
[19:14:37] zendrix: has joined #RubyOnRails
[19:14:54] krz: has joined #RubyOnRails
[19:15:31] aarkerio: my model: https://gist.github.com/anonymous/1d42095b824ae572fcd7
[19:17:35] anthonys: has joined #RubyOnRails
[19:17:35] bin_005: has joined #RubyOnRails
[19:17:46] weaksauce: aarkerio are you updating the deliver_date and then trying to print it before saving?
[19:17:57] bronson: has joined #RubyOnRails
[19:18:11] garrypolley: has joined #RubyOnRails
[19:19:43] weaksauce: inspect might show the persisted state and deliver_date directly would show the state of it right now.
[19:20:02] weaksauce: p @user.deliver_date.dirty?
[19:20:04] zendrix: has joined #RubyOnRails
[19:20:16] jenrzzz: has joined #RubyOnRails
[19:20:51] annlewis: has joined #RubyOnRails
[19:20:51] aarkerio: oooohhhh! I see, thanks guys!!
[19:21:51] Bertg: has joined #RubyOnRails
[19:21:56] gusrub: has joined #RubyOnRails
[19:23:19] toretore: has joined #RubyOnRails
[19:25:41] sleungcy: has joined #RubyOnRails
[19:26:28] nobitanobi: has joined #RubyOnRails
[19:26:51] bronson: has joined #RubyOnRails
[19:29:38] zendrix: has joined #RubyOnRails
[19:31:58] hotpancakes: has joined #RubyOnRails
[19:32:33] annlewis_: has joined #RubyOnRails
[19:32:40] Bertg: has joined #RubyOnRails
[19:34:33] speakingcode: has joined #RubyOnRails
[19:37:07] DoctorMonocular: has joined #RubyOnRails
[19:37:57] rickmasta: has joined #RubyOnRails
[19:39:12] jcromartie: has joined #RubyOnRails
[19:39:43] hutch78: OK, I???ve updated this gist to a more simple question??? I am using rails joins to create a set of data. It returns an ActiveRecord Relation object with 91 records in it. I then need to further narrow these results based on a second condition??? This second condition returns an empty ActiveRecord Relation object, when it should return results??? GIST: https://gist.github.com/hutch78/ffef3d8a115bc94db411
[19:39:59] yfeldblum: has joined #RubyOnRails
[19:40:15] hutch78: Sunspot gave me an error when trying to install it along the lines of ???Could not find generator 'sunspot_rails:install'. Maybe you meant 'canonical_rails:install' or 'responders:install' or 'spree:auth:install??????
[19:40:17] kadoppe: has joined #RubyOnRails
[19:41:01] jcromartie: what's the most succint way to use Capybara to check if a labelled checkbox is checked?
[19:41:17] batasrki: hutch78: so, you want all taxons that are Red and Crazy?
[19:41:37] hutch78: all products that have the ???Red??? or ???Crazy??? taxon applied to them
[19:41:55] Hates_: hutch78: why not just an in query then?
[19:42:07] batasrki: hutch78: that's not what the query does
[19:42:13] hutch78: i had that working, but it was giving me ones that are part of EITHER, not BOTH taxons
[19:42:19] acovrig: has joined #RubyOnRails
[19:42:22] batasrki: hutch78: the query as you've set it up looks for taxons that are Red AND Crazy
[19:42:25] hutch78: sorry i suck at tagging??? @Hates_
[19:42:41] hutch78: batasrki: that is what i need, AND, not OR
[19:43:17] acovrig: I???m getting a ???No route matches [GET] ???/logout??????, however I have ???delete 'logout' => 'session#destroy'??? in my routes.rb, what am I missing?
[19:43:18] hutch78: this worked fine for the???OR??? part -> Spree::Product.joins(:taxons).where(spree_taxons: {:name => taxons_array}).distinct
[19:43:30] batasrki: sorry, hutch78, that's not what you said above
[19:43:38] bananaboydean: acovrig: what is your <%= link_to %> look like
[19:43:47] hutch78: batasrki: apologies, i am still learning to properly articulate these issues
[19:44:04] batasrki: hutch78: no worries
[19:44:10] jcromartie: expect(page).to have_field "label text here", checked: true
[19:44:29] bananaboydean: acovrig: you are using the helper that links to the "GET" not "DELETE" HTTP method
[19:44:34] batasrki: hutch78: so you want select * from blah where taxons = 'Red' and taxons='Crazy'?
[19:44:50] hutch78: batasrki: yes
[19:45:06] acovrig: bananaboydean: <%= link_to ???Logout???, logout_path %>
[19:45:07] batasrki: hutch78: have you tried this query in a rails console?
[19:45:18] hutch78: batasrki: yes, I am testing there currently
[19:45:27] batasrki: and it works as expected?
[19:45:40] hutch78: part a does: prods = Spree::Product.joins(:taxons).where(spree_taxons: {:name => 'Red'}).distinct
[19:45:47] Hates_: hutch78: why aren't you using Spree's in_taxons scope?
[19:46:03] acovrig: bananaboydean: thanks, I missed the method: ???delete??? in the link; thanks
[19:46:03] batasrki: Hates_: probably because hutch78 doesn't know about it
[19:46:05] bananaboydean: acovrig: that is using a GET method
[19:46:34] Hates_: hutch78: have a look at this method and also the comments https://github.com/spree/spree/blob/715d4439f4f02a1d75b8adac74b77dd445b61908/core/app/models/spree/product/scopes.rb#L84
[19:46:37] hutch78: batasrki, Hates_: for some reason, it is returning ALL products, not just the ones in the selected taxons
[19:47:16] hutch78: Hates_: , i hadnt seen that part
[19:47:28] hutch78: Hates_: I had only seen what is in product_filters.rb, which led me NOWHERE
[19:47:40] batasrki: hutch78: Spree is a deep framework with a big learning curve
[19:47:57] drale2k: has joined #RubyOnRails
[19:48:00] batasrki: hutch78: you're going to have to dive into code and docs and tests to find the best approaches
[19:48:01] rkofman: has joined #RubyOnRails
[19:48:12] Hates_: hutch78: you should realy base any search you do off https://github.com/spree/spree/blob/master/core/spec/lib/search/base_spec.rb
[19:48:15] hutch78: batasrki: that has been my life for the last 3 months lol
[19:48:29] Hates_: whoops that's the spec :P
[19:48:32] batasrki: hutch78: I believe it
[19:48:41] Hates_: hutch78: https://github.com/spree/spree/blob/master/core/lib/spree/core/search/base.rb
[19:49:33] n008f4g_: has joined #RubyOnRails
[19:51:10] vasilakisfil_: has joined #RubyOnRails
[19:51:13] surrealanalysis: has joined #RubyOnRails
[19:51:48] hutch78: Hates_: ??????you mean to tell me that this is all its going to take !? ?!?!?!? Spree::Product.in_taxons('Daily', 'Red')
[19:52:08] asdffffff: has joined #RubyOnRails
[19:52:08] hutch78: i got a positibve result from the console.. let me keep trying this...
[19:52:40] Hates_: hutch78: yeah probably :P
[19:54:23] doctorly: has joined #RubyOnRails
[19:55:58] doctorly: is there a simple way to have validations for an activerecord attribute execute sequentially and stop if one fails? I am having an issue where presence isn't being validated because I have a test for int after and it is comparing nil to int.
[19:57:46] baweaver: has joined #RubyOnRails
[19:58:44] nfk: has joined #RubyOnRails
[19:58:47] jkamenik: has joined #RubyOnRails
[19:58:49] AmBienCeD: has joined #RubyOnRails
[19:58:49] AmBienCeD: has joined #RubyOnRails
[19:59:12] oflannabhra: has joined #RubyOnRails
[19:59:34] batasrki: doctorly: I don't think you should have order-dependent validations
[20:00:07] Benni: has joined #RubyOnRails
[20:00:13] voker57: has joined #RubyOnRails
[20:00:13] sandstrom: has joined #RubyOnRails
[20:01:03] roolo: has joined #RubyOnRails
[20:01:55] tubbo: doctorly: are you using the numericality validation or are you writing your own?
[20:02:03] tubbo: built-in numericality validation*
[20:02:13] noodman: has joined #RubyOnRails
[20:02:26] doctorly: tubb: I am using the built in, and comparing it using greater_than and less_than
[20:03:20] emilkarl: has joined #RubyOnRails
[20:03:31] erich: has joined #RubyOnRails
[20:05:14] hutch78: Hates_: that seems to be giving me an ???OR??? result, not an ???AND??? result
[20:05:19] doctorly: tubbo: sorry, didn't spell your name right
[20:06:10] acovrig: I???m following (https://richonrails.com/articles/google-authentication-in-ruby-on-rails), I???m getting ???No route matches [GET] "/auth/google_oauth2?????? and don???t see any route that should match, so how does it work for the guide?
[20:06:11] doctorly: batasrki: Wouldn't I have to make it dependent no matter what? Even if I have to make an if statement
[20:06:27] diegok: has joined #RubyOnRails
[20:07:03] cac: has joined #RubyOnRails
[20:07:25] arup_r: has joined #RubyOnRails
[20:07:46] mrbubbles: has joined #RubyOnRails
[20:07:54] dstarh: has joined #RubyOnRails
[20:09:28] tubbo: acovrig: "Great! Now we need to set up a few routes. Modify your routes file so that it looks like the code listed below.
[20:09:31] DLSteve: has joined #RubyOnRails
[20:09:35] tubbo: acovrig: assuming you missed that part? :)
[20:09:50] anthonys: has joined #RubyOnRails
[20:10:01] __butch__: has joined #RubyOnRails
[20:10:03] acovrig: tubbo: no, I got that, but what route should match that? get 'auth/:provider/callback', to: 'session#create????
[20:10:17] tubbo: acovrig: yeah, that's the one. because :provider in that case is 'google_oauth2'
[20:10:41] tubbo: acovrig: i think omniauth also adds an initial /auth route. check `rake routes`.
[20:10:53] acovrig: tubbo: ??? GET /auth/:provider/callback(.:format) session#create??? is in my routing error page???
[20:11:12] acovrig: is rake routes the same as the Routes section on the rails error page?
[20:11:14] dmz: has joined #RubyOnRails
[20:11:18] weaksauce: doctorly make it a custom one and do both checks there so it doesn't fail on you. you can gist your code and the error if you want.
[20:11:27] tubbo: acovrig: yes
[20:12:01] acovrig: tubbo: OK, then that route is there, so why isn???t it using it?
[20:12:21] acovrig: and does it match given it is /auth/:provider instead of /auth/:provider/callback?
[20:12:28] tubbo: i missed that
[20:12:49] tubbo: god what an awful website
[20:12:51] tubbo: richonrails
[20:13:00] acovrig: I don???t see any route on the page ending in :provider...
[20:13:15] tubbo: no offense if the author is here, but those images are whaaat
[20:15:12] mrbubbles: does render :json always include a root element?
[20:15:16] siddart_: has joined #RubyOnRails
[20:15:44] acovrig: tubbo: should I add a route for /auth/:provider, and if so, to what?
[20:15:58] yaymukund: has joined #RubyOnRails
[20:17:03] hotpancakes: has joined #RubyOnRails
[20:17:13] acovrig: ACTION reboots, brb
[20:18:45] diegok: has joined #RubyOnRails
[20:19:07] x-light: has joined #RubyOnRails
[20:19:26] Lightsword: has joined #RubyOnRails
[20:19:57] Etriaph: has joined #RubyOnRails
[20:22:50] bf4: has joined #RubyOnRails
[20:24:44] Schalla: has joined #RubyOnRails
[20:24:44] Schalla: has joined #RubyOnRails
[20:24:51] acovrig: has joined #RubyOnRails
[20:25:00] erich: has joined #RubyOnRails
[20:26:01] lambirdsal: has joined #RubyOnRails
[20:27:01] tannerj: has joined #RubyOnRails
[20:31:07] delianides: has joined #RubyOnRails
[20:31:08] xploshioon: hi guys, I have this https://gist.github.com/xploshioOn/bc30779d73fd7cb20251 this was working but now i don't know why render again the same form and gives me no error in the view... in the console i saw that says unpermited parameters, but this was working, any idea?
[20:32:11] xploshioon: i put accept nester attributes in the model before
[20:32:27] xploshioon: everything was working
[20:33:04] Rakunh0: has joined #RubyOnRails
[20:33:40] alex88: has joined #RubyOnRails
[20:33:45] alex88: has joined #RubyOnRails
[20:34:30] zendrix: has joined #RubyOnRails
[20:35:02] tubbo: xploshioon: http://guides.rubyonrails.org/action_controller_overview.html#strong-parameters check out "4.5.2 Nested Parameters"
[20:35:58] solars: has joined #RubyOnRails
[20:36:05] xploshioon: ok, let me see this, thanks
[20:36:12] netzfisch: has joined #RubyOnRails
[20:36:16] dmmoody: has joined #RubyOnRails
[20:36:33] xploshioon: i am doing that
[20:36:35] sarink: has joined #RubyOnRails
[20:36:52] tubbo: xploshioon: no you're not. read it more carefully.
[20:37:13] Wolland: has joined #RubyOnRails
[20:37:32] baweaver: has joined #RubyOnRails
[20:37:32] yaymukun1: has joined #RubyOnRails
[20:38:12] pollywog: has joined #RubyOnRails
[20:38:41] pollywog: has left #RubyOnRails: ()
[20:39:27] polly_wog: has joined #RubyOnRails
[20:40:25] ur5us: has joined #RubyOnRails
[20:41:15] Frem: has joined #RubyOnRails
[20:43:01] xploshioon: can you give me some hint about what i have wrong? i use params.require(...).permit(...) but separately because i create every model individually, so in auction.new i dont want the client parameters and things like that
[20:43:28] tubbo: xploshioon: you're trying to pass all the params in the same hash, but your code is written as if there are several hashes to parse params out of
[20:43:37] xploshioon: and i don't know, that was working perfectly and now just don't let me save
[20:43:45] weaksauce: what did you change?
[20:43:49] tubbo: xploshioon: what you need is params.require(:parent).permit(child: [:attr, :attr]) to permit the child attrs to save onto the parent
[20:44:34] xploshioon: but this was working
[20:44:35] xploshioon: params[:auction][:client].require(:user).permit(
[20:45:08] xploshioon: there are in the same root, but i extract every "model" in my params method
[20:45:48] tubbo: i dunno man, this code looks pretty tangly
[20:45:50] xploshioon: doing things like this params[:auction].require(:client).permit(...)
[20:45:55] weaksauce: you aren't really extracting anything in auction_params and client_params.
[20:46:09] momomomomo: has joined #RubyOnRails
[20:46:12] tubbo: xploshioon: first of all i think you've misunderstood how nested models are supposed to work
[20:46:35] tubbo: the way your params hash looks, it seems like an Auction is related to a Client and a User
[20:46:43] Etriaph: xploshioon: Usually with a nested attributes scenario it's all in one hash.
[20:46:44] tubbo: so Auction really should accepts_nested_attributes_for :client, :user
[20:46:49] weaksauce: in auction params you still have client. and in client_params you still have user
[20:46:51] hutch78: What does the ampersand mean in this line of code? ??? taxon_names = product.taxons.map(&:name)???
[20:47:38] weaksauce: xploshioon so they are not being extracted out
[20:48:01] nobitanobi: hey guys, where can I find the list of different formats available for: http://www.rubydoc.info/github/svenfuchs/i18n/master/I18n/Backend/Base:localize
[20:48:33] Etriaph: hutch78: The method map will call to_proc on name
[20:49:05] tubbo: nobitanobi: in the docs for strftime
[20:49:13] tubbo: it uses the same format strings iirc
[20:49:20] xploshioon: ok guys, let me try what you are saying, ill be back hehe thanks
[20:50:26] nobitanobi: tubbo: thanks!
[20:53:25] chintanparikh: has joined #RubyOnRails
[20:53:54] anthonys: has joined #RubyOnRails
[20:55:08] Lightsword: has joined #RubyOnRails
[20:57:54] balr0g: has joined #RubyOnRails
[20:59:21] Oog: has joined #RubyOnRails
[20:59:27] Oog: t.text :uid, :null => false, :index => true, :unique => true - can i do that use unique there?
[20:59:35] Oog: i cant find documentation
[21:00:08] zendrix: has joined #RubyOnRails
[21:01:26] nfk: has joined #RubyOnRails
[21:01:27] workmad3: has joined #RubyOnRails
[21:02:59] baweaver: has joined #RubyOnRails
[21:03:02] philcrissman: has joined #RubyOnRails
[21:03:11] Crashtown: has joined #RubyOnRails
[21:03:14] intuxicated: has joined #RubyOnRails
[21:05:55] ivanskie: has joined #RubyOnRails
[21:06:25] yfeldblum: has joined #RubyOnRails
[21:08:32] baweaver: has joined #RubyOnRails
[21:08:50] Benni: has joined #RubyOnRails
[21:11:33] scott0101: has joined #RubyOnRails
[21:12:50] scott0101: has left #RubyOnRails: ()
[21:12:55] shilon: has joined #RubyOnRails
[21:13:00] shilon: has left #RubyOnRails: ()
[21:14:02] manvsmachine: has joined #RubyOnRails
[21:15:34] bruno-: has joined #RubyOnRails
[21:17:32] Haegin_: has joined #RubyOnRails
[21:22:22] chelbs: has joined #RubyOnRails
[21:22:57] danman: has joined #RubyOnRails
[21:23:17] mdw: has joined #RubyOnRails
[21:23:32] Palsson: has joined #RubyOnRails
[21:24:31] Coldblackice: has joined #RubyOnRails
[21:25:38] chouhoulis: has joined #RubyOnRails
[21:26:43] intuxicated: has joined #RubyOnRails
[21:27:04] xploshioon: nothing guys, i can't make it work @tubbo @weaksauce. i just have a form that use 3 tables, they come in one hash but i need to create them separately
[21:27:30] xploshioon: doing this was working https://gist.github.com/xploshioOn/bc30779d73fd7cb20251
[21:27:31] rhizome: then you're going to have a large method
[21:27:44] xploshioon: i saw what you are saying about nested attributes
[21:28:03] baweaver: has joined #RubyOnRails
[21:28:03] xploshioon: but how can i solve this if i need it in that way
[21:28:24] loocash: has joined #RubyOnRails
[21:28:26] Etriaph: http://tinyurl.com/pf76qa5
[21:28:34] Etriaph: Can anyone give me a hint on that?
[21:28:34] xploshioon: how can i avoid the unpermitted params here params[:auction].require(:client).permit(:name, :surname, :username, :birthday, :phone_code, :phone)
[21:28:49] xploshioon: if the hash have user attributes too?
[21:29:50] loocash_: has joined #RubyOnRails
[21:32:17] rhizome: Etriaph: why not collection_select?
[21:32:57] weaksauce: xploshioon you can use a slice if you need to have the attributes nested like that.
[21:33:13] boom1992: has joined #RubyOnRails
[21:34:27] alex88: has joined #RubyOnRails
[21:35:14] weaksauce: or dup and delete the params that you want to use or split up the form fields so they are not nested like that or create whatever object you want to create with one nested attribute call instead of manually instantiating @user, @client, and @auction. there are many paths to choose from here.
[21:37:27] x-light: has joined #RubyOnRails
[21:37:47] xploshioon: nice, thanks @weaksauce, ill try with the slice
[21:37:56] bf4: has joined #RubyOnRails
[21:38:36] weaksauce: the api is a good source if you know what to search for: http://api.rubyonrails.org/classes/ActionController/Parameters.html#method-i-slice
[21:39:53] Criten: Anyone know a solution for rails 4 using cloudfront as a cdn and heroku as your origin for custom fonts?
[21:40:05] Criten: https://github.com/ericallam/font_assets
[21:40:09] Criten: doesnt seem to work for rails 4
[21:41:09] workmad3: has joined #RubyOnRails
[21:41:13] xploshioon: nice @weaksauce, you help me so much
[21:41:17] xploshioon: ill try with that
[21:42:06] Etriaph: rhizome: Uh, well, this method happened to work? :D The select is rendered properly, there's just no prompt for the empty option element.
[21:42:36] jimbeaudoin: Criten: in your config file, you can setup your assets cdn adress
[21:42:57] Criten: jimbeaudoin: the browsers complain about CORS headers
[21:43:00] Criten: https://github.com/cyu/rack-cors
[21:43:02] Criten: might try that
[21:43:51] blackmesa: has joined #RubyOnRails
[21:45:58] jaequery: has joined #RubyOnRails
[21:46:28] Etriaph: rhizome: Is it more prudent to use collection_select?
[21:47:53] Etriaph: rhizome: Note that roles is an enum.
[21:51:42] rhizome: i generally recommend starting there and going to others as necessary.
[21:51:56] Palsson: has joined #RubyOnRails
[21:52:11] eggoez: has joined #RubyOnRails
[21:52:12] doctorly: has joined #RubyOnRails
[21:52:22] bf4: has joined #RubyOnRails
[21:53:24] webguynow: has joined #RubyOnRails
[21:54:29] heathd: has joined #RubyOnRails
[21:54:38] Etriaph: rhizome: OK, well I've converted it; still no prompt and the first non-empty option element is set to selected.
[21:55:03] momomomomo: has joined #RubyOnRails
[21:56:32] Pupeno_: has joined #RubyOnRails
[21:56:56] Etriaph: https://gist.github.com/anonymous/f77535bf3ae2eab1f843
[21:58:52] heathd: has left #RubyOnRails: ()
[21:59:22] snicers-work: has joined #RubyOnRails
[21:59:24] snicers-work: Hey, I have inherited a project that uses a column of a table that contains javascript. I need to get a specific key's values across all rows in the table as a single Object (Hash or whatever would be good). This needs to be a distinct list of all values of a specific key of this json column across all rows. What is the best way to handle this?
[21:59:43] snicers-work: contains JSON, not javascript.
[21:59:55] workmad3: has joined #RubyOnRails
[22:00:49] Etriaph: Snicers-Work: Which database backend?
[22:01:08] danman: has joined #RubyOnRails
[22:01:35] dmmoody: has joined #RubyOnRails
[22:01:45] jameswork: has joined #RubyOnRails
[22:02:32] seansith: has joined #RubyOnRails
[22:03:11] Etriaph: Snicers-Work: This may help https://github.com/greenlion/swanhart-tools/tree/master/udf
[22:03:46] Etriaph: Snicers-Work: Other than that, regular expressions are probably the way you'd have to go.
[22:04:55] DoctorMonocular: has joined #RubyOnRails
[22:05:19] giwrgosdi: has joined #RubyOnRails
[22:06:19] snicers-work: Etriaph, I can get the data by parsing each entry but I think I need to cache the resulting Hash so that I don't have to run this intensive lookup on each load.
[22:07:10] bf4: has joined #RubyOnRails
[22:07:37] Etriaph: Snicers-Work: Or convert the data into something you can query with MySQL. Postgres allows for it, MySQL allows for it with XML.
[22:07:46] Etriaph: https://code.google.com/p/common-schema/ may help you too.
[22:08:05] Palsson: has joined #RubyOnRails
[22:08:05] surrealanalysis: has joined #RubyOnRails
[22:08:08] werelivinginthef: has joined #RubyOnRails
[22:08:46] rhizome: convert it to a model
[22:09:12] Spami: has joined #RubyOnRails
[22:09:33] manvsmachine_: has joined #RubyOnRails
[22:09:49] Etriaph: rhizome: Who was that directed towards?
[22:09:51] rhizome: Etriaph: hard to say on the select, i don't know what's behind the options. typcially don't have to use an explicit hash, though
[22:11:18] Etriaph: rhizome: This is the first time I've used an enum field.
[22:11:40] Etriaph: Well, with ActiveRecord anyway.
[22:15:30] yfeldblum: has joined #RubyOnRails
[22:16:15] ght: Question: is it possibly to call functions defined in the application_controller or other controllers via rails console for a given rails 4.2 project?
[22:16:42] ght: I tried manualling stating require 'application_controller', which returned true, yet when I call a function from that controller it returns unknown
[22:17:32] hotpancakes: has joined #RubyOnRails
[22:17:48] ght: Never mind, it appears I can declare foo = ActionController::Base::ApplicationController.new
[22:22:08] surrealanalysis: has joined #RubyOnRails
[22:23:42] carlosd: has joined #RubyOnRails
[22:23:59] hardtail: has joined #RubyOnRails
[22:26:13] yaymukun1: has joined #RubyOnRails
[22:26:36] brahman: has joined #RubyOnRails
[22:27:10] Radar: Yes it is possible
[22:27:16] Radar: interested to know why you're doing it
[22:27:23] Radar: And ::ApplicationController.new would work too
[22:27:41] Palsson: has joined #RubyOnRails
[22:28:00] brahman: Hi, is it ok for me to look up a specific association in my view using a @user.tasks.where(:task_name => 'value') or should that stay in the controller?
[22:28:18] noodman: has joined #RubyOnRails
[22:28:35] Radar: brahman: 1) consider renaming the field to just "name" because it's already clear it's a task 2) try to keep it in your controller if possible
[22:29:07] lupine: ideally, rendering your views won't include any database operations at all
[22:29:12] lupine: this allows you to test them without a database
[22:29:13] sonofdirt: has joined #RubyOnRails
[22:29:18] lupine: (haha, testing views. can you imagine?)
[22:29:35] Radar: ha that would be too cool
[22:29:45] Radar: Too bad you need instance vars in views ;)
[22:30:09] lupine: you, um, don't
[22:30:25] Radar: Diabolik: sure
[22:30:30] lupine: nor is it difficult ot set them anyway
[22:31:00] brahman: In this instance am not so sure how to keep it in the controller as the tasks is actually a join on 2 tables, the tasks and then the tasks metadata
[22:31:02] Radar: I'd love to be able to say ERB.render(view, locals: { ... }) or whatever the equivalent is
[22:31:13] brahman: the name is in the metadata table...
[22:31:20] Radar: I guess a lot of views aren't that simple
[22:32:02] lupine: Radar, well, you can
[22:33:31] Radar: lupine: "you can" and "Rails encourages it as the Rails Way(tm)" are two very different things.
[22:33:59] Radar: I've seen (and done) a lot of feature tests that are really just view tests.
[22:34:14] lupine: it's very, very common with render partials
[22:34:23] lupine: and again, setting instance variables is not hard
[22:34:28] zorak8: has joined #RubyOnRails
[22:34:44] lupine: view test are entirely a thing, it's just that nobody bothers
[22:34:54] vasilakisfil_: has joined #RubyOnRails
[22:35:40] __butch__: has joined #RubyOnRails
[22:38:53] rkofman: in any case, graphical-diffing view tests are much more interesting than a string compare ??? but that???s veering well off-topic :)
[22:39:11] momomomomo_: has joined #RubyOnRails
[22:39:18] w09x: has joined #RubyOnRails
[22:40:55] a346: has joined #RubyOnRails
[22:44:46] glennt: has joined #RubyOnRails
[22:49:33] arBmind1: has joined #RubyOnRails
[22:50:17] Rubie: has joined #RubyOnRails
[22:50:41] Exuma: has joined #RubyOnRails
[22:51:47] bar0n: has joined #RubyOnRails
[22:54:13] startupality: has joined #RubyOnRails
[22:54:38] pgatt: has joined #RubyOnRails
[22:54:48] lalalaaa: has joined #RubyOnRails
[22:56:36] Cache_Money: I'm trying to determine where to host a Rails app for my client. Choosing between DO and AWS. However, DO tells me a medium intance will have 60GB of SSD storage, AWS just stays "EBS Only". What does that mean?
[22:57:12] wethu: has joined #RubyOnRails
[22:57:52] doctorly: has joined #RubyOnRails
[22:58:01] lalalaaa: Hi! Anybody ever gotten net::ERR_INCOMPLETE_CHUNKED_ENCODING in production in Chrome and remember how they fixed it? (Uglifier + Puma + Nginx)
[22:58:23] smathy: Cache_Money, EBS is Amazon's block store product: http://aws.amazon.com/ebs/
[22:59:32] alex88: has joined #RubyOnRails
[22:59:50] Cache_Money: smathy: I plan on creating a monolithic app (DB, Web Serve, App Server all live on the same EC2 instance). Will the data in the DB be stored on EBS?
[23:01:17] smathy: Cache_Money, yes.
[23:03:40] Cache_Money: smathy: Will the setup process be any different on AWS than DO? I'm assuming they just charge me at the end of the month for how much I have on disk, correct?
[23:04:15] Cache_Money: it's $0.10 per GB-month, so only $6 if I use 60GB
[23:04:54] hotpancakes: has joined #RubyOnRails
[23:05:15] Slogger: Is there a clean way to set the form authenticity token prior to running an integration test without going through login requests manually or adding test-only methods to a controller?
[23:05:56] smathy: I think you have to select the size of the storage with EBS.
[23:06:12] smathy: ...but basically, yes.
[23:07:07] baweaver: has joined #RubyOnRails
[23:07:35] smathy: Slogger, you only need to visit the page with the form on it before submitting to get the right auth token, ie. no need to go through the whole login - you can just fake that (eg. by adding the right session var or mocking `current_user`)
[23:09:13] towski_: has joined #RubyOnRails
[23:09:38] bf4: has joined #RubyOnRails
[23:10:45] bronson: has joined #RubyOnRails
[23:14:08] Slogger: I think my situation is more complicated. I'm trying to avoid going through the whole login page request process as I'm accessing API endpoints. The form authenticity token is picked up and patched into all the ajax requests by default on the client side via JS (single page app basically), however when testing I haven't found a reasonable way to set the token before doing integration tests for the API (excluding manual requests for everything, incl
[23:15:18] startupality: has joined #RubyOnRails
[23:16:09] benlieb_: has joined #RubyOnRails
[23:16:32] wethu: has joined #RubyOnRails
[23:17:03] mary5030: has joined #RubyOnRails
[23:19:19] hardtail: has joined #RubyOnRails
[23:21:31] lalalaaa: has joined #RubyOnRails
[23:24:34] benlieb_: has joined #RubyOnRails
[23:28:59] DoctorMonocular: has joined #RubyOnRails
[23:30:41] Ropeney: has joined #RubyOnRails
[23:31:13] glenn__: has joined #RubyOnRails
[23:33:52] danman: has joined #RubyOnRails
[23:34:30] adanramone: has joined #RubyOnRails
[23:38:49] glennt: has joined #RubyOnRails
[23:40:48] emptyflask: has joined #RubyOnRails
[23:41:03] doodlehaus: has joined #RubyOnRails
[23:41:25] bronson: has joined #RubyOnRails
[23:43:53] malomalo: has joined #RubyOnRails
[23:44:14] bf4: has joined #RubyOnRails
[23:45:20] Pupeno: has joined #RubyOnRails
[23:45:20] Pupeno: has joined #RubyOnRails
[23:45:43] thmsmtylr: has joined #RubyOnRails
[23:46:31] rhizome: that sounds janky?
[23:46:33] speaking1ode: has joined #RubyOnRails
[23:47:48] Aeyrix: Radar: https://github.com/elixir-lang/elixir/blob/3eb938a0ba7db5c6cc13d390e6242f66fdc9ef00/CHANGELOG.md#v105-2015-06-29
[23:48:00] mikecmpbll: has joined #RubyOnRails
[23:48:06] Radar: oh new release :D
[23:48:16] Radar: I hadn't seen that yet
[23:48:22] Aeyrix: I just saw it on HN.
[23:49:16] Radar: Jos?? Valim is a gun.
[23:49:36] tubbo: has joined #RubyOnRails
[23:51:02] Slogger: It's not like rails provides great tooling for hbyrid web apps. Or at minimum it's not well covered in the main guides. I don't think the approach is ideal, but not sure what a reasonable alternative is.
[23:51:14] hotpancakes: has joined #RubyOnRails
[23:51:51] bar0n_: has joined #RubyOnRails
[23:52:52] Aeyrix: Sorry, I'm late to this party
[23:52:56] Aeyrix: what're you trying to do?
[23:53:03] Aeyrix: Feel free to c/p from previous chat.
[23:54:00] Slogger: Clean way to manually set form authenticity token in an integration test prior to making requests
[23:54:19] emptyflask: has joined #RubyOnRails
[23:54:52] Scripore: has joined #RubyOnRails
[23:55:05] Aeyrix: I swear I saw something for this a few days ago.
[23:55:16] Aeyrix: Specifically for int testing.
[23:55:27] Radar: Slogger: Can I ask why you're wanting to do that?
[23:56:06] pixelhandler: has joined #RubyOnRails
[23:56:49] Slogger: So I can test a set on endpoints without turning off forgery protection and without repeating everything done in the tests for logging in.
[23:56:58] Slogger: *set of not set on
[23:57:54] Slogger: (API style endpoints returning JSON)
[23:58:39] Miesco: has joined #RubyOnRails
[23:58:49] Miesco: Hi, I am getting this error when I run 'rails new':
[23:58:52] Miesco: /usr/bin/ruby2.1: No such file or directory -- /usr/share/rubygems-integration/all/gems/bundler-1.7.4/bin/bundle (LoadError)
[23:59:01] eggoez: has joined #RubyOnRails
[23:59:12] athos_diddy: has joined #RubyOnRails