« Back to channel list

#RubyOnRails - 03 August 2017

« Back 1 day Forward 1 day »
[00:01:00] RahulT: has joined #RubyOnRails
[00:01:04] jhfisc: has joined #RubyOnRails
[00:01:30] Radar: yes, yes you are
[00:12:27] Jameser: has joined #RubyOnRails
[00:13:11] jhfisc: has joined #RubyOnRails
[00:16:14] xco: has joined #RubyOnRails
[00:32:47] Jameser: has joined #RubyOnRails
[00:38:02] brent__: has joined #RubyOnRails
[00:44:44] HoierM: has joined #RubyOnRails
[00:45:23] jhfisc: has joined #RubyOnRails
[00:45:54] brent__: has joined #RubyOnRails
[00:48:18] brent__: has joined #RubyOnRails
[00:56:44] [spoiler]: has joined #RubyOnRails
[00:58:26] jhfisc: has joined #RubyOnRails
[01:11:41] jhfisc: has joined #RubyOnRails
[01:14:23] jhfisc: has joined #RubyOnRails
[01:16:02] bronson: has joined #RubyOnRails
[01:17:32] jhfisc: has joined #RubyOnRails
[01:23:08] RahulT: has joined #RubyOnRails
[01:28:29] duderonomy: has joined #RubyOnRails
[01:33:49] jhfisc: has joined #RubyOnRails
[01:37:14] Jameser: has joined #RubyOnRails
[01:39:44] rahult_: has joined #RubyOnRails
[01:40:19] jhfisc: has joined #RubyOnRails
[01:43:08] ornerymoose: has joined #RubyOnRails
[01:45:23] byteflame: has joined #RubyOnRails
[01:46:13] byteflame: has joined #RubyOnRails
[01:49:10] jhfisc: has joined #RubyOnRails
[01:49:27] irishfromua: has joined #RubyOnRails
[01:53:22] sagax: what different between method "update_attributes" in 4 and 5 version?
[01:53:34] sagax: i see api doc, but not see what different
[01:54:01] sagax: but in fact - update_attributes methods different in 4 and 5 version
[01:54:40] sagax: 5 http://api.rubyonrails.org/classes/ActiveRecord/Persistence.html#method-i-update_attribute
[01:54:59] sagax: 4 http://api.rubyonrails.org/v4.0.0/classes/ActiveRecord/Persistence.html#method-i-update_attributes
[01:55:06] muzik: has joined #RubyOnRails
[01:55:53] jhfisc: has joined #RubyOnRails
[02:00:00] duderonomy: has joined #RubyOnRails
[02:02:02] pvl1: has left #RubyOnRails: ("loud")
[02:02:11] Radar: One you've linked to is update_attribute (singular) and the other is update_attributes (plural)
[02:10:50] sevenseacat: has joined #RubyOnRails
[02:23:11] guacamole: has joined #RubyOnRails
[02:24:38] guacamole: has joined #RubyOnRails
[02:29:16] gusrub: has joined #RubyOnRails
[02:31:12] sagax: i have double commit when use update_attributes in Rails 4
[02:31:43] sagax: but all success and normal when i try update_attributes in Rails 5
[02:33:05] sagax: Radar: it's wrong, this true http://api.rubyonrails.org/classes/ActiveRecord/Persistence.html#method-i-update_attributes
[02:36:18] Radar: sagax: Can you reproduce the issue in a new app?
[02:36:25] baweaver: sagax: update_attributes is an alias for update
[02:36:53] sagax: baweaver: i know
[02:36:57] baweaver: Rails 4 - https://github.com/rails/rails/blob/9d112c2527ab50c519fdaf21a8d432b5ca18bc85/activerecord/lib/active_record/persistence.rb#L280
[02:37:04] baweaver: Rails 5 - https://github.com/rails/rails/blob/d26e3a0738eb768fe621c790140fae99f9b16645/activerecord/lib/active_record/persistence.rb#L225
[02:37:17] Radar: sagax: "wrong" is not helpful to us
[02:37:18] sagax: i diff persistence.rb to 4 and 5 version from active record
[02:37:21] Radar: Show us exactly what's happening in a gist.
[02:37:37] sagax: and not found big different
[02:37:55] Radar: Radar kicked sagax: behavior is not conducive to the desired environment.
[02:38:01] Radar: Is it that hard to follow simple instructions?
[02:38:03] Radar: ACTION might need some lunch
[02:40:15] RahulT: has joined #RubyOnRails
[02:40:25] sagax: has joined #RubyOnRails
[02:40:45] sagax: nested_attributes.rb between 4 and 5 version have more different
[02:41:06] sevenseacat: it is, apparently
[02:43:05] sagax: yes, but i think that find bug and i can't update rails to 5 version
[02:45:54] RahulT: has joined #RubyOnRails
[03:15:27] baweaver: sagax: define different
[03:16:02] chouhoulis: has joined #RubyOnRails
[03:16:08] baweaver: and also Radar had asked you to reproduce this behavior in a new application
[03:17:06] bronson: has joined #RubyOnRails
[03:33:29] ornerymoose: has joined #RubyOnRails
[03:44:36] hndk: has joined #RubyOnRails
[03:47:02] muzik: has joined #RubyOnRails
[03:51:44] weiyang: has joined #RubyOnRails
[03:55:55] brent__: has joined #RubyOnRails
[03:58:34] jhfisc: has joined #RubyOnRails
[04:02:33] umaaji: has joined #RubyOnRails
[04:02:52] segy_: has joined #RubyOnRails
[04:04:50] gusrub: has joined #RubyOnRails
[04:05:21] segy-: has joined #RubyOnRails
[04:06:21] RahulT: has joined #RubyOnRails
[04:07:30] segy: has joined #RubyOnRails
[04:09:18] jhfisc: has joined #RubyOnRails
[04:09:18] emers2n: has joined #RubyOnRails
[04:10:15] emers2n: Could someone explain what the multiplication/asterisk (*) means here: myCustomHash.inject(Hash[ *myCustomHash.first ]) do |tmp,kv|
[04:10:54] segy_: has joined #RubyOnRails
[04:13:44] segy: has joined #RubyOnRails
[04:14:44] jhfisc: has joined #RubyOnRails
[04:15:47] segy-: has joined #RubyOnRails
[04:17:36] segy_: has joined #RubyOnRails
[04:18:03] jhfisc: has joined #RubyOnRails
[04:19:45] segy: has joined #RubyOnRails
[04:22:44] ur5us: has joined #RubyOnRails
[04:23:43] segy_: has joined #RubyOnRails
[04:28:37] Radar: emers2n: it's the Ruby splat operator
[04:30:07] emers2n: Radar: So it's being used in this case to grab the first item without altering the hash?
[04:31:02] Radar: emers2n: it will splat the first item, so it's not hash[[1,2,3,4]], but hash[1,2,3,4]
[04:31:31] emers2n: Radar: Okay, thank you.
[04:32:08] Radar: Compare: Hash[[1,2,3,4]] and Hash[1,2,3,4]
[04:33:12] RahulT: has joined #RubyOnRails
[04:35:29] jhfisc: has joined #RubyOnRails
[04:39:04] emers2n: Yep, I see the difference. Thanks.
[04:45:50] jhfisc: has joined #RubyOnRails
[04:49:47] jhfisc: has joined #RubyOnRails
[04:53:54] emers2n: I have a piece of code which is very close to behaving how I want. Doodle here w/ comments : Any help would be appreciated
[04:53:56] emers2n: https://www.jdoodle.com/a/4Wn
[04:59:08] krmela: has joined #RubyOnRails
[05:00:59] emers2n: any idea Radar?
[05:02:49] krmela: good early morning i have question about ransack gem situation i have model Order which has generated controller and have own line resources: in routes so when i am use order.ransack(params[:q]) generated search form has url to resource index controller any idea why that happends
[05:04:07] krmela: or how pass search_form_for another url
[05:06:56] emers2n: krmela: I'll tell you if you can solve this: https://www.jdoodle.com/a/4Wn
[05:15:28] blitz: has joined #RubyOnRails
[05:17:23] jhfisc: has joined #RubyOnRails
[05:18:46] bronson: has joined #RubyOnRails
[05:23:30] HashNuke: has joined #RubyOnRails
[05:24:36] sunrunner20: has joined #RubyOnRails
[05:24:55] muzik: has joined #RubyOnRails
[05:25:51] moeabdol: has joined #RubyOnRails
[05:25:59] brent__: has joined #RubyOnRails
[05:28:52] krmela: emers2n: well i find my answer url:reports_index_path
[05:29:22] jhfisc: has joined #RubyOnRails
[05:39:43] srinidhi: has joined #RubyOnRails
[05:42:28] Winter_Foxo: has joined #RubyOnRails
[05:42:30] aperkins81: has joined #RubyOnRails
[05:44:16] planigan: has joined #RubyOnRails
[05:45:59] moeabdol: has joined #RubyOnRails
[05:46:17] tens0r: has joined #RubyOnRails
[05:47:42] jhfisc: has joined #RubyOnRails
[05:52:46] Winter_Foxo: has joined #RubyOnRails
[05:58:37] Winter_Foxo: has joined #RubyOnRails
[05:59:15] mtkd: has joined #RubyOnRails
[05:59:25] jhfisc: has joined #RubyOnRails
[06:05:15] jhfisc: has joined #RubyOnRails
[06:05:33] roshanavand: has joined #RubyOnRails
[06:06:26] wethu: has joined #RubyOnRails
[06:10:20] aperkins81: g'day, we're using Heroku in US, just wondering if anyone has any recommendations for low-latency server spaces available in Australia? For a postgresql database and some sort of api
[06:13:19] aperkins81: thinking of amazon ec2 for now, simply because i havent looked at other options
[06:14:09] matthewd: Yeah, that'd be my default. I don't think you're going to find a Heroku equivalent.
[06:14:24] aperkins81: this is just for pushing data too and accessing (search)
[06:14:47] aperkins81: did get excited for a little bit about Heroku Spaces but thats enterprise or something only
[06:14:55] aperkins81: cause they have a Sydney server
[06:15:48] nahtnam: has joined #RubyOnRails
[06:29:28] RahulT: has joined #RubyOnRails
[06:32:29] rahult_: has joined #RubyOnRails
[06:45:12] jhfisc: has joined #RubyOnRails
[06:50:01] conta: has joined #RubyOnRails
[06:50:21] jhfisc: has joined #RubyOnRails
[06:51:43] RahulT: has joined #RubyOnRails
[07:01:00] jhfisc: has joined #RubyOnRails
[07:01:02] aperkins81: amazon rds in AU it is :) https://aws.amazon.com/rds/pricing/ cheers, catch
[07:06:05] srinidhi: has joined #RubyOnRails
[07:06:39] moeabdol: has joined #RubyOnRails
[07:11:01] jhfisc: has joined #RubyOnRails
[07:16:03] jhfisc: has joined #RubyOnRails
[07:19:13] jhfisc: has joined #RubyOnRails
[07:19:45] bronson: has joined #RubyOnRails
[07:23:37] Trynemjoel: has joined #RubyOnRails
[07:24:11] tfitts: has joined #RubyOnRails
[07:27:17] jhfisc: has joined #RubyOnRails
[07:29:25] Winter_Foxo: has joined #RubyOnRails
[07:33:11] jhfisc: has joined #RubyOnRails
[07:36:35] jhfisc: has joined #RubyOnRails
[07:37:03] ur5us: has joined #RubyOnRails
[07:38:07] Trynemjoel: has joined #RubyOnRails
[07:39:18] uks: has joined #RubyOnRails
[07:41:39] jhfisc: has joined #RubyOnRails
[07:43:22] xco: has joined #RubyOnRails
[07:43:23] ur5us: has joined #RubyOnRails
[07:47:11] jhfisc: has joined #RubyOnRails
[07:48:19] arBmind: has joined #RubyOnRails
[07:56:02] mikecmpbll: has joined #RubyOnRails
[07:56:28] jhfisc: has joined #RubyOnRails
[07:57:15] workmad3: has joined #RubyOnRails
[08:01:49] marr: has joined #RubyOnRails
[08:02:49] DoubleMalt: has joined #RubyOnRails
[08:02:49] jhfisc: has joined #RubyOnRails
[08:07:55] one_zero: has joined #RubyOnRails
[08:14:18] dionysus69: has joined #RubyOnRails
[08:15:07] dionysus69: is everyone on vacation or what's going on? why is channel so quite ? :S
[08:15:08] duderonomy: has joined #RubyOnRails
[08:15:17] jhfisc: has joined #RubyOnRails
[08:16:33] dminuoso: Perhaps people are busy working?
[08:18:57] dionysus69: that used to be the case in the past too I assume, but activity was higher :)
[08:19:55] dminuoso: Maybe people are getting better so they don't have to ask that many stupid questions anymore?
[08:20:42] bronson: has joined #RubyOnRails
[08:20:44] jhfisc: has joined #RubyOnRails
[08:20:54] dminuoso: Let's be honest. If everybody read the guides and removed turbolinks and spring, and stopped using rvm/rbenv I promise this channel would lose the majority of chatter.
[08:22:47] dionysus69: and activity here was higher :D
[08:23:03] dionysus69: oh ups missclick
[08:23:21] dionysus69: didnt know rvm was in that bucket :P
[08:25:00] segy: has joined #RubyOnRails
[08:28:26] cabotto: has joined #RubyOnRails
[08:29:29] jhfisc: has joined #RubyOnRails
[08:37:36] jhfisc: has joined #RubyOnRails
[08:45:32] ianfleeton: has joined #RubyOnRails
[09:18:49] krmela: **interruption from silence on this chanell** hello there i have like say more theory question i have model food which has many orders i dont know how to make form and model where i am enter date and check choices for day like every food as checkbox so they can every day order just limited set of foods (yeah i am back from vacation )
[09:21:25] dionysus69: so you want people selecting food from a list of checkboxes and saving it?
[09:22:01] cabotto: has left #RubyOnRails: ()
[09:22:03] bronson: has joined #RubyOnRails
[09:22:43] cabotto: has joined #RubyOnRails
[09:23:12] krmela: it is restrictive day choices for admins and in publick part i let choose only from saved set
[09:23:15] dionysus69: gist how your models look + what attributes they have
[09:24:04] muzik: has joined #RubyOnRails
[09:25:53] krmela: https://gist.github.com/netmoleCBA/d158f68f46f27da96aeb64b8b342beb9
[09:27:37] jhfisc: has joined #RubyOnRails
[09:28:36] dionysus69: Food has_many :orders first of all not :order
[09:29:05] Winter_Foxo: has joined #RubyOnRails
[09:29:15] dionysus69: you dont even need accepts nested attributes for in this case
[09:29:23] arup_r: has joined #RubyOnRails
[09:29:29] dionysus69: you can just make a form for order and let users fill it out
[09:29:47] dionysus69: I dont get what part you are stuck on
[09:30:18] krmela: food model is all posible foods
[09:31:13] krmela: i need save like only few choosen foods in another relation so in order form i am draw only food which are in saved set
[09:31:50] arBmind: has joined #RubyOnRails
[09:33:35] krmela: dionysus69: let me remark for example now we have in foods 10 records but i wish some days show in order form only 2 choosen foods and not let clients order from all
[09:34:28] dionysus69: so you want (one order / per user) / per day
[09:35:08] krmela: only one order from user per day
[09:35:48] dionysus69: have a last_ordered timestamp attribute on user model, and dont allow them to open up a form unless Time.now - user.last_ordered >= 24 hours
[09:36:28] dionysus69: or Time.zone.now *
[09:38:48] krmela: for me is more important one thing how to save dave offer for example today is orderable 5 food tomorrow 10 and other days just 3 i dont know how to make relation where i can store these day offers as currently it shows on order form food.all which is wrong
[09:39:45] krmela: it is relation each one day can have many offers but i dont know which relation fits best
[09:40:22] jhfisc: has joined #RubyOnRails
[09:40:43] dionysus69: you wanna save order limits per day as one attribute or you want to have 10 days saved in advance?
[09:41:14] krmela: yes i want every day they choose from calendar another set of foods
[09:41:51] krmela: but key is i dont know how to make relation how to store it
[09:42:19] dionysus69: I didnt get that
[09:45:23] cabotto: has joined #RubyOnRails
[09:45:55] krmela: ok let me say it another way now i have in foods id 1-10 tomorrow is 4t and you can order only id 1 2 3 next monday you can order from id 6 7 8 9
[09:46:41] krmela: i am looking how to make new functionality which per day stores offers per day
[09:47:23] krmela: and then i am in order form i render only allowed ids from food
[09:47:26] adgtl: Folks.. just followed this post https://medium.com/rubyinside/action-cable-hello-world-with-rails-5-1-efc475b0208b
[09:47:43] adgtl: it says.. in dev mode.. you have can't send message from rails console to app
[09:47:51] adgtl: you have to install redis to do that
[09:47:58] adgtl: isn't that a hard limitation?
[09:49:56] Jameser: has joined #RubyOnRails
[09:50:41] tens0r: has joined #RubyOnRails
[09:52:24] jhfisc: has joined #RubyOnRails
[09:59:12] jhfisc: has joined #RubyOnRails
[10:01:51] arup_r: adgtl: redis is needed to run actioncable.
[10:06:21] mikecmpbll: has joined #RubyOnRails
[10:09:16] tbuehlmann_: adgtl: it doesn't have to be redis, but you need some kind of shared pub/sub, and the async/in-memory adapter doesn't work when having more than one webserver process or thread
[10:15:10] jhfisc: has joined #RubyOnRails
[10:16:30] mikecmpb_: has joined #RubyOnRails
[10:22:50] bronson: has joined #RubyOnRails
[10:23:55] jhfisc: has joined #RubyOnRails
[10:26:02] LyndsySimon: has joined #RubyOnRails
[10:35:08] jhfisc: has joined #RubyOnRails
[10:38:31] noob_on_rails: has joined #RubyOnRails
[10:39:05] noob_on_rails: if im integrating Ember.js in my rails app for all the front stuff
[10:39:11] noob_on_rails: with ember-cli-rails gem
[10:39:22] noob_on_rails: do i have to create my app with the --api ?
[10:39:43] noob_on_rails: right now , im 'rails s' and i see the ember welcome page
[10:39:57] noob_on_rails: but i don't know if namespaces and stuff is already routed
[10:44:38] lxkm: has joined #RubyOnRails
[10:48:09] adgtl: folks, adding $redis.subscribe in my controller action blocks my app https://gist.github.com/anildigital/afe3b302d68525d0b23113a907c119c6
[10:48:12] adgtl: it doesn't start
[10:48:32] tbuehlmann_: it's a blocking call, so it blocks
[10:56:27] noob_on_rails: tbuehlmann_: hey! any insights on the question i asked ? :S
[10:57:23] arup_r: has joined #RubyOnRails
[10:57:41] tbuehlmann_: noob_on_rails: my take on this is to not have ember and rails in one project but having two separate projects
[10:57:58] noob_on_rails: so make the rails app an api
[10:58:08] noob_on_rails: and then just ember s proxy to 3000?
[10:58:20] noob_on_rails: and set up the adapter to api/1
[10:58:51] tbuehlmann_: I don't know what you mean by proxy, but simply have two projects, running on different ports
[10:59:10] noob_on_rails: yea i've done that and works nicely , but ppl at work want the ember-cli-rails integrated thingy
[10:59:21] noob_on_rails: i agree that the separate approach feels much better
[10:59:32] Winter_Foxo: has joined #RubyOnRails
[11:00:10] cabotto: has joined #RubyOnRails
[11:00:37] noob_on_rails: a guy says "I think ember-cli-rails is a great solution: for the most part, it doesn't tightly couple Ember to Rails, and it allows for some pretty powerful stuff like preloading data that you can't really get keeping them completely separate."
[11:01:32] tbuehlmann_: I can't argue with your senior ¯\_(ツ)_/¯
[11:04:11] adgtl: So in my app, I have Health Channel.. created using ActionCable
[11:04:36] adgtl: now I want to update UI.. based on Redis Pub Sub.. basically I want to write to Redis db .. from third party service
[11:04:41] adgtl: and Rails should reflect that fine?
[11:04:48] adgtl: Is it possible to implement this?
[11:04:50] adgtl: thank you
[11:05:25] Winter_Foxo: has joined #RubyOnRails
[11:08:05] cabotto: has joined #RubyOnRails
[11:08:51] jhfisc: has joined #RubyOnRails
[11:09:14] noob_on_rails: i know tbuehlmann_ <3 thanks
[11:15:01] jhfisc: has joined #RubyOnRails
[11:16:46] DTZUZO: has joined #RubyOnRails
[11:17:24] chouhoulis: has joined #RubyOnRails
[11:21:06] jhfisc: has joined #RubyOnRails
[11:23:36] bronson: has joined #RubyOnRails
[11:26:31] wethu: has joined #RubyOnRails
[11:36:16] Ergo: has joined #RubyOnRails
[11:42:27] muzik: has joined #RubyOnRails
[11:42:29] elsurudo: has joined #RubyOnRails
[11:43:42] cabotto: has joined #RubyOnRails
[11:53:11] jhfisc: has joined #RubyOnRails
[11:54:16] cabotto: has joined #RubyOnRails
[11:56:16] jhfisc: has joined #RubyOnRails
[12:02:10] moeabdol: has joined #RubyOnRails
[12:08:52] jhfisc: has joined #RubyOnRails
[12:12:28] nickjj: has joined #RubyOnRails
[12:21:25] ianfleeton: has joined #RubyOnRails
[12:21:36] jhfisc: has joined #RubyOnRails
[12:24:19] bronson: has joined #RubyOnRails
[12:29:34] Winter_Foxo: has joined #RubyOnRails
[12:30:01] wethu: has joined #RubyOnRails
[12:31:03] HoierM: has joined #RubyOnRails
[12:31:28] jhfisc: has joined #RubyOnRails
[12:32:11] tens0r: has joined #RubyOnRails
[12:33:23] ur5us: has joined #RubyOnRails
[12:34:00] ornerymoose: has joined #RubyOnRails
[12:35:07] Winter_Foxo: has joined #RubyOnRails
[12:35:57] elsurudo: has joined #RubyOnRails
[12:37:51] ornerymoose_: has joined #RubyOnRails
[12:38:15] elsurudo: has joined #RubyOnRails
[12:40:58] Winter_Foxo: has joined #RubyOnRails
[12:42:54] ndr0s: has joined #RubyOnRails
[12:43:11] jhfisc: has joined #RubyOnRails
[12:46:49] Winter_Foxo: has joined #RubyOnRails
[12:49:12] jhfisc: has joined #RubyOnRails
[12:53:55] lessless: has joined #RubyOnRails
[12:54:16] tens0r: has joined #RubyOnRails
[12:59:34] Or1on: has joined #RubyOnRails
[13:01:38] jhfisc: has joined #RubyOnRails
[13:04:11] hobbanero: has joined #RubyOnRails
[13:14:48] andywww: has joined #RubyOnRails
[13:25:16] bronson: has joined #RubyOnRails
[13:29:23] apparition47: has joined #RubyOnRails
[13:29:31] Jameser: has joined #RubyOnRails
[13:29:34] cjohnson: I've got nested resources, so resource :overrides do \n resource :override_criterion ...
[13:29:52] cjohnson: I mostly get how that works, you can map a nested route to another controller ot handle the child records but still keep the parent id
[13:30:13] cjohnson: However I have one edge case page which is the page where you can see/edit all of the child criterion records for a given override
[13:30:29] andywww: I have a conditional before filter which I’d like to test on rspec and i’m really struggling working out how to do it. Could someone give me a bit of a nudge in the right direction please? https://gist.github.com/anonymous/69ab5fc1fcc30e92f3dac0d2b6007cd0
[13:30:30] cjohnson: Does it make sense to make an action on overrides_controller called edit_criterion?
[13:31:13] jhfisc: has joined #RubyOnRails
[13:37:22] matthewd: cjohnson: edit_criteria, no?
[13:37:58] cjohnson: It's to edit all of the the criterion at once
[13:38:02] andywww: has left #RubyOnRails: ()
[13:38:23] cjohnson: Oh I'm an idiot lol
[13:38:30] cjohnson: just blindly followed the convention people set up
[13:38:38] cjohnson: I thought a was singular and on was plural
[13:38:43] cjohnson: and that's how the models were defined
[13:38:49] cjohnson: Let me fix that
[13:39:04] spheric: has joined #RubyOnRails
[13:39:48] cjohnson: Either way does that seem reasonable? or should I be trying to basically take over the criteria index page to act more how I want this page to work?
[13:39:50] matthewd: So, I'd say yes that's a reasonable deviation from "pure REST"
[13:41:16] matthewd: I'd view it more as being a second edit screen for the override [which happens to contain a bunch of criterions ;) ] -- despite the list, it doesn't feel very indexy
[13:43:07] cjohnson: cool thanks for sanity checking for me
[13:46:14] high_fiver: has joined #RubyOnRails
[13:47:28] jhfisc: has joined #RubyOnRails
[13:54:09] jhfisc: has joined #RubyOnRails
[14:00:06] jhfisc: has joined #RubyOnRails
[14:00:36] banisterfiend: has joined #RubyOnRails
[14:02:57] jhfisc: has joined #RubyOnRails
[14:08:06] jhfisc: has joined #RubyOnRails
[14:10:49] ndr0s: has joined #RubyOnRails
[14:12:56] cjohnson: Ok I've got most of that working however the path/url helper I'm still not sure on
[14:13:11] mtkd: has joined #RubyOnRails
[14:13:15] cjohnson: So I've got that same nested resource, override_criteria nested inside overrides
[14:13:31] cjohnson: I created a new criteria and then I've got form_for [:admin, @criteria]
[14:13:41] cjohnson: It can't find the proper edit path because it's nested
[14:14:35] cjohnson: aha the route isn't using the inflector, the generated path is criterium
[14:15:11] jhfisc: has joined #RubyOnRails
[14:15:29] cjohnson: that's weird the definition of criterium is "a one-day bicycle race on a circuit road course" hahahaha
[14:17:07] cjohnson: I have an inflection defined for this so not sure why routes isn't obeying it
[14:17:10] cjohnson: everything else does
[14:20:11] jhfisc: has joined #RubyOnRails
[14:25:07] dangerousdave: has joined #RubyOnRails
[14:25:27] ResidentBiscuit: has joined #RubyOnRails
[14:27:18] dangerousdave: whats the term used to describe information that requires updating for every release, such as the year in copyright clauses or product documentation.
[14:28:24] matthewd: dangerousdave: Nothing particular comes to mind
[14:29:33] Winter_Foxo: has joined #RubyOnRails
[14:30:30] thortron: has joined #RubyOnRails
[14:31:07] jhfisc: has joined #RubyOnRails
[14:31:13] Derperperd: has joined #RubyOnRails
[14:31:33] TvL2386: has joined #RubyOnRails
[14:32:39] dangerousdave: I guess i am trying to say anything that ages a product
[14:33:40] TvL2386: hey guys, I'm trying to setup a basic belongs_to association, but I am making an error since rails says: `Association named 'users' was not found on Maintenance; perhaps you misspelled it?`
[14:34:02] TvL2386: my class is really simple: class Maintenance < ApplicationRecord; belongs_to :created_by, class_name: 'User'; end
[14:35:16] matthewd: TvL2386: Well that's definitely not creating an association named 'users'. So we probably need to see the code that's causing the error.
[14:37:14] jhfisc: has joined #RubyOnRails
[14:37:59] Winter_Foxo: has joined #RubyOnRails
[14:38:18] high_fiver: has joined #RubyOnRails
[14:38:55] banisterfiend: has joined #RubyOnRails
[14:39:47] TvL2386: matthewd: changed it a bit to reflect what the docs say: https://gist.github.com/TvL2386/f02f6ac7242c6d8f3eebc069120df2a2
[14:40:17] chouhoulis: has joined #RubyOnRails
[14:40:29] TvL2386: aaahhh... nm
[14:40:33] TvL2386: matthewd: never mind
[14:41:15] TvL2386: last time I worked on rails was v3.2
[14:43:17] jhfisc: has joined #RubyOnRails
[14:43:23] Winter_Foxo: has joined #RubyOnRails
[14:46:33] mcr-credil: has joined #RubyOnRails
[14:47:07] quirkycoders: has joined #RubyOnRails
[14:47:11] jhfisc: has joined #RubyOnRails
[14:48:37] mr-spoon: has joined #RubyOnRails
[14:48:47] Winter_Foxo: has joined #RubyOnRails
[14:49:37] quirkycoders: working on rails 4.1.5...what is the preferred way of specifying a foreign key to a namespaced table. I did the following but this does not work in 4.1.5, only in the newer version of rails.
[14:49:39] quirkycoders: https://gist.github.com/0077991e26b9b0b57ce9c7358101f785
[14:52:22] quirkycoders: add_foreign_key is not available in 4.1.5
[14:53:12] jhfisc: has joined #RubyOnRails
[14:53:21] defsdoor: has joined #RubyOnRails
[14:54:01] pwnd_nsfw: has joined #RubyOnRails
[14:57:20] guacamole: has joined #RubyOnRails
[14:59:29] jhfisc: has joined #RubyOnRails
[15:00:57] dangerousdave: has joined #RubyOnRails
[15:05:27] JDeen: has joined #RubyOnRails
[15:05:33] Ryzokuken: has joined #RubyOnRails
[15:05:41] ams__: has joined #RubyOnRails
[15:06:33] jhfisc: has joined #RubyOnRails
[15:07:57] JDeen: I am interested in adding a query builder interface to a webhook interface i am building. I am looking at http://querybuilder.js.org. Has any one integrated a query builder interfae to an app? How can I convert the parsed rules to a sql query?
[15:08:28] JDeen: or if there is some thing better, would appreciate your thoghts and ideas
[15:08:55] moei: has joined #RubyOnRails
[15:12:18] jhfisc: has joined #RubyOnRails
[15:12:45] guacamole: has joined #RubyOnRails
[15:14:45] maryo_: has joined #RubyOnRails
[15:15:06] [Butch]: has joined #RubyOnRails
[15:16:20] marr: has joined #RubyOnRails
[15:16:49] high_fiver: has joined #RubyOnRails
[15:17:43] jhfisc: has joined #RubyOnRails
[15:21:27] cam27: has joined #RubyOnRails
[15:24:18] ali_g: has joined #RubyOnRails
[15:26:04] bronson: has joined #RubyOnRails
[15:26:57] banisterfiend: has joined #RubyOnRails
[15:29:29] creaked: has joined #RubyOnRails
[15:33:29] ndr0s: has joined #RubyOnRails
[15:34:55] maryo: has joined #RubyOnRails
[15:40:04] brent__: has joined #RubyOnRails
[15:46:48] jhfisc: has joined #RubyOnRails
[15:52:30] cagomez: has joined #RubyOnRails
[15:57:02] jhfisc: has joined #RubyOnRails
[16:00:13] desiph3r: has joined #RubyOnRails
[16:00:29] srinidhi: has joined #RubyOnRails
[16:03:23] dionysus69: has joined #RubyOnRails
[16:05:43] nobitanobi: has joined #RubyOnRails
[16:07:36] nobitanobi: I have a question regarding csrf protection in Rails. If I had a before_filter before defining the protect_from_forgery, and in that before_filter I did something like, delete_post_from_user, the protect_from_forgery wouldn't protect me correct? Because it's not necessarily going to happen before that filter.
[16:07:54] nobitanobi: Does Rails ensures that the protect_from_forgery happens before any other filter?
[16:08:38] jhfisc: has joined #RubyOnRails
[16:09:40] cpruitt: has joined #RubyOnRails
[16:17:54] gusrub: has joined #RubyOnRails
[16:19:50] airdisa: has joined #RubyOnRails
[16:20:05] cagomez: has joined #RubyOnRails
[16:21:18] jhfisc: has joined #RubyOnRails
[16:21:22] cagomez_: has joined #RubyOnRails
[16:25:12] duderonomy: has joined #RubyOnRails
[16:33:15] jhfisc: has joined #RubyOnRails
[16:33:37] conta: has joined #RubyOnRails
[16:41:46] irishfromua: has joined #RubyOnRails
[16:46:17] Ryzokuken: How can I pass headers to xhr post request in rails?
[16:46:32] Ryzokuken: post :create_by_token, @params, @headers
[16:46:46] Ryzokuken: puts the variable as session, not headers.
[16:53:07] JDeen: I am interested in adding a query builder interface to a webhook interface i am building. I am looking at http://querybuilder.js.org. Has any one integrated a query builder interfae to an app? How can I convert the parsed rules to a sql query?
[16:54:27] baweaver: jdeen: https://github.com/SixiS/jquery_query_builder-rails
[16:54:38] baweaver: if you read further down you'll find there's a Rails adapter for it
[16:56:37] benlieb: has joined #RubyOnRails
[16:59:46] Ryzokuken: has joined #RubyOnRails
[17:00:38] cagomez: has joined #RubyOnRails
[17:01:43] one_zero: has joined #RubyOnRails
[17:01:55] cagomez: has joined #RubyOnRails
[17:06:02] cagomez_: has joined #RubyOnRails
[17:06:21] JDeen: baweaver: Thanks. I think you mean the Ruby Rule Evaluator? Nice. If I am to use it to lets say filter an AR resultset, I will evaluate an array of the results against with the rule provided by the UI.
[17:06:52] baweaver: So the pipeline appends SHA hashes to resources for cache purposes. Apparently some User Agents will still request the naive version (ex: favicon.ico) and litter 404s everywhere in logs. Trying to think of a good fix for this.
[17:07:49] baweaver: The stupid version is just giving it the last generated version to the plain name and ignoring cache, which I assume is tapping the pipeline to do a bit extra on compile
[17:08:29] kies: has joined #RubyOnRails
[17:09:17] matthewd: baweaver: Are they browsers you care about?
[17:09:34] baweaver: More of a ticket I got assigned which wasn't kind enough to specify.
[17:09:43] matthewd: baweaver: I used to have an explicit /favicon.ico in the nginx config that just forced it to 404 without logging
[17:10:07] baweaver: Was considering that or an apache one depending on what they use here
[17:11:03] matthewd: (my default config actually did that for both favicon and robots -- check for a local file, but never forward it to the backend)
[17:11:36] baweaver: I'll probably run that by them and see what UAs are screwing with it.
[17:12:45] Ryzokuken: needed help with headers
[17:13:07] matthewd: ryzokuken: Rails version?
[17:15:02] Ryzokuken: matthewd, ^
[17:17:56] matthewd: ryzokuken: Too old for me, sorry. Check the API docs ¯\_(ツ)_/¯
[17:19:43] Ryzokuken: matthewd, could you point me to the docs?
[17:19:48] Ryzokuken: I was unable to find them.
[17:22:07] matthewd: ryzokuken: Oh, you may be having an issue with http://api.rubyonrails.org/v3.2/classes/ActionController/TestCase/Behavior.html#method-i-post vs http://api.rubyonrails.org/v3.2/classes/ActionDispatch/Integration/RequestHelpers.html#method-i-post
[17:22:53] Ryzokuken: matthewd, exactly
[17:24:11] matthewd: So yeah, sounds like you can't set headers in a controller test
[17:25:34] Ryzokuken: there's no way to do that?
[17:25:49] ornerymoose: has joined #RubyOnRails
[17:27:01] matthewd: You're looking at the same documentation I am
[17:27:25] bronson: has joined #RubyOnRails
[17:28:03] cagomez: has joined #RubyOnRails
[17:28:48] cagomez: has joined #RubyOnRails
[17:30:16] Ryzokuken: matthewd, :/ shucks
[17:38:01] mikecmpbll: has joined #RubyOnRails
[17:56:08] cjohnson: matthewd: Back to my earlier example of nested resources, on the list-all-child-records page, I show a small edit form for each one
[17:56:40] cjohnson: which posts to the nested resource controller. but when I have errors I need to show the original page/form again if possible
[17:56:46] cjohnson: Normally I would do render :edit
[17:56:53] cjohnson: but in this case it's another controller. Any ideas?
[17:57:08] cjohnson: can I render from another controller?
[17:57:22] matthewd: `render :edit` is just rendering the view, not invoking anything in the controller
[17:57:38] matthewd: So yeah, you can just specify the full path to the view
[17:58:38] cjohnson: render '/admin/overrides/edit_criteria' ?
[17:59:04] matthewd: Sounds plausible
[18:00:51] ahrs: has joined #RubyOnRails
[18:01:56] duderonomy: has joined #RubyOnRails
[18:03:31] gusrub: has joined #RubyOnRails
[18:06:03] arBmind: has joined #RubyOnRails
[18:08:49] guacamole: has joined #RubyOnRails
[18:09:27] cjohnson: And my last question
[18:09:35] apeiros: are you dying?
[18:09:53] cjohnson: I'll miss you most of all apeiros
[18:10:45] cjohnson: I'm not sure how to get form_for to work nicely with my nested resources. So I've got namespace :admin do \n resources :overrides do \n resources :criteria, controller: :override_criteria
[18:11:27] cjohnson: So when I do form_for [:admin, @criteria], it is trying to find the wrong route and passing it the wrong params for the route
[18:11:32] cjohnson: No route matches {:action=>"show", :controller=>"admin/override_criteria", :id=>nil, :override_id=>#<OverrideCriterion id: 305, override_match_id: 295, value: "test", created_at: "2017-08-03 18:01:36", updated_at: "2017-08-03 18:01:36">} missing required keys: [:id]
[18:11:37] matthewd: [:admin, @override, @criteria]
[18:11:55] cjohnson: When I do that, it says no route for admin_override_override_criteria_path
[18:12:05] apeiros: for each level of resource, you need an actual resource
[18:12:29] matthewd: Oh, that'll be because the resource name doesn't match the controller name
[18:13:08] cjohnson: Ah. Can I tell it to map magically? I tried just conditionally generating the url by selecting the path by hand but then the methods don't map magically either and I don't want to go all the way down the path of building it all by hand if I can help it
[18:13:45] matthewd: cjohnson: `resources :override_criteria, path: 'criteria'` might do better?
[18:14:53] cjohnson: I think that's the ticket
[18:15:03] matthewd: You can also use http://edgeguides.rubyonrails.org/5_1_release_notes.html#direct-resolved-routes if you're on 5.1
[18:15:47] matthewd: `resolve("OverrideCriterion") { |oc| [:admin, oc.override, oc] }`, then form_for(@criterion), I think?
[18:16:03] cjohnson: beautiful that was exactly it, I needed to call the resource correctly and override its path, rather than call it incorrectly and point it at the right controller
[18:16:42] cjohnson: Now I can use the same form_for [:admin, override, criteria] for new and edit
[18:16:45] cjohnson: and it maps accordingly
[18:17:08] cjohnson: Also I ran into this lovely bug in the process: https://github.com/rails/rails/issues/12766
[18:18:18] cjohnson: awesome thank you both so much for all your help, feels much better to be able to just let it all map correctly
[18:20:36] srinidhi: has joined #RubyOnRails
[18:28:22] bronson: has joined #RubyOnRails
[18:29:21] conta1: has joined #RubyOnRails
[18:32:54] Chernobuk: has joined #RubyOnRails
[18:33:12] jhfisc: has joined #RubyOnRails
[18:39:28] jhfisc: has joined #RubyOnRails
[18:40:29] arup_r: has joined #RubyOnRails
[18:44:06] cabotto: has joined #RubyOnRails
[18:48:19] guacamole: has joined #RubyOnRails
[18:48:47] normie1: has joined #RubyOnRails
[18:55:25] cabotto: has joined #RubyOnRails
[19:00:06] Archrove-: has joined #RubyOnRails
[19:11:25] dionysus69: has joined #RubyOnRails
[19:18:30] gusrub: has joined #RubyOnRails
[19:18:44] guacamole: has joined #RubyOnRails
[19:21:46] AzaToth: has joined #RubyOnRails
[19:31:19] jhfisc: has joined #RubyOnRails
[19:36:57] normie1: has joined #RubyOnRails
[19:37:12] jhfisc: has joined #RubyOnRails
[19:38:16] mikecmpb_: has joined #RubyOnRails
[19:40:10] gusrub: has joined #RubyOnRails
[19:48:16] aclark: has joined #RubyOnRails
[19:50:26] arBmind: has joined #RubyOnRails
[19:57:52] gusrub: has joined #RubyOnRails
[19:59:49] arup_r: has joined #RubyOnRails
[20:04:45] gusrub: has joined #RubyOnRails
[20:08:39] cagomez: has joined #RubyOnRails
[20:10:01] arBmind: has joined #RubyOnRails
[20:11:13] guacamole: has joined #RubyOnRails
[20:13:04] gambl0re: has joined #RubyOnRails
[20:21:15] arBmind: has joined #RubyOnRails
[20:24:30] lxsameer: has joined #RubyOnRails
[20:29:11] bronson: has joined #RubyOnRails
[20:56:32] arBmind: has joined #RubyOnRails
[21:09:30] ahrs: has joined #RubyOnRails
[21:10:46] arBmind: has joined #RubyOnRails
[21:20:53] ornerymoose: has joined #RubyOnRails
[21:24:31] mjolnird: has joined #RubyOnRails
[21:26:42] cagomez: has joined #RubyOnRails
[21:30:01] arBmind: has joined #RubyOnRails
[21:30:02] SilentNinja1: has joined #RubyOnRails
[21:30:12] SilentNinja1: has left #RubyOnRails: ()
[21:31:11] jhfisc: has joined #RubyOnRails
[21:35:26] Or1on: has joined #RubyOnRails
[21:37:53] jhfisc: has joined #RubyOnRails
[21:38:00] brent__: has joined #RubyOnRails
[21:38:14] brent__: having issue w/ rspec that I can't seem to solve
[21:39:41] brent__: https://gist.github.com/brentluna/b48c262fee99d151a0c849225e6a9957 I can't seem to correclty stub out a method call on objects instances
[21:41:11] jhfisc: has joined #RubyOnRails
[21:41:33] benlieb: has joined #RubyOnRails
[21:42:11] benlieb: how should I make a currency-storing field for active record?
[21:42:27] benlieb: postgres has a money type, but looks like AR doesn't support it.
[21:42:47] pro777: benlieb: Use an integer.
[21:43:45] benlieb: Pro777: I've heard this many times, but in my case I will probably need fractional cents
[21:44:34] matthewd: benlieb: PG numeric / ruby bigdecimal
[21:44:59] benlieb: Pro777: would the int value represent cents, or "mili-cents"
[21:45:38] pro777: benlieb: At my US company, we store all currency as cents.
[21:46:22] jhfisc: has joined #RubyOnRails
[21:47:13] benlieb: Pro777: how would you handle a situation where my instructors are earning commissions on sales. It's theoretically possible (but hasn't happened yet) that the commission calculation results in a number less than a cent
[21:47:42] benlieb: So an instructor could earn 0.4 cents for a commission. They could also earn that commission 1000 times in a given month.
[21:47:57] benlieb: so if I round down they get 0
[21:48:07] pro777: benlieb: that I can't tell you from personal experience. I suppose you would store it as millecents then.
[21:48:26] pro777: The moment you start using floats for any currency calculations, the rounding errors will mess up the math sooner or later.
[21:50:02] pro777: http://0.30000000000000004.com/
[21:51:00] cagomez: has joined #RubyOnRails
[21:51:25] pro777: So in the case of puts 0.1 + 0.2, we get '0.30000000000000004'
[21:52:38] tanuki: has joined #RubyOnRails
[21:52:43] cagomez: has joined #RubyOnRails
[21:57:53] jhfisc: has joined #RubyOnRails
[21:58:32] aperkins81: has joined #RubyOnRails
[21:59:13] kt: has joined #RubyOnRails
[22:02:37] jhfisc: has joined #RubyOnRails
[22:04:45] ornerymoose: has joined #RubyOnRails
[22:09:11] jhfisc: has joined #RubyOnRails
[22:13:14] cagomez: has joined #RubyOnRails
[22:14:08] kt: has joined #RubyOnRails
[22:17:11] jhfisc: has joined #RubyOnRails
[22:28:34] quazimodo: has joined #RubyOnRails
[22:29:52] cagomez: has joined #RubyOnRails
[22:30:43] bronson: has joined #RubyOnRails
[22:31:18] fox_mulder_cp: has joined #RubyOnRails
[22:33:40] jhfisc: has joined #RubyOnRails
[22:39:45] jhfisc: has joined #RubyOnRails
[22:39:59] Axsuul: has joined #RubyOnRails
[22:40:39] cagomez: has joined #RubyOnRails
[22:41:52] kt: has joined #RubyOnRails
[22:42:03] RahulT: has joined #RubyOnRails
[22:44:00] gusrub: has joined #RubyOnRails
[22:44:02] quirkycoders: has joined #RubyOnRails
[22:44:30] jhfisc: has joined #RubyOnRails
[22:48:39] cagomez: has joined #RubyOnRails
[22:48:55] kt: has joined #RubyOnRails
[22:51:15] cagomez_: has joined #RubyOnRails
[22:55:23] ornerymoose: has joined #RubyOnRails
[22:57:37] Ropeney: has joined #RubyOnRails
[23:06:29] cagomez: has joined #RubyOnRails
[23:09:29] cagomez: has joined #RubyOnRails
[23:11:50] cagomez: has joined #RubyOnRails
[23:20:38] cagomez: has joined #RubyOnRails
[23:20:54] segy: has joined #RubyOnRails
[23:25:54] ur5us: has joined #RubyOnRails
[23:34:09] RahulT: has joined #RubyOnRails
[23:35:12] jhfisc: has joined #RubyOnRails
[23:36:19] Ropeney_: has joined #RubyOnRails
[23:38:02] cagomez: has joined #RubyOnRails
[23:41:11] jhfisc: has joined #RubyOnRails
[23:41:14] kt: has joined #RubyOnRails
[23:42:05] weiyang: has joined #RubyOnRails
[23:44:11] jhfisc: has joined #RubyOnRails
[23:46:49] weiyang: has joined #RubyOnRails
[23:47:16] weiyang: has left #RubyOnRails: ()
[23:50:20] Radar: Pro777: If you do the calculation using BigDecimal then you'd get the right figures.
[23:50:34] Radar: as matthewd already suggested by the looks of things.
[23:51:25] quazimodo: has joined #RubyOnRails
[23:52:15] gambl0re: has joined #RubyOnRails