#RubyOnRails - 16 April 2018
« Back 1 day Forward 1 day »
[09:25:13] dminuoso: Or maybe someone here has an idea. I have an AR transaction block followed by a redirect.
[09:26:40] dminuoso: I, [2018-04-16T11:04:54.368068 #51135] INFO -- : Completed 302 Found in 23340ms (ActiveRecord: 62.1ms
[14:04:24] skroon: I would like to upgrade a gem to the latest possible, should I modify the Gemfile with that specific version and call bundle, or is there a bunlder way of doing this?
[14:04:44] skroon: running bunlde update mygem doesn't upgrade it to the latest, i'm wondering what is preventing it
[14:17:19] dminuoso: info "email@example.com" is an optional dependency and failed compatibility check. Excluding it from installation.
[14:17:26] dminuoso: yarn install stderr: error firstname.lastname@example.org: The platform "linux" is incompatible with this module.
[18:02:45] jamesst20: Hi, would someone kindly explain me why on the array b there is 2 elements ? https://i.imgur.com/9l2QvlY.png
[19:37:04] amperry: hi folks, I fear the answer is "no, you've got to roll your own", but can someone confirm that you cannot do transitive (i.e., `:has_many :through`) associations when using cocoon's `link_to_add_association` helper? Gist here: https://gist.github.com/amp108/b18acf50ac9395af19324aac55c49257
[19:40:59] Sylario: In active Model Serializer, when you have defined key in the serialization, do you have to translate back to the initial value manually? It seems ams deserialization ignore keys
[19:43:00] amperry: afk, going to look up nested forms using jquery, et al; I really think there's no way to get cocoon to do it.
[21:29:00] amperry: so if I have a method, placements#sign_lease, how do I create a link_to it? I've tried this:
[21:29:43] amperry: but the link that creates doesn't include the id, and therefore neither does the resulting params hash.
[22:02:42] amperry: curious: I've got a method, placements#sign_lease, and a link that goes to http://localhost:3000/sign_lease/71, but I seem to be sidestepping placements#sign_lease.
[22:03:41] amperry: but I have byebug in the definition of sign_lease, and I'm not hitting it; instead, I'm redirecting to the home page
[22:07:11] amperry: And I would expect rails to halt inside 'def sign_lease' before it complained about missing templates or something.
[22:07:44] amperry: hard to say; relatively small, but there are definite oddities about it due to how weird the legacy data is.
[22:16:27] amperry: I might. This is a pretty nascent method right now, I was just wondering why I couldn't actually get to it.
[22:17:34] amperry: and now, with some fiddling, I think I've got it, but still have no real indication of what was wrong in the first place.
[22:19:25] samort7: My wife has inadvertently learned to program from me talking through code with her to help me figure it out
[22:20:33] amperry: the link_to call specifies 'method: :post', but if I remove "get '/sign_lease/:id'" from routes.rb, it doesn't go to the right place.
[22:28:13] MrPunkin: Anyone here use Mocha with testing? Trying to figure out how I can fake a return the first time a method is called in a loop, but allow the second+ times to run as normal. Anyone have any info?
[22:33:16] samort7: Unrelated, but I just found the best cheatsheet: https://devhints.io/rails-models
[22:35:16] amperry: samort7: googling and seeing something about jquery and turbolinks, so that could be something. Won't be the first time Rails' magic was a little too little David Copperfield and a little too much David Blaine.
[22:36:37] cagomez: I messed up a migration. is it ok to delete the row from `schema_migrations` table?
[22:36:46] samort7: amperry: good info here that might help https://stackoverflow.com/questions/778385/rails-post-put-get
[22:39:19] samort7: cagomez: take a look at this page https://stackoverflow.com/questions/3647685/how-to-rollback-a-specific-migration
[23:33:24] cagomez: what is the default command run when doing bundle exec rake db:migrate? is it a shorthand for bundle exec rake db:migrate:up?