« Back to channel list

#RubyOnRails - 01 June 2017

« Back 1 day Forward 1 day »
[00:02:22] ur5us: has joined #RubyOnRails
[00:05:42] troys: has joined #RubyOnRails
[00:09:55] adrianvalenz: has joined #RubyOnRails
[00:15:53] ascarter: has joined #RubyOnRails
[00:16:24] chouhoulis: has joined #RubyOnRails
[00:20:45] ascarter: has joined #RubyOnRails
[00:27:03] kies: has joined #RubyOnRails
[00:29:35] Technodrome: has joined #RubyOnRails
[00:32:41] Kestrel-029: has joined #RubyOnRails
[00:33:14] Rodya_: has joined #RubyOnRails
[00:38:20] adrianvalenz: has joined #RubyOnRails
[00:39:25] quazimodo: has joined #RubyOnRails
[00:43:36] Brent___: has joined #RubyOnRails
[00:46:02] adrianvalenz: Hey if anyone is familiar with Stripe. I set up a charges_controller like in their docs, and I have an Item model. After the User creates a new Item I want the User to have the option of listing on the website as an active ad. I gave the Item an attribute of `active:boolean, default: false`. I figured I would associate the models as `Item has_many :charges` and `Charge belongs_to :item`, I even
[00:46:08] adrianvalenz: adjusted routes.rb to have `resources :items { resources :charges }`...when it gets to the /create method it loses track of the params of the `item_id`. Don't know what to do.
[00:59:52] apparition: has joined #RubyOnRails
[01:01:19] mattwc: if its a nested charge route shouldn't the url end up being /items/itemid/charges/create? so the item id is part of the url
[01:05:14] adrianvalenz: mattwc: Yea the URL is exactly that, but how do I have it change the Item.active=true from it's default of false?
[01:07:42] mattwc: So the item can only be made active once? You'd need to update it in code when you hit the condition that should make it true
[01:10:12] adrianvalenz: I was thinking something like `if charge["paid"] == true { Item.active.toggle! }
[01:10:53] adrianvalenz: mattwc: But how do I tell the Item object that the charge has been successful?
[01:12:10] mattwc: You could only create a charge if the charge is successful, it should have a foreign key to the item since rails would so that automatically
[01:13:11] sevenseacat: has joined #RubyOnRails
[01:13:18] ascarter: has joined #RubyOnRails
[01:13:46] quazimodo: has joined #RubyOnRails
[01:15:58] adrianvalenz: mattwc: Should I have an `after_action :activate_item` where it checks if charge was successful on the item_id? and add that Item.active.toggle! in it as a private method?
[01:16:39] mattwc: I would just mark the item as active when you check the response from stripe
[01:17:43] adrianvalenz: mattwc: not sure how to go about that :(
[01:18:05] mattwc: Like you had in your if statement
[01:19:30] adrianvalenz: mattwc: How do I check the response from stripe? So no need for an after_action? I'm not sure where to put the if charge["paid"] == true statement
[01:20:26] ur5us: has joined #RubyOnRails
[01:21:06] mattwc: The create charge api call returns a charge object (or throws an exception) if you get a charge back then activate the item
[01:25:12] adrianvalenz: I'm also using a Charge model to keep track of charge history, but in the Create method I'm thinking ` @item = Charge.item_id.active.toggle!`
[01:26:07] adrianvalenz: mattwc: Charge model in my Rails app won't conflict with Charge model from Stripe::Charge ?
[01:26:48] mattwc: Ruby has name spacing for that
[01:27:36] adrianvalenz: mattwc: Thank you for your time good sir. It is much appreciated! I will try something out again.
[01:30:20] adrianvalenz: has left #RubyOnRails: ()
[01:34:07] ascarter: has joined #RubyOnRails
[01:37:46] ascarter: has joined #RubyOnRails
[01:41:19] ur5us: has joined #RubyOnRails
[01:42:13] rakm: has joined #RubyOnRails
[01:52:35] xx00__: has joined #RubyOnRails
[02:04:16] irishfromua: has joined #RubyOnRails
[02:04:27] Jameser: has joined #RubyOnRails
[02:30:13] ur5us: has joined #RubyOnRails
[02:31:26] ascarter: has joined #RubyOnRails
[02:35:20] irishfromua: has joined #RubyOnRails
[02:35:24] TinkerTyper: has joined #RubyOnRails
[02:36:45] Jameser: has joined #RubyOnRails
[02:40:25] urkle: has joined #RubyOnRails
[02:48:41] ur5us: has joined #RubyOnRails
[02:49:27] Technodrome: has joined #RubyOnRails
[02:50:05] Saukk: has joined #RubyOnRails
[03:03:01] sandstrom: has joined #RubyOnRails
[03:43:49] Trynemjoel: has joined #RubyOnRails
[04:02:54] irishfromua: has joined #RubyOnRails
[04:04:07] xall: has joined #RubyOnRails
[04:06:23] kies: has joined #RubyOnRails
[04:17:56] Gizmokid2005: has joined #RubyOnRails
[04:20:49] xall: has joined #RubyOnRails
[04:21:41] xall: has joined #RubyOnRails
[04:25:23] xall: has joined #RubyOnRails
[04:25:35] urkle: has joined #RubyOnRails
[04:27:08] xall: has joined #RubyOnRails
[04:27:58] xall: has joined #RubyOnRails
[04:29:38] xall: has joined #RubyOnRails
[04:41:08] konsolebox: has joined #RubyOnRails
[04:43:00] staticfox: has joined #RubyOnRails
[04:55:29] xMopxShell: has joined #RubyOnRails
[04:56:43] Gizmokid2005: has joined #RubyOnRails
[04:57:08] uksio: has joined #RubyOnRails
[04:58:27] uks: has joined #RubyOnRails
[05:00:21] biox: has joined #RubyOnRails
[05:03:17] staticfox: has joined #RubyOnRails
[05:06:32] uks: has joined #RubyOnRails
[05:13:56] harfangk: has joined #RubyOnRails
[05:33:12] kies: has joined #RubyOnRails
[05:36:37] Rodya_: has joined #RubyOnRails
[05:37:53] rgr_: has joined #RubyOnRails
[05:47:58] uks: has joined #RubyOnRails
[05:49:39] drale2k_: has joined #RubyOnRails
[06:23:34] armando: has joined #RubyOnRails
[06:45:40] conta: has joined #RubyOnRails
[06:50:47] ur5us: has joined #RubyOnRails
[06:56:49] srinidhi: has joined #RubyOnRails
[07:00:11] arBmind: has joined #RubyOnRails
[07:02:28] sandstrom: has joined #RubyOnRails
[07:06:08] srinidhi: has joined #RubyOnRails
[07:19:46] Pumukel: has joined #RubyOnRails
[07:20:05] adrianvalenz: has joined #RubyOnRails
[07:20:18] srinidhi: has joined #RubyOnRails
[07:29:08] roshanavand: has joined #RubyOnRails
[07:35:37] adrianvalenz: I'm stressing outt lol
[07:36:01] sevenseacat: good to know.
[07:36:27] adrianvalenz: I'm trying to set a boolean to true in an Item model when a charge is succesful in the Charges controller...
[07:37:21] sevenseacat: and what problems are you having while doing that?
[07:40:57] adrianvalenz: I set up a simple Charges controller with Stripe API like in their docs, and I have an Item model up and running. The Item model has a boolean attribute `active:boolean, default: false`...I associated them `Item has_many :charges` and `Charge belongs_to :item` so the charges table has an item_id...I try to `.toggle!` the attribute if charge is successful
[07:41:20] sevenseacat: it might be easier to show the code you currently have, and any errors you're getting
[07:41:22] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[07:43:12] adrianvalenz: Here is the gist!
[07:43:15] adrianvalenz: https://gist.github.com/adrianvalenz/ade2945104f6fb11e1ba5375574a951b
[07:44:04] sevenseacat: whats happening on line 21?
[07:44:18] adrianvalenz: I'm not sure if I have to also whitelist some params...I get the error undefined method for `item_id`
[07:44:36] sevenseacat: whats the line actually trying to do?
[07:45:48] adrianvalenz: That's where I get confused, I'm trying to get the item that the charge is associated with via the item_id, and then toggle on the boolean attribute `active` to equal true
[07:46:05] adrianvalenz: I've tried different iterations of it and I can't figure it out
[07:46:12] sevenseacat: at the moment, you don't have a change or an item
[07:46:32] sevenseacat: you only have stripe stuff
[07:47:13] sevenseacat: are you meant to be creating a new Charge record in this action?
[07:48:12] adrianvalenz: The item is already create and it has it's own controller and model, the app allows users to create items, but if they want to list (activate) the item to show up on the website (like an ad listing) they have to pay a fee, after the fee is paid it will `active=true` on the item model
[07:48:55] adrianvalenz: I plan to also record charges for each item so it has a history, but for now I'm trying to even just get it to activate the Item model
[07:49:15] sevenseacat: are you submitting the item ID as part of the params to this controller?
[07:49:31] sevenseacat: because it sounds like you want to build a new Charge record using that item ID
[07:50:51] rgr_: has joined #RubyOnRails
[07:50:57] adrianvalenz: Yea when I'm on the form to create a new charge, the params available shows the item_id
[07:51:00] adrianvalenz: Started GET "/items/14/charges/new" for ::1 at 2017-06-01 00:31:08 -0700
[07:51:02] adrianvalenz: Processing by ChargesController#new as HTML
[07:51:05] adrianvalenz: Parameters: {"item_id"=>"14"}
[07:51:15] sevenseacat: thats not the create action though
[07:51:32] adrianvalenz: Started POST "/items/14/charges" for ::1 at 2017-06-01 00:31:25 -0700
[07:51:32] adrianvalenz: Processing by ChargesController#create as HTML
[07:51:32] adrianvalenz: Parameters: {"utf8"=>"✓", "authenticity_token"=>"p5niGjLVqmbPfBe+IV8r4rIBABjZ+yyH6r8oxLqHGwINwwUKF74Lwzk4GdWwWXqEgPr5O/XR0raRfUm4OGTOPw==", "stripeToken"=>"tok_1APnmALe1zXNUn339OjLSqFb", "stripeTokenType"=>"card", "stripeEmail"=>"avalenzuela85@gmail.com", "item_id"=>"14"}
[07:51:37] adrianvalenz: Charge Load (0.1ms) SELECT "charges".* FROM "charges" WHERE "charges"."id" = ? LIMIT ? [["id", nil], ["LIMIT", 1]]
[07:51:40] arBmind: has joined #RubyOnRails
[07:51:40] adrianvalenz: Completed 404 Not Found in 1336ms (ActiveRecord: 0.5ms)
[07:51:42] adrianvalenz: ^^^ create action
[07:51:51] sevenseacat: please don't spam the channel, please use gist for sharing code and logs
[07:52:07] adrianvalenz: I'm sorry. Still new to IRC
[07:52:41] sevenseacat: so typically, you would want to do two things in your create action - load the Item record using the item ID, and then create a Charge for it
[07:53:22] adrianvalenz: Ahh, I don't think I loaded it
[07:56:13] adrianvalenz: I'm not sure how to do this... but here is my next gist https://gist.github.com/adrianvalenz/ade2945104f6fb11e1ba5375574a951b
[07:56:34] mikecmpbll: has joined #RubyOnRails
[07:56:46] sevenseacat: so in your Items controller, how did you load the item for editing or deleting?
[07:56:56] sevenseacat: you'd need to do the same thing here
[07:58:27] adrianvalenz: I did something like ` @item = Item.find(params[:id])
[07:58:40] adrianvalenz: Sorry forgot, let me make a gist
[07:58:43] sevenseacat: thats what you need to do here too, with the right param
[08:00:46] ur5us: has joined #RubyOnRails
[08:02:45] adrianvalenz: I think it is this https://gist.github.com/adrianvalenz/c540d54034637332fad76bdd3eedbbd8
[08:03:08] mtkd: has joined #RubyOnRails
[08:04:24] adrianvalenz: I'm really stumped on whether I should use Item.find or Charge.find on that create action
[08:04:48] sevenseacat: well what are you trying to find, an item or a charge? thats the one you use
[08:05:37] konsolebox: has joined #RubyOnRails
[08:08:15] adrianvalenz: **face palm**
[08:08:21] adrianvalenz: You're right :D
[08:08:26] adrianvalenz: Ok I'm going to try it out
[08:08:48] Technodrome: has joined #RubyOnRails
[08:17:07] adrianvalenz: It looks like it grabbed the correct item, but the .toggle! method failed
[08:17:28] adrianvalenz: it was a NoMethodError undefined...weird.
[08:18:03] sevenseacat: probably not weird :) what does your code look like now?
[08:20:25] urkle: has joined #RubyOnRails
[08:20:54] Technodrome: has joined #RubyOnRails
[08:20:56] arBmind: has joined #RubyOnRails
[08:24:14] Pumukel: has joined #RubyOnRails
[08:38:21] adrianvalenz: has joined #RubyOnRails
[08:38:30] adrianvalenz: Now it looks like this https://gist.github.com/adrianvalenz/415c90d77b9bc60738ab0c60b8207bd4
[08:40:15] adrianvalenz: sevenseacat: ^^^ :D
[08:41:06] mahloun: has joined #RubyOnRails
[08:47:00] adrianvalenz: I added the error it threw to this gist with the current code https://gist.github.com/adrianvalenz/415c90d77b9bc60738ab0c60b8207bd4
[08:48:13] adrianvalenz: I think we're getting closer though! :D
[08:55:33] halogenandtoast: has joined #RubyOnRails
[08:56:08] halogenandtoast: has anyone ever encountered ActiveSupport::TimeWithZone#to_json crashing
[08:56:26] halogenandtoast: it straight up exists rails console if I run the following code
[08:56:41] halogenandtoast: ActiveSupport::TimeWithZone.new(Time.now, nil).to_json
[08:59:03] sevenseacat: halogenandtoast: works here - well, doesnt work, but doesnt crash the console
[08:59:13] sevenseacat: I get NoMethodError: undefined method `period_for_utc' for nil:NilClass
[08:59:14] halogenandtoast: sevenseacat: with v 5.0.3
[08:59:58] xall: has joined #RubyOnRails
[09:00:55] adrianvalenz: I'm so happy. thank you
[09:01:01] adrianvalenz: One battle has one
[09:01:08] lxsameer: has joined #RubyOnRails
[09:04:12] halogenandtoast: sevenseacat: thanks I tried it in isolation and it doesn't crash
[09:04:21] halogenandtoast: So I think there is some conflict somewhere
[09:08:18] Doldge: has joined #RubyOnRails
[09:13:51] halogenandtoast: sevenseacat: looks like it has to do with Oj and Oj.mimic_JSON
[09:13:58] halogenandtoast: not sure what this is, investigating
[09:14:08] sevenseacat: oj is a json parser I think
[09:14:22] sevenseacat: my app doesn't have it
[09:14:30] Pumukel: has joined #RubyOnRails
[09:15:48] halogenandtoast: right, I figured, just giving an update on what crazy thing could be happening
[09:15:56] halogenandtoast: that would exit without an error or stacktrace
[09:18:18] Fernando-Basso: has joined #RubyOnRails
[09:24:51] arBmind: has joined #RubyOnRails
[09:34:11] ahrs: has joined #RubyOnRails
[09:38:28] andywww: has joined #RubyOnRails
[09:39:25] srinidhi: has joined #RubyOnRails
[09:40:24] marr: has joined #RubyOnRails
[09:41:24] dionysus69: has joined #RubyOnRails
[09:54:34] ErhardtMundt: has joined #RubyOnRails
[10:02:35] patarr: has joined #RubyOnRails
[10:27:39] xall: has joined #RubyOnRails
[10:38:47] Doddlin: has joined #RubyOnRails
[10:59:35] acosonic: has joined #RubyOnRails
[10:59:43] HoierM: has joined #RubyOnRails
[11:00:58] HoierM: has joined #RubyOnRails
[11:01:51] acosonic: I can't get on green branch with rails routing... So I have Mns2NotificationsSettingsController and filename is mns2_notifications_setting.rb and in my routes I have match 'mns2_notifications_settings/:id/update', :controller => 'mns2_notifications_settings', :action => 'edit', :via => [:get, :post, :put] and I don't have model, but when I try posting on that controller via form that I created like controller=> action=> with form tag I get
[11:01:53] acosonic: uninitialized constant Mns2NotificationsSettingsController
[11:02:05] ferr1: has joined #RubyOnRails
[11:02:14] acosonic: I'm sick of this problem, I'm trying to solve it for days
[11:02:52] xall: has joined #RubyOnRails
[11:04:47] acosonic: maybe its because I don't have model or something I hate ruby debug messages it's very bad, compared to other frameworks
[11:19:41] Jameser: has joined #RubyOnRails
[11:20:42] HoierM: acosonic: Your filename should be mns2_notifications_settings. Missing an "s" in the end.
[11:21:39] acosonic: I tried both, but end up with same result
[11:24:27] HoierM: Did you restart the server when you made the filename change? Never works for me if I don't do that.
[11:24:53] acosonic: and this is what I have when I run rake routes
[11:24:56] acosonic: GET|POST|PUT /mns2_notifications_settings/:id/update(.:format) mns2_notifications_settings#update
[11:24:57] acosonic: GET|POST|PUT /projects/:id/mns2_notifications_settings/:action(.:format) mns2_notifications_settings#:action
[11:26:12] urkle: has joined #RubyOnRails
[11:31:26] arup_r: has joined #RubyOnRails
[11:33:20] konsolebox: has joined #RubyOnRails
[11:38:05] apparition: has joined #RubyOnRails
[11:41:31] HoierM: The controller is inside controllers/ and not a subfolder, right? I don't think that that changes much, but worth asking. Sorry, but from what I see it should be working. The weird part is doing GET on a edit action, that's not recommended: http://guides.rubyonrails.org/routing.html (section 3.7)
[11:43:01] rgr: has joined #RubyOnRails
[11:45:45] acosonic: Yeah, I'm developing a plugin for Redmine though
[11:49:41] soahccc: has joined #RubyOnRails
[11:53:55] soahccc: I'm trying to understand why a request takes so long. Is there anything exceptionally special about dev-mode to take into account? I mean it's slower in general but as long as I compare warm-requests (first request after change takes longer) it should be representative?
[11:55:18] workmad3: soahccc: caching is also frequently disabled in dev-mode
[11:56:07] soahccc: workmad3: yeah thats true but the issue I'm having is to figure out where the overhead of the first _comments partial is coming from: https://gist.github.com/2called-chaos/b3f208e3c3c807c29135802afa05d705
[11:56:44] soahccc: it's not the pagination and not the present() call and all the child renders combined there are 200ms out of nowhere
[11:56:58] workmad3: soahccc: it's probably because you're running a query inside that render
[11:57:19] workmad3: soahccc: and one that pulls in 4 tables at that...
[11:57:57] soahccc: workmad3: you mean in line 1? It should only load the records if I'm using it right? That would be in the benchmark (as present does an each on the collection)
[11:58:04] soahccc: and it's not that, it takes only 10ms
[11:58:39] workmad3: soahccc: the `.includes` can be lazy-loaded on first use too
[11:59:18] soahccc: workmad3: but it would reflect here right? forgot to add that to the log: Completed 200 OK in 407ms (Views: 355.0ms | ActiveRecord: 12.6ms)
[11:59:38] soahccc: wasn't the same request but AR is always very small amount
[11:59:58] workmad3: not necesarily... I've seen AR tracing fail badly if queries are run in views
[12:00:08] soahccc: the thing is that due to a lot of permission related stuff it's very hard to cache this and it's as slow in production
[12:01:05] cesarstafe: has joined #RubyOnRails
[12:02:34] workmad3: tbh, given the way the view is written, it's pretty hard to tell what could be at fault
[12:03:28] workmad3: I'd be looking suspiciously at potential lazy-loading, how often the `rescue` clause is invoked, how long the `present(c.user)` call takes in aggregate, etc.
[12:03:39] workmad3: it'd probably be sensible to get some proper profiling in place tbh
[12:03:51] workmad3: https://github.com/MiniProfiler/rack-mini-profiler
[12:04:16] cesarstafe: ppl, a question here, I am programming a Capybara Rspec test feature and I can't see any different behavior in the result of my test when I change some code in a coffee.erb file. I mean, if I put in my code for example $('button.save').html('whatever') it is not reflected there changing the text of the button
[12:04:54] uksio: has joined #RubyOnRails
[12:04:54] cesarstafe: I am using page.save_screenshot to see the results
[12:05:08] workmad3: cesarstafe: are you using a javascript-capable driver? and are you giving the driver a chance to hit any relevant events in the page?
[12:05:40] soahccc: workmad3: you say the SQL tracing is not that good, but I should see all the individual queries in the output or are there some missing as well?
[12:06:11] workmad3: soahccc: you should see the queries it runs... but also bear in mind that the speed of the queries doesn't represent the time taken to build objcets
[12:07:03] Pumukel: has joined #RubyOnRails
[12:08:21] cesarstafe: workmad3: I have configured this in my spec_helper.rb .. Capybara.javascript_driver = :poltergeist
[12:08:28] Pumukel: has joined #RubyOnRails
[12:08:32] workmad3: soahccc: basically, get more in-depth profiling set up so you have more data... the amount you get from the basic rails tracing is pretty much useless for tracing actual performance issues
[12:08:45] workmad3: the most it gives you is a general pointer towards a file
[12:08:59] workmad3: gotta go, lunch
[12:09:16] cesarstafe: workmad3: I have configured this in my spec_helper.rb .. Capybara.javascript_driver = :poltergeist with js: true
[12:09:49] soahccc: workmad3: I know that the view is kindof dirty :> But it's not the present method (and at least main entry query) since I output the realtime it takes and it's ~10ms. I mean it's only 7 entries. and it takes up to a second to render and SQL never seems to be an issue. It would also reflect in the child-renders as I often have more childrens than root-comments. I was just wondering where the overhead is coming from, maybe internally the outputs
[12:09:49] soahccc: get concatenated at this point?
[12:19:03] soahccc: I tried it with rack mini profiler and I do have a few more queries in the long-taking render but the SQL time is 1.2ms and you can usually count the records fetched with your hands, nothing that would take 200ms
[12:29:28] ur5us: has joined #RubyOnRails
[12:32:05] arBmind: has joined #RubyOnRails
[12:40:08] workmad3: soahccc: anything else in the profile? Like the second `present` method?
[12:40:27] workmad3: (the one that isn't in the benchmark)
[12:41:34] soahccc: workmad3: oh you mean for the user? I just commented out basically everything and I figured that calling render seems to increase the runtime of the parent partial by a good amount at least according to mini profiler
[12:42:30] nir0: has joined #RubyOnRails
[12:42:40] soahccc: workmad3: if I remove both render calls it's sane, using either render call drastically increases the time for the parent but I don't know why, I even printed everything I passed to the partial so it's not that
[12:43:06] soahccc: is there are performance thing if you call the same partial you are in or something? it's weird. also only on the first level
[12:44:14] nir0: hey guys, i've got some strange error. if i try helper users_path(something: 1) it returns /users?something=1 in view. when running spec it displays error no route found
[12:44:28] nir0: without additional params it works just fine
[12:44:57] nir0: this spec was written a month ago, and broken today
[12:46:27] nir0: ai think that's because i extended routes with engines routes
[12:46:49] nir0: like this view.extend Apc::Engine.routes.url_helpers
[12:47:18] nir0: in spec/rails_helper.rb
[12:47:49] nir0: how do i include those engine routes without breaking anything else?
[12:48:46] workmad3: soahccc: setting up a new context is one of the heavier-weight things that happens during a render
[12:50:32] cesarstafe: ppl, a question about acceptance tests... I have a coffee.erb that I modify to check the behavior but when I run tests I do not see changes.. I am using this driver config in spec_helper Capybara.current_driver = :poltergeist
[12:52:36] cesarstafe: here my spec_helper.rb at https://gist.github.com/cesarediaz/58260b8f5a7b09fe6d20802dc4f7be86
[12:53:47] adgtl: Hi, I am getting this error
[12:54:33] adgtl: LoadError (Unable to autoload constant FirmwareUpdate, expected ...app/models/xyz/firmware_update.rb to define it
[12:54:36] cesarstafe: and my test https://gist.github.com/cesarediaz/68f58f4d126374413c1c47a8258f6ed8
[12:54:40] soahccc: workmad3: I know that render has some weight to it but it should be for every call no? I can pm you a link to the profiling result if you have a minute.
[12:54:58] adgtl: byt my file has Xyz::FirmwareUpdate class
[12:55:07] adgtl: Anyone here know what could the issue?
[12:55:14] Jameser: has joined #RubyOnRails
[12:56:34] chouhoulis: has joined #RubyOnRails
[12:56:53] tbuehlmann: adgtl: did you restart the server/console after adding the xyz folder? also, can you gist the contents of that file?
[12:57:03] adgtl: tbuehlmann yes
[12:58:18] adgtl: tbuehlmann here it is https://gist.github.com/anildigital/9552e73bcceefefbb8402d0e57afabb4
[12:58:42] adgtl: file resides in app/models/xyz/firmware_update.rb
[12:58:50] tbuehlmann: looks good to me. are you using spring?
[13:00:59] adgtl: tbuehlmann nope
[13:02:45] tbuehlmann: no idea then
[13:11:18] adgtl: tbuehlmann okay
[13:29:10] Technodrome: has joined #RubyOnRails
[13:42:13] Technodrome: has joined #RubyOnRails
[13:45:44] HoierM: has joined #RubyOnRails
[13:48:26] Jameser: has joined #RubyOnRails
[14:06:05] Jameser: has joined #RubyOnRails
[14:08:29] andywww: has joined #RubyOnRails
[14:08:49] andywww: can someone help me out and tell me what might be causing this issue?
[14:08:50] andywww: https://gist.github.com/wanabewired/116756d06bc73116bf67ad56ab4cd5da
[14:12:39] Jardayn: has joined #RubyOnRails
[14:13:01] Jardayn: Yo guys. I have a problem. Running RoR on Apache2 through passenger
[14:13:03] Jardayn: and getting cannot load such file -- bundler/setup (LoadError)
[14:13:06] Jardayn: but the bundler is set upo
[14:13:24] mahloun: has joined #RubyOnRails
[14:14:08] mustmodify: has joined #RubyOnRails
[14:14:59] mustmodify: Is there a way to get sass to work but still have Rails load each file separately in dev mode so I can actually see where problems are coming from? I assume no...
[14:15:15] mustmodify: at least get comments added to the CSS pointing me to the correct file?
[14:15:21] mustmodify: and line number?
[14:18:46] daemonwrangler: has joined #RubyOnRails
[14:24:40] Jameser: has joined #RubyOnRails
[14:25:13] mahloun: has joined #RubyOnRails
[14:27:09] Pumukel: has joined #RubyOnRails
[14:27:33] AphelionZ: has joined #RubyOnRails
[14:27:38] mustmodify: Since SASS is precompiled it would have to comple the files and then emit them separately which would be weird.
[14:27:45] andywww: answered in #ruby, thanks
[14:30:43] workmad3: has joined #RubyOnRails
[14:34:10] mikecmpb_: has joined #RubyOnRails
[14:37:30] xx00__: has joined #RubyOnRails
[14:40:58] marr: has joined #RubyOnRails
[14:42:05] Jameser: has joined #RubyOnRails
[14:49:19] FoolsGambit: has joined #RubyOnRails
[14:50:23] mikecmpbll: has joined #RubyOnRails
[14:53:16] patarr: has joined #RubyOnRails
[15:00:12] arup_r: has joined #RubyOnRails
[15:07:51] Jameser: has joined #RubyOnRails
[15:08:26] futilegames: has joined #RubyOnRails
[15:11:01] mordof: has joined #RubyOnRails
[15:14:19] LightStalker: has joined #RubyOnRails
[15:15:11] Jameser: has joined #RubyOnRails
[15:20:47] luckyruby: has joined #RubyOnRails
[15:23:17] luckyruby: When a parent gets destroyed with :dependent => :destroy, child.marked_for_destruction? #=> false during the child's before_destroy callback. Is that expected behavior or a bug?
[15:23:53] luckyruby: Rails 5.0.2 btw
[15:24:15] luckyruby: also autosave: true is set
[15:25:51] linetrace: has left #RubyOnRails: ()
[15:28:28] mustmodify: seems like a bug, whether it's expected or not. :)
[15:28:31] xx00__: has joined #RubyOnRails
[15:28:32] Jameser: has joined #RubyOnRails
[15:29:03] pupsicle: has joined #RubyOnRails
[15:33:37] matthewd: luckyruby: marked_for_destruction is a fairly specific concept, IIRC -- even an outright .destroy doesn't set it, I don't think
[15:36:02] Technodrome: has joined #RubyOnRails
[15:37:56] NoGodDamnIdea: has joined #RubyOnRails
[15:39:33] luckyruby: matthewd: is there another method I can use to reliably detect when the record is going to be deleted?
[15:40:03] matthewd: luckyruby: If you're in before_destroy, that's a pretty good sign
[15:42:58] ascarter: has joined #RubyOnRails
[15:43:51] troys: has joined #RubyOnRails
[15:45:48] zacts: has joined #RubyOnRails
[15:45:56] luckyruby: matthewd: My child callbacks: https://gist.github.com/luckyruby/9b7c14694b95e60b8a3e477604f17f47. Would you pass in an argument into the method as a workaround?
[15:52:48] matthewd: Yeah, I think I'd do it with separated callbacks
[15:56:07] AzaToth: has joined #RubyOnRails
[15:57:40] gusrub: has joined #RubyOnRails
[15:59:00] cschneid_: has joined #RubyOnRails
[15:59:04] frem_: has joined #RubyOnRails
[15:59:24] catphish: has joined #RubyOnRails
[16:04:10] SteenJobs: has joined #RubyOnRails
[16:04:35] xx00__: has joined #RubyOnRails
[16:05:43] dionysus69: has joined #RubyOnRails
[16:12:25] Matrix9180: has joined #RubyOnRails
[16:12:48] tanuki: has joined #RubyOnRails
[16:14:47] tanuki: has joined #RubyOnRails
[16:20:05] bkulbida: has joined #RubyOnRails
[16:25:15] knight33: has joined #RubyOnRails
[16:30:44] bkulbida: has joined #RubyOnRails
[16:30:48] SteenJobs_: has joined #RubyOnRails
[16:34:59] jane_booty_doe: has joined #RubyOnRails
[16:38:03] zacts: has joined #RubyOnRails
[16:48:40] roshanavand: has joined #RubyOnRails
[16:50:05] joeyk: has joined #RubyOnRails
[16:52:45] joeyk: I have a two part question. I'm developing a rails application that will be doing authentication/authorization based on client certicates. So the first question is, is there a way to have the `thin` server forward the client certificate information in request. The second is, any recommendations on how to get rspec and the like to use certificates for testing?
[16:56:18] workmad3: joeyk: I don't believe that Thin supports SSL natively, which would be problematic for client-certificates. I'd recommend considering Puma instead of Thin for this
[16:57:22] workmad3: joeyk: similarly, for testing, you'd need to somehow have a test CA set up to provide test certificates automatically and then set up your testing server to speak the appropriate SSL protocol (like TLS v1.2) so you can pass the certificate in the correct fashion
[16:57:32] mustmodify: has left #RubyOnRails: ()
[16:59:06] Technodrome: has joined #RubyOnRails
[17:00:07] gusrub: has joined #RubyOnRails
[17:00:22] rakm: has joined #RubyOnRails
[17:03:50] ascarter: has joined #RubyOnRails
[17:08:21] nickjj: joeyk, i would keep your rails dumb of SSL and just proxy it with nginx, this way you can use thin or whatever rails app server you want
[17:09:01] fryguy: i don't think either of you know what client certificates are
[17:09:47] duderonomy: has joined #RubyOnRails
[17:10:12] mordof: so nginx proxy is still the desirable way to handle that?
[17:16:02] barhum2013: has joined #RubyOnRails
[17:16:13] centrx: has joined #RubyOnRails
[17:17:54] DLSteve: has joined #RubyOnRails
[17:20:27] pLaTo0n: has joined #RubyOnRails
[17:22:14] xall: has joined #RubyOnRails
[17:23:25] brent__: has joined #RubyOnRails
[17:26:43] bruce_lee: has joined #RubyOnRails
[17:27:32] roshanavand: has joined #RubyOnRails
[17:28:41] ascarter: has joined #RubyOnRails
[17:29:08] Cache_Money: has joined #RubyOnRails
[17:29:09] roshanavand: has joined #RubyOnRails
[17:29:55] joeyk: fryguy: hmm?
[17:31:32] chouhoulis: has joined #RubyOnRails
[17:32:49] joeyk: actually using apache+passenger with a CA verification. But I still want to process the client certificate in the rails application. In Apache I can forward the client certificate to the rails application and access it via request.headers[].. I was wondering if I could get thin to forward the same header information.
[17:38:15] workmad3: joeyk: oh, if you're able to add it as a header being passed on to the app server, it should just be made available in your request headers in rails
[17:39:44] workmad3: joeyk: although it might be somewhat problematic if Apache passes it along as a request environment variable rather than a request header to the upstream (which could be the case)... in that situation, you need an app server that essentially runs 'in-process' with Apache, which could easily tie you to passenger :(
[17:40:13] fcser_: has joined #RubyOnRails
[17:40:24] workmad3: (I've had that situation in the past with other apache-based authentication plugins... specifically the Shibboleth module... Apache passed it in a way that only made it possible for the rails app to be hosted with Passenger)
[17:45:06] ^mtkd: has joined #RubyOnRails
[17:46:33] mahloun: has joined #RubyOnRails
[17:55:02] segy: has joined #RubyOnRails
[17:59:43] sandstrom: has joined #RubyOnRails
[18:00:06] Technodrome: has joined #RubyOnRails
[18:01:27] mikecmpbll: has joined #RubyOnRails
[18:08:24] xall: has joined #RubyOnRails
[18:11:32] jane_booty_doe2: has joined #RubyOnRails
[18:12:46] lxsameer: has joined #RubyOnRails
[18:13:46] chouhoulis: has joined #RubyOnRails
[18:18:09] roshanavand: has joined #RubyOnRails
[18:23:16] mtkd: has joined #RubyOnRails
[18:23:17] donkey-hotei: has joined #RubyOnRails
[18:25:09] Technodrome: has joined #RubyOnRails
[18:28:42] fschuindt: has joined #RubyOnRails
[18:29:34] mrgordon: has joined #RubyOnRails
[18:29:53] normie1: has joined #RubyOnRails
[18:30:00] marr: has joined #RubyOnRails
[18:30:30] mrgordon: Super quick question (I hope). I'm trying to set up a route for deleting a record from a join table, something like /job_solutions?job_id=123&solution_id=456
[18:30:46] mrgordon: so I want a destroy on the collection
[18:30:47] mrgordon: resources :job_solutions, only: [:create] do collection do delete 'destroy', to: 'job_solutions#destroy' end end
[18:31:08] mrgordon: rails routes looks fine but I can't seem to get it to load properly in a test
[18:31:22] fryguy: what's the test look like
[18:31:39] mrgordon: let(:destroy_request) { delete(:destroy, params: params) }
[18:32:02] mrgordon: where params is just {job_id: 123, solution_id: 456}
[18:32:21] mikecmpbll: if i were you, i'd model the join, and then delete it like any other resource.
[18:32:23] mrgordon: I notice with this part delete 'destroy', to: 'job_solutions#destroy'
[18:32:28] lxsameer: has joined #RubyOnRails
[18:32:30] mrgordon: is I change destroy to "/" or something else
[18:32:37] mrgordon: that it doesn't affect my test, I still get 404
[18:32:45] gambl0re: has joined #RubyOnRails
[18:32:49] mikecmpbll: or, "delete the join" in an update via either the jobs controller or the solutions controller
[18:32:52] mrgordon: but if I remove the line entirely then I get a different error
[18:33:22] mrgordon: mike you think thats cleaner? Felt like it might start to overload the other controllers with functionality to create / delete the association
[18:33:29] mikecmpbll: you're kinda going off the beaten track doing it this way, and for no particular reason
[18:33:33] normie1: has joined #RubyOnRails
[18:33:58] mikecmpbll: updating the solutions for a job is just part of updating a job, is it not?
[18:34:34] mrgordon: I guess so? I mean it could be argued its also updating a solution
[18:34:50] mikecmpbll: that depends on your application logic, of which i've no idea
[18:35:21] mikecmpbll: but it's likely it's one of those, or if the association ought to be a first class citizen then make it so and model it
[18:35:22] mikecmpbll: and give it a controller.
[18:35:30] mrgordon: well thats what I've done
[18:35:35] mrgordon: I added a join table and a controller for it
[18:35:41] mrgordon: as Job exists in a different system
[18:35:49] mrgordon: so we don't have a Job model e.g.
[18:35:52] mikecmpbll: and a model?
[18:36:05] mikecmpbll: is there a primary key in the table?
[18:36:12] mrgordon: I have not added a model for the join but I was thinking about it
[18:36:23] mrgordon: yeah id, job_id, solution_id
[18:36:49] mikecmpbll: well, add a model and then just do everything resourceful like any other resource
[18:37:59] mrgordon: if I know a job and solution I want to delete, would I want to look up the job_solution_id first to delete it? this is how I got to trying to delete based on job_id and solution_id as it seemed odd to expose a new join ID
[18:38:22] mikecmpbll: no just design your UI to use the correct route.
[18:39:59] mrgordon: thanks for your ideas by the way
[18:40:00] fschuindt: has joined #RubyOnRails
[18:40:14] mrgordon: what do you mean by the correct route? lookup by job_solution_id?
[18:41:16] ascarter: has joined #RubyOnRails
[18:41:21] mikecmpbll: it's not really a question i can answer without knowing anything about the front-end
[18:41:35] mrgordon: this is a back end CRUD service basically
[18:41:41] mrgordon: so it will be orchestrated via API by another app
[18:41:53] Aherin: has joined #RubyOnRails
[18:42:11] mrgordon: not sure if that helps but
[18:42:15] mikecmpbll: okay then, i don't know anything about the "interface"
[18:42:25] mikecmpbll: what does someone get if they query all jobs?
[18:42:36] mikecmpbll: do they get job_solutions as a nested resource? in which case they have the ids ..
[18:43:24] mikecmpbll: but yeah, you see where i'm going, it's not really anything complicated, it's just another resource.
[18:43:44] mrgordon: it wouldn't be typical to query across all jobs. a more typical operation would be to get all solutions for a job. so you're saying maybe I should consider returning job solutions as part of that
[18:44:07] tercenya: has joined #RubyOnRails
[18:44:16] knight33: has joined #RubyOnRails
[18:53:24] segy: has joined #RubyOnRails
[19:06:39] SteenJobs: has joined #RubyOnRails
[19:07:41] mahloun: has joined #RubyOnRails
[19:14:46] Technodrome: has joined #RubyOnRails
[19:14:59] ur5us: has joined #RubyOnRails
[19:23:54] sneakers: has joined #RubyOnRails
[19:38:39] pupsicle: has joined #RubyOnRails
[19:42:38] d5sx43: has joined #RubyOnRails
[19:45:03] srinidhi: has joined #RubyOnRails
[19:48:18] mahloun: has joined #RubyOnRails
[19:54:39] brent__: has joined #RubyOnRails
[20:05:02] ascarter: has joined #RubyOnRails
[20:05:23] arBmind: has joined #RubyOnRails
[20:07:09] luckyrub_: has joined #RubyOnRails
[20:15:04] dionysus69: has joined #RubyOnRails
[20:18:19] luckyruby: has joined #RubyOnRails
[20:18:30] ascarter: has joined #RubyOnRails
[20:25:27] SteenJobs_: has joined #RubyOnRails
[20:28:15] mtkd: has joined #RubyOnRails
[20:29:17] luckyrub_: has joined #RubyOnRails
[20:31:48] gusrub: has joined #RubyOnRails
[20:34:09] arup_r: has joined #RubyOnRails
[20:35:16] xx00__: has joined #RubyOnRails
[20:45:32] xx00__: has joined #RubyOnRails
[20:45:57] mitt3ns: has joined #RubyOnRails
[20:48:25] pwnd_nsfw: has joined #RubyOnRails
[20:50:57] stee_3: has joined #RubyOnRails
[20:53:48] romeoh: has joined #RubyOnRails
[20:57:09] Lauer: has joined #RubyOnRails
[20:57:30] luckyruby: has joined #RubyOnRails
[20:57:33] Lauer: hey, have a problem with sending a hash over a post, https://pastebin.com/inpfr6jJ
[21:01:50] arup_r: what is the issue?
[21:03:27] Fernando-Basso: has joined #RubyOnRails
[21:04:00] Lauer: the two arrays is not the same
[21:04:15] Lauer: if I change the first one to use strings as the hash keys, it works
[21:05:43] luckyruby: has joined #RubyOnRails
[21:07:00] neruda: has joined #RubyOnRails
[21:07:43] arup_r: how are you posting it to Rails?
[21:11:26] normie1: has joined #RubyOnRails
[21:12:16] neruda: are there additional anti-csrf measures a rails app can employ other than the :prevent_forgery and session nonce? Like storing and checking IP address on each request etc?
[21:16:16] luckyruby: has joined #RubyOnRails
[21:24:18] cerulean: has joined #RubyOnRails
[21:24:32] cerulean: how do i permit extra parameters in devise/rails5 ?
[21:32:21] duderonomy: has joined #RubyOnRails
[21:51:02] luckyruby: has joined #RubyOnRails
[21:56:34] brent__: has joined #RubyOnRails
[21:57:18] mlt-: has joined #RubyOnRails
[22:01:21] workmad3_: has joined #RubyOnRails
[22:01:38] luckyruby: has joined #RubyOnRails
[22:06:42] brent__: has joined #RubyOnRails
[22:07:26] luckyrub_: has joined #RubyOnRails
[22:07:52] brent__: has joined #RubyOnRails
[22:13:26] luckyruby: has joined #RubyOnRails
[22:16:12] mikecmpbll: has joined #RubyOnRails
[22:18:59] barhum2013: has joined #RubyOnRails
[22:28:03] hive-mind: has joined #RubyOnRails
[22:30:00] luckyruby: has joined #RubyOnRails
[22:31:11] fourcolors: has joined #RubyOnRails
[22:33:24] Radar: GOOD MORNING
[22:35:19] luckyrub_: has joined #RubyOnRails
[22:35:33] wethu: has joined #RubyOnRails
[22:38:42] gusrub: has joined #RubyOnRails
[22:41:10] gusrub: has joined #RubyOnRails
[22:57:57] gusrub_: has joined #RubyOnRails
[23:19:22] ur5us: has joined #RubyOnRails
[23:22:58] gusrub: has joined #RubyOnRails
[23:24:42] tfitts: Anyone here use the google adwords api gem? I'm not able to install it because of a savon dependency conflict. The issue is here https://github.com/googleads/google-api-ads-ruby/issues/15 and the last comment says "The newest versions of ads_common and adwords_api no longer have a dependency on Savon" but when I try installing the gem I still get the conflict.
[23:31:29] Technodrome: has joined #RubyOnRails
[23:32:58] Fire-Dragon-DoL: tfitts: did you try changing the version in Gemfile and running `bundle update ads_common` ?
[23:33:33] tfitts: changing which version?
[23:34:00] wethu: has joined #RubyOnRails
[23:41:25] username: has joined #RubyOnRails
[23:48:33] fschuindt: has joined #RubyOnRails
[23:53:03] fschuindt1: has joined #RubyOnRails
[23:59:09] kanzure: has joined #RubyOnRails