« Back to channel list

#RubyOnRails - 09 January 2018

« Back 1 day Forward 1 day »
[00:02:02] jobewan: has joined #RubyOnRails
[00:02:43] _ritchie_: has joined #RubyOnRails
[00:07:17] Intii: Thanks Radar! Would managing the create/new actions work the same way?
[00:11:01] l_tonz: has joined #RubyOnRails
[00:13:03] Radar: Intii: !try
[00:13:03] helpa: Intii: Why don't you try it and find out for yourself?
[00:13:47] Intii: Will do! Thanks a lot for your help, gave me a push in the right direction
[00:18:56] davic: has joined #RubyOnRails
[00:21:52] bronson: has joined #RubyOnRails
[00:23:15] dblessing: has joined #RubyOnRails
[00:31:18] jrp93: has joined #RubyOnRails
[00:35:59] Intii: Radar, what's supposed to go into the set_scope method?
[00:36:16] Radar: Oh that's leftover. Remove the before_action for that.
[00:37:17] Intii: Yeah that's what I figured, just wanted to make sure
[00:41:01] alfiemax: has joined #RubyOnRails
[00:41:23] l_tonz: has joined #RubyOnRails
[00:51:20] Kugz: has joined #RubyOnRails
[00:54:58] Kugz: Hi everyone! Sorry if this is the wrong place to ask for help, but I'm new to Rails and my Google-fu couldn't provide me any help. I'm attempting to take data from an API in JSON format and want to import it into my postgres database, would anyone have any links to resources that would help me better understand how to do that?
[00:57:10] bronson: has joined #RubyOnRails
[00:59:23] Intii: Kugz: Do you have your postgres db set up with the correct tables/columns?
[01:02:46] Kugz: Hi Intii! I haven't yet, but I have designed my database scheme/model on paper, should I create that first before trying to import it?
[01:03:28] Kugz: I've seen a few ways to take JSON data and convert it to classes on websites for programming languages like C#, I wanted to double check there wasn't anything like that before I go ahead and create my own :)
[01:04:28] Intii: Well something like that for C# is used for parsing the JSON into usable objects in C#. I believe what your asking for is actually taking the JSON and saving it into a relational db system. Right?
[01:06:35] Intii: I would first create your models/migrations in Rails. This is similar to the C# thing you are talking about. These model files allow you to talk to the data that is stored in the postgres db.
[01:08:46] Kugz: All right sweet, I'll do that first. I've found on StackOverflow a way to parse that JSON data into a hash in rails, would I then take that hash and save it to the database? That the general gist of it?
[01:09:09] Intii: Nailed it.
[01:09:53] l_tonz: has joined #RubyOnRails
[01:10:33] Intii: If the data your importing and the columns match, you don't even need to match manually. You can do something like Model.new(parsed_json_string)
[01:10:44] Kugz: Thanks for the guidance! I mainly do front-end (html/css/js) and this is my first programming language I wanted to have a crack at and there's a few things that confuse me but I'll figure it out
[01:11:06] Intii: If the columns and data don't match, you'd then have to do Model.new, then do Model.attribute = parsed_json_string["attribute_to_find"]
[01:11:38] Kugz: Yeah the JSON data won't match but I figured I would have to select it bit-by-bit
[01:12:00] Intii: No problem! Rails is awesome once you get the hang of it. It really wants you to do things in it's way and I honestly believe that that's why this framework excels
[01:12:32] Kugz: Yeah I watched a course on Lynda and I am having a lot of 'Eureka' moments, it's fun to learn again!
[01:13:13] Kugz: Would you happen to know how to access a nested attribute in JSON? The data I've got is multi-leveled and I've only been able to get to the first part
[01:13:48] Intii: You should be able to do parsed_json_string[layer1][layer2][etc..]
[01:14:24] Kugz: Okay awesome, I was trying to do parsed_json_string[ layer 1 [layer 2] ] and that wasn't working
[01:15:52] Intii: The hash class works a lot like accessing stuff in arrays in JS. With jQuery $.get or whatever you can do data["object"]["name"]. Same concept in Rails with Hash
[01:19:26] Kugz: So if I have JSON with "character: { spells: { spell1: { name: spellname } } }, to access spell1, it would be parsed_json_string[character][spells][spell1][spellname]? Sorry if I can't explain that better in one line
[01:21:04] Intii: Yeah I assume you mean "name" for the last one
[01:21:11] Kugz: yeah sorry I did
[01:21:15] Intii: Just remember put the text inside the [] in quotes
[01:21:21] Intii: or ruby will complain
[01:21:46] Kugz: Awesome! You've been so incredibly helpful!
[01:23:57] workmad3: has joined #RubyOnRails
[01:25:47] Intii: Radar, can I pick your brain once more? I'm struggling with the create actions here. In my form, the POST URL is /users. Should it be /conferences/:id/users? How would I handle this in the view? Users also need to be created through /schools...
[01:26:03] Intii: Do I have the "new" method display a different form depending on the scope?
[01:29:04] zwliew: has joined #RubyOnRails
[01:30:49] bronson: has joined #RubyOnRails
[01:41:14] guardianx: has joined #RubyOnRails
[01:43:01] Radar: Intii: You can do [@conference, @user] where @conference _might_ be set and @user is _definitely_ set. form_for or form_with will work out what you mean.
[01:43:34] Intii: Now the problem lies when @conference is @school
[01:43:44] Intii: school and conference both has_many :users
[01:44:40] Intii: Should I just use @scope and have @scope be either set to a school or conference?
[01:56:56] l_tonz: has joined #RubyOnRails
[02:06:26] l_tonz: has joined #RubyOnRails
[02:10:08] SteenJobs: has joined #RubyOnRails
[02:13:02] _ritchie_: has joined #RubyOnRails
[02:19:24] Jameser: has joined #RubyOnRails
[02:30:10] srruby: has joined #RubyOnRails
[02:37:14] ecook: has joined #RubyOnRails
[03:11:09] conta: has joined #RubyOnRails
[03:12:14] ricardotk002: has joined #RubyOnRails
[03:18:26] l_tonz: has joined #RubyOnRails
[03:19:32] MrCrackPotBuilde: has joined #RubyOnRails
[03:24:37] workmad3: has joined #RubyOnRails
[03:29:27] alfiemax: has joined #RubyOnRails
[03:30:47] l_tonz: has joined #RubyOnRails
[03:45:27] bronson: has joined #RubyOnRails
[03:49:41] conta: has joined #RubyOnRails
[03:54:07] garyserj: I made a controller and I can go to But what i'd like to do is what i've heard is possible which is where going to runs the index action. How can I do that?
[03:54:44] CeramicTitan: has joined #RubyOnRails
[03:55:28] CeramicTitan: So I am currently uploading images with paperclip and my create method looks like this: https://gist.github.com/CeramicTitan/f71956c55623fafe748d5357904526fd
[03:56:18] CeramicTitan: but the thing is, Im pretty sure images are being uploaded asynchronously?which means the projects ids aren't aligning and the images are being assigned to the next project
[03:57:26] CeramicTitan: Also i'm pretty new to rails so please go easy on me :)
[03:57:30] s2013: has joined #RubyOnRails
[03:58:30] garyserj: CeramicTitan: i'm even newer than you. There are very long periods of no activity in the channel.
[03:59:09] CeramicTitan: That's unfortunate, ive been stuck on this for quite a while lol
[04:21:13] jobewan: has joined #RubyOnRails
[04:24:07] conta: has joined #RubyOnRails
[04:32:28] baweaver: It's also right after holidays which means most of us are just getting back to jobs.
[04:33:35] baweaver: CeramicTitan: do you have proof that this happens?
[04:34:56] baweaver: garyserj: http://guides.rubyonrails.org/routing.html#dynamic-segments
[04:37:07] baweaver: CeramicTitan: because each visit / hit to that method creates a new instance of the controller which calls that method which sets a project instance variable which you create images from
[04:37:45] quazimodo: has joined #RubyOnRails
[04:44:58] alfiemax: has joined #RubyOnRails
[04:45:40] bronson: has joined #RubyOnRails
[04:49:36] quazimodo: has joined #RubyOnRails
[04:49:59] ahrs: has joined #RubyOnRails
[04:56:01] CeramicTitan: baweaver: Is there anyway to run everything at the same time?
[04:56:11] CeramicTitan: or just stop is from calling over again?
[05:07:23] CeramicTitan: baweaver: hmm my images are sent through javascript, which i think might be causing issues, but im pretty sure Im sending all the parameters at the same time
[05:09:32] CeramicTitan: https://gist.github.com/CeramicTitan/2c0ff0e6da9321d108e9a85aa7ae2d78
[05:12:29] j0llyr0tten: hey, you know the way there's a <%= yield %> in application.html.erb – would it be possible to have two yields?
[05:13:42] j0llyr0tten: i'm trying to figure out how to create a dual-paned app, each pane having a view onto a different model …
[05:17:19] iamarun: has joined #RubyOnRails
[05:32:17] conta: has joined #RubyOnRails
[05:47:59] ur5us: has joined #RubyOnRails
[05:50:59] orbyt_: has joined #RubyOnRails
[05:51:46] srinidhi: has joined #RubyOnRails
[05:57:00] fugee: has joined #RubyOnRails
[05:57:32] kapil___: has joined #RubyOnRails
[06:01:07] baweaver: J0llyr0tten: why not just use partials?
[06:01:31] baweaver: a page doesn't necessarily _have_ to be 1-to-1 with a model
[06:04:55] fugee: what must i do to allow users to create their own blogs? i wanted to do a multiblog site but i'm not sure if there's any such thing; tumblr does it by being a social networking site in addition to a blogging platform
[06:04:59] iamarun: has joined #RubyOnRails
[06:05:57] conta: has joined #RubyOnRails
[06:06:56] baweaver: mices: that'd be something you need to figure out yourself.
[06:07:19] baweaver: If you don't know where to start on building something like that, chances are it's a really bad idea to attempt for now
[06:07:55] KeyJoo: has joined #RubyOnRails
[06:15:11] alfiemax: has joined #RubyOnRails
[06:20:12] alfiemax_: has joined #RubyOnRails
[06:40:05] conta: has joined #RubyOnRails
[06:41:52] dionysus69: has joined #RubyOnRails
[06:46:37] bronson: has joined #RubyOnRails
[06:58:11] morfin60: has joined #RubyOnRails
[07:00:24] quazimodo: has joined #RubyOnRails
[07:03:24] apeiros: has joined #RubyOnRails
[07:08:54] ephemer0l: has joined #RubyOnRails
[07:13:55] l_tonz: has joined #RubyOnRails
[07:17:01] conta: has joined #RubyOnRails
[07:18:49] aiguuu: has joined #RubyOnRails
[07:20:56] s2013: has joined #RubyOnRails
[07:25:18] conta: has joined #RubyOnRails
[07:26:07] workmad3: has joined #RubyOnRails
[07:42:19] l_tonz: has joined #RubyOnRails
[07:50:46] quazimodo: has joined #RubyOnRails
[07:51:47] eean: has joined #RubyOnRails
[07:54:13] aiguuu: has joined #RubyOnRails
[08:05:14] morfin60: i know AR models aren't pretty SRP(because they perform validations, persistance etc) but still - should not i move some business logics out of there?
[08:06:49] apeiros: has joined #RubyOnRails
[08:08:27] tbuehlmann: morfin60: that's up to you. some people use service objects, some move callbacks out, really no hard rule there
[08:10:19] jrp93: has joined #RubyOnRails
[08:12:03] morfin60: well, i know just thinked about "services"
[08:15:39] jnollette: has joined #RubyOnRails
[08:18:20] prometheus_falli: has joined #RubyOnRails
[08:21:39] quazimodo: has joined #RubyOnRails
[08:23:52] Radar: does anyone else mentally substitute the word "junk drawer" when someone says "services"?
[08:24:42] Radar: Surely you can think of a better name than generic "services"
[08:28:02] morfin60: i have 2 member variables in controller(arrays), how do i render both of them in JBuilder template?
[08:28:12] TinkerTyper: has joined #RubyOnRails
[08:28:36] morfin60: i want to have something like {slider_elements: [...], additional_blocks: [...]}
[08:30:10] dionysus69: has joined #RubyOnRails
[08:32:31] defsdoor: has joined #RubyOnRails
[08:39:55] jottr: has joined #RubyOnRails
[08:42:25] alfiemax: has joined #RubyOnRails
[08:47:44] bronson: has joined #RubyOnRails
[08:49:50] aiguuu: has joined #RubyOnRails
[09:00:23] halogenandtoast: has joined #RubyOnRails
[09:00:34] halogenandtoast: Is webpack required for asset_host to work correctly?
[09:01:16] halogenandtoast: I just tried two deployments with and without it. When I didn't have webpack, I got "foo.jpg is not present in the asset pipeline"
[09:09:08] conta: has joined #RubyOnRails
[09:15:51] halogenandtoast: unrelated it seems
[09:24:02] ephemer0l_: has joined #RubyOnRails
[09:32:32] marr: has joined #RubyOnRails
[09:38:46] agent_white: has joined #RubyOnRails
[09:41:17] noob_on_rails: has joined #RubyOnRails
[09:41:23] noob_on_rails: hey all , i get this : ArgumentError: Index name 'index_widget_blueprints_on_blueprintable_type_and_blueprintable_id' on table 'widget_blueprints' is too long; the limit is 64 characters
[09:41:47] mikecmpbll: has joined #RubyOnRails
[09:41:48] noob_on_rails: i mean it _is_ long , but what can i do :D , can i override it somehow ?
[09:51:06] aiguuu: Looks like the limit is fairly fixed from what I can tell
[09:51:45] aiguuu: Rename the polymorphic columns to something like bp_type and bp_id ?
[09:53:22] noob_on_rails: aiguuu: yea i should do that but strangely enough
[09:53:36] noob_on_rails: rails stopped the migration
[09:53:47] noob_on_rails: but the columns are in the db
[09:53:51] noob_on_rails: except the long index name
[09:54:00] noob_on_rails: and now i get duplicate columns
[09:54:18] srinidhi: has joined #RubyOnRails
[09:54:21] noob_on_rails: and if i rake db:rollback , i rollback the previous successfull migration
[09:54:53] noob_on_rails: hmm i should remove the columns rename and try again ok
[09:56:42] aiguuu: If you can drop the db, drop the whole thing and rebuild it
[09:56:45] aiguuu: rails db:drop
[09:57:15] noob_on_rails: that's not a bad idea
[09:57:32] noob_on_rails: if i only delete my reference columns you think it's worse right?
[09:57:48] aiguuu: No telling what else may be messed up
[09:58:00] aiguuu: Seems safer to nuke it, fix the migration(s) and rebuild it
[09:59:15] peterhil: has joined #RubyOnRails
[10:01:19] noob_on_rails: https://gist.github.com/frcake/06a57e84ec8fc379c287f0b7f6c90070
[10:01:28] noob_on_rails: that wont cut it either , which is still weird :(
[10:01:40] noob_on_rails: Index name 'index_widget_blueprints_on_blueprintable_type_and_blueprintable_id' on table 'widget_blueprints' is too long;
[10:03:20] noob_on_rails: updated gist with DB log and error
[10:05:29] mikecmpbll: has joined #RubyOnRails
[10:07:01] noob_on_rails: it's ignoring me :D
[10:08:49] noob_on_rails: hmm i think it should be add_index rather than add_reference at this point
[10:10:37] Cavallari: has joined #RubyOnRails
[10:12:29] jrp93: has joined #RubyOnRails
[10:17:40] noob_on_rails: ok updated the gist with the migration that fixed it
[10:31:10] _ritchie_: has joined #RubyOnRails
[10:36:03] marahin: Why does AR's calculation method .sum not allow me to pass more than 2 arguments?
[10:36:07] marahin: How can I work around this?
[10:36:22] marahin: contracts.sum(:one, :two, :three) raises; .sum(:one, :two) works just fine
[10:36:35] marahin: and the raise error is ArgumentError: wrong number of arguments (given 4, expected 2..3)
[10:40:17] marahin: aeh, nevermind
[10:40:19] marahin: it doesn't work fine
[10:47:15] ur5us: has joined #RubyOnRails
[10:48:36] bronson: has joined #RubyOnRails
[10:53:29] dminuoso: Radar: Hah.
[10:53:43] dminuoso: Radar: I had such a similar thought when I realized what the "factory pattern" was _really_ about.
[10:54:38] conta: has joined #RubyOnRails
[10:54:54] dminuoso: It's currying shoehorned into OOP.
[10:54:59] iamarun: has joined #RubyOnRails
[10:55:54] dminuoso: Including the related desire to treat constructors (functions!) as first class objects..
[10:56:06] dminuoso: But really it's just currying.
[10:57:51] workmad3: has joined #RubyOnRails
[11:09:23] argoneus: has joined #RubyOnRails
[11:10:15] mikecmpbll: has joined #RubyOnRails
[11:14:46] srinidhi: has joined #RubyOnRails
[11:20:30] srinidhi: has joined #RubyOnRails
[11:37:29] jackhum: has joined #RubyOnRails
[11:38:12] jackhum: has joined #RubyOnRails
[11:39:12] morfin60: where do i put nested in model classes("submodels") to let Rails autoload them?
[11:39:42] morfin60: as example Product::Translation
[11:41:10] tbuehlmann: morfin60: why's that not just ::Translation?
[11:42:24] morfin60: there is several Translation models for each translated model(Product, News, AdditionalBlock etc)
[11:45:09] l_tonz: has joined #RubyOnRails
[11:47:02] tbuehlmann: okay. then app/models/product/translation.rb should do
[11:50:59] morfin60: this is suspicious
[11:51:20] wethu: has joined #RubyOnRails
[11:51:32] morfin60: this classes do not get autoloaded for some reason(i use Globalize)
[11:53:44] tbuehlmann: do you have to define these classes yourself? doesn't globalize do that?
[11:54:27] morfin60: it does but i want have crappy rails_admin stuff in models instead of initializer
[11:55:13] Ergo: has joined #RubyOnRails
[11:56:56] morfin60: or it overwrite class i created?
[11:59:39] tbuehlmann: does globalize create a model class per translated model?
[12:00:24] morfin60: i tried translated_class.rails_admin do ... end and broke whole thing)
[12:00:42] quazimodo: has joined #RubyOnRails
[12:11:44] morfin60: seems like i should explicitly include models created
[12:11:52] morfin60: *created by globalize
[12:20:01] drale2k_: has joined #RubyOnRails
[12:20:38] drale2k_: With STI and a REST API endpoint, would you have a resource for the base class or the extended class?
[12:21:17] drale2k_: f.e. would you have an endpoint at /sports (base class) or for /basketball (inherits from sports) if what you are sending is basketball ?
[12:21:52] drale2k_: oi am thinking if i should send everything to /sports and then differentiate in the controller by the "type" attribute sent also with the form
[12:22:20] drale2k_: now that i have written it down, sending everything to the base class seems stupid
[12:32:21] someuser: has joined #RubyOnRails
[12:36:50] noob_on_rails: has joined #RubyOnRails
[12:36:58] noob_on_rails: if i have this https://gist.github.com/frcake/4443ac2ea57168f6112a1aa5a2bf0390#file-ticketingdashboard-rb-L6-L22 model
[12:37:23] j0llyr0tten: baweaver: "a page doesn't necessarily _have_ to be 1-to-1 with a model" gotcha, but how would you construct a URL for a page which is doing both model_a#show and model_b#edit ?
[12:37:38] noob_on_rails: and i want the functionality in the highlighted lines to be shared with other models too , but in the fashion that i don't have to state the model name
[12:37:42] noob_on_rails: how can i do it ?
[12:39:47] j0llyr0tten: are all the other models sort of like TicketingDashboard? Are they other Dashboards?
[12:40:07] noob_on_rails: yes they are the same , this is why i don't want to explicitly refer to the name
[12:40:11] j0llyr0tten: or are they totally other things entirely?
[12:40:39] noob_on_rails: TicketingDashboard , AlarmingDashboard etc
[12:40:51] j0llyr0tten: do you have a Dashboard superclass?
[12:40:52] Terens: has joined #RubyOnRails
[12:40:54] morfin60: does rails autoload namespaced models?
[12:41:16] noob_on_rails: J0llyr0tten: umm no
[12:41:46] Terens: Which is a good way to implement reliable messaging between a server and 1000s clients while having an always open socket?
[12:41:50] Terens: I want 1 to 1
[12:41:56] Terens: not broadcast etc
[12:41:56] j0llyr0tten: noob_on_rails: maybe create one and put the shared code there?
[12:42:07] noob_on_rails: hmmm yea that's cool , thanks J0llyr0tten
[12:42:33] Terens: I tried actioncable and mqqtt but there are things that seem impossible to do while using them
[12:42:42] j0llyr0tten: J0llyr0tten: you're welcome, someone had the same question the other day, maybe an example should go in the docs!
[12:43:21] l_tonz: has joined #RubyOnRails
[12:43:58] rmerry_: has joined #RubyOnRails
[12:44:55] j0llyr0tten: noob_on_rails: obviously Dashboard inherits from ApplicationRecord or whatever it is called and each type of dashboard inherits from Dashboard (not ApplicationRecord) … tell me if it works btw …
[12:45:22] noob_on_rails: well it wont be Dashboard , cause it's another model (with another functionality)
[12:45:47] noob_on_rails: J0llyr0tten: could this be a concern? or many concerns?
[12:45:52] noob_on_rails: im not very familiar with the concept yet
[12:45:53] DTZUZO: has joined #RubyOnRails
[12:46:11] rmerry_: hey guys, I'm having issues trying to set up a redirect route: the redirection happens but it comes though with no query string parameters even though I am specifying them in the uri: https://pastebin.com/XYGSDbea
[12:46:38] alfiemax: has joined #RubyOnRails
[12:47:53] fschuindt: has joined #RubyOnRails
[12:49:18] rmerry_: rails version 5.0.0 btw
[12:49:32] bronson: has joined #RubyOnRails
[12:55:23] morfin60: autoloading happens ONLY if such class does not exist yet?
[12:55:56] morfin60: so as example if globalize created class Product::Translation it won't get autoloaded from app/models/product/translation.rb?
[12:56:16] arBmind: has joined #RubyOnRails
[13:02:09] mikecmpbll: has joined #RubyOnRails
[13:07:05] morfin60: well, i found out what happens
[13:19:18] l_tonz: has joined #RubyOnRails
[13:19:53] j0llyr0tten: morfin60: no idea, tell us
[13:19:56] FastJack: has joined #RubyOnRails
[13:20:10] noob_on_rails: J0llyr0tten: works great :D thanks for the idea and help
[13:21:19] quazimodo: for a model that inherits from another model for STI purposes, when we want to test what kind of model it is we'd just use #kind_of? wouldn't we
[13:21:47] quazimodo: like, RefQuestion < Question, then question = RefQuestion.new; question.kind_of? RefQuestion would be the correct approach eh?
[13:22:06] quazimodo: I cant remember if activerecord/model add any convenience methods to test the 'type' of a model
[13:22:08] j0llyr0tten: noob_on_rails: i think Concerns are more general, cutting down on Module (not Model) boilerplate … great!
[13:22:48] noob_on_rails: i should look into them more i think
[13:22:58] j0llyr0tten: quazimodo: #model_name ?
[13:24:04] quazimodo: J0llyr0tten: hrm yeah that's interesting
[13:24:15] quazimodo: i think it's probably fine to just test the 'kind_of?'
[13:25:14] mikecmpbll: has joined #RubyOnRails
[13:26:17] j0llyr0tten: quazimodo: i'm not sure? all i know is that a method in the base class returns the correct inherited model name via #model_name . where is #kind_of? defined?
[13:28:59] waseem_: has joined #RubyOnRails
[13:30:08] l_tonz: has joined #RubyOnRails
[13:30:20] quazimodo: J0llyr0tten: that's just regular ruby
[13:30:46] quazimodo: takes into account class inheritance
[13:48:02] jottr: has joined #RubyOnRails
[13:54:29] dminuoso: How do you folks reconcile the router with nav builders?
[13:54:43] dminuoso: In particular I want something that seamlessly integrates like react-router
[13:58:34] _aeris_: has joined #RubyOnRails
[14:03:49] conta: hey folks, any chance to find upgrade guide for beta of 5.2?
[14:03:57] conta: I'd like to upgrade
[14:09:38] apeiros__: has joined #RubyOnRails
[14:25:05] l_tonz: has joined #RubyOnRails
[14:25:09] drale2k_: has joined #RubyOnRails
[14:27:29] dviola: has joined #RubyOnRails
[14:29:08] conta: has joined #RubyOnRails
[14:31:12] l_tonz: has joined #RubyOnRails
[14:33:48] Zadrel: has joined #RubyOnRails
[14:33:53] conta: has joined #RubyOnRails
[14:34:45] safetypin: has joined #RubyOnRails
[14:34:58] Zadrel: Hello, i want to build an e-commerce site, can anyone tell me wich is the best version of Rails, Ruby and where i can find a list of gems to do it?
[14:35:39] fryguy: Zadrel: latest stable, latest stable, and rubygems.org
[14:36:24] Zadrel: fryguy: thx
[14:41:19] dblessing: has joined #RubyOnRails
[14:43:20] KeyJoo: has joined #RubyOnRails
[14:50:43] arBmind: has joined #RubyOnRails
[14:51:06] bronson: has joined #RubyOnRails
[14:52:05] hanikazm: has joined #RubyOnRails
[14:56:55] hanikazm: I'm having a fun issue with ActiveRecord, any advice appreciated. I've got a table/model with a custom primary key 'pk', and standard 'id' column which is not a primary or foreign key. The model looks fine, but when I try to persist it the 'id' field is being stripped out of the sql insert statement.
[14:57:04] hanikazm: Rails 4.2/Ruby 1.9
[14:59:46] rmerry_: has left #RubyOnRails: ()
[15:03:02] l_tonz: has joined #RubyOnRails
[15:04:59] DrYockel: has joined #RubyOnRails
[15:10:04] AzaToth: has joined #RubyOnRails
[15:11:08] DTZUZO: has joined #RubyOnRails
[15:14:42] l_tonz: has joined #RubyOnRails
[15:35:15] mikecmpbll: has joined #RubyOnRails
[15:37:00] DTZUZO: has joined #RubyOnRails
[15:39:33] kiffpowerss: has joined #RubyOnRails
[15:40:52] kiffpowerss: Hey guys. I need to filter child objects based on the attribute of a parent. I got a Parent class called "account" and I got a child class called "lines". I want to get all of the lines where the "owner" of the account is called "Jon".
[15:41:25] kiffpowerss: The lines of multiple accounts should be returned as long as the account owner is jon
[15:41:41] mikecmpb_: has joined #RubyOnRails
[15:43:04] l_tonz: has joined #RubyOnRails
[15:44:00] Barrt: has joined #RubyOnRails
[15:48:59] iamarun: has joined #RubyOnRails
[15:56:40] yehowyada: has joined #RubyOnRails
[15:59:27] kiffpowerss: when i have this has_many :lines, through :account. Is it possible for me to group this on account.owner ?
[16:01:13] wethu: has joined #RubyOnRails
[16:03:08] alibby: has joined #RubyOnRails
[16:06:52] tcopeland: Kiffpowerss: sounds something like: Line.joins(account: :person).where(account: {people: {name: "Jon"}})
[16:08:25] alibby: has joined #RubyOnRails
[16:09:33] mikecmpbll: has joined #RubyOnRails
[16:10:05] kiffpowerss: I dont have a person model. Just a string with the name of the owner in account
[16:10:09] kiffpowerss: How would you go about doing that ?
[16:14:00] tcopeland: ah ok so maybe: Line.joins(:account).where(accounts: {owner: "Jon"})
[16:14:08] kiffpowerss: The best option is actually for me to be able to create a custom through
[16:14:09] mikecmpbll: has joined #RubyOnRails
[16:14:36] kiffpowerss: has_many :lines, through: (:account.where(owner = "jon"))
[16:18:06] l_tonz: has joined #RubyOnRails
[16:24:37] ams__: has joined #RubyOnRails
[16:29:50] Saukk: has joined #RubyOnRails
[16:30:00] morfin: has joined #RubyOnRails
[16:31:10] morfin: so i had to include models to make RailsAdmin(ew) load them when this models dynamically created by globalize
[16:32:08] fugee: has joined #RubyOnRails
[16:32:15] fugee: beweaver: what would be an example of a muli-blog platform on the web?
[16:41:37] mikecmpb_: has joined #RubyOnRails
[16:42:41] uksio: has joined #RubyOnRails
[16:51:20] [Butch]: has joined #RubyOnRails
[16:51:52] bronson: has joined #RubyOnRails
[16:53:32] DTZUZO: has joined #RubyOnRails
[16:53:37] mikecmpbll: has joined #RubyOnRails
[16:53:54] marahin: Hello! I'm trying to check if particular object receives a method call in rspec, using `expect(obj).to receive(:blah).once`. However I dont want to care about the output - there's some complicated logic and I can't seem to make it work using stubs. Is there a way to check if method was called, but don't really care about the output (or potentiatl raises)?
[16:56:06] fschuindt: marahin: allow(obj).to receive(:blah) { :return_value }
[16:56:22] marahin: fschuindt will this completely omit the logic in the method?
[16:56:29] fschuindt: put this in a before ou let block
[16:56:47] fschuindt: marahin: yeap, it will return the value instead of calling the original method
[16:57:05] marahin: fschuindt ah, that's another caveat - we're not using the greatness of `let`, `before` or anything like that, we're going for full-explicit non-DRY approach where we literally just have lines of code and method calls in the individual examples
[16:57:10] marahin: I'll try that nonetheless, thank you very much!
[16:57:32] fschuindt: sure, np :)
[16:59:05] jnollette: has joined #RubyOnRails
[16:59:30] mikecmpbll: has joined #RubyOnRails
[17:04:32] l_tonz: has joined #RubyOnRails
[17:04:54] hammer065: has joined #RubyOnRails
[17:07:45] marahin: fschuindt I haven't put it in a before block yet, however - would that work on a non-double object? like, a database record?
[17:08:13] helpa: has joined #RubyOnRails
[17:08:48] marahin: sadly, it seems that even in the before block the method is still called :(
[17:10:32] conceivably: has joined #RubyOnRails
[17:11:26] za1b1tsu: has joined #RubyOnRails
[17:11:40] one_zero: has joined #RubyOnRails
[17:12:06] marahin: i tried to use any_instance.stub, but... undefined method `any_instance' for #<Class ,_,
[17:13:06] za1b1tsu: For custom validations (validate), it is mandatory to have add an error message? I can't get them to work only with true/false
[17:18:14] Inside: has joined #RubyOnRails
[17:19:08] Inside: Question: when running MiniTest, some of the outputs are dashes ("-") instead of dots. What does that mean?
[17:19:27] Inside: ie: # Running: ..........------- ..................................F
[17:19:56] Inside: Oh wait, that just may be a puts somewhere in the code
[17:23:24] Inside: boy egg on face for that one
[17:35:24] armyriad: has joined #RubyOnRails
[17:36:28] conceivably: has joined #RubyOnRails
[17:50:22] l_tonz: has joined #RubyOnRails
[17:53:13] KeyJoo: has joined #RubyOnRails
[17:55:00] wbsgrepit: has joined #RubyOnRails
[17:57:04] wbsgrepit: anyone know how to get a local file path on activestorage "disk" based backend?
[18:00:02] Saukk: has joined #RubyOnRails
[18:00:06] morfin: any idea where do i start rewriting old crap from scratch with RoR?
[18:01:30] Cavallari: has joined #RubyOnRails
[18:01:45] morfin: it seems to be a little bit problematic because of ugly shitcode
[18:01:51] morfin: even for PHP it's so ugly
[18:03:20] dionysus69: has joined #RubyOnRails
[18:03:58] Cache_Money: has joined #RubyOnRails
[18:04:16] hahuang65: has joined #RubyOnRails
[18:05:04] morfin: also there is lots of places where could be not so obvious traps
[18:09:54] l_tonz: has joined #RubyOnRails
[18:17:03] baweaver: morfin: to rewrite an app you must first understand it
[18:17:19] baweaver: and that means in its entirety for each portion you rewrite
[18:17:43] baweaver: complaining about ugly code detracts from the point of it
[18:17:51] orbyt_: has joined #RubyOnRails
[18:18:15] baweaver: wbsgrepit: can't say I've worked with AS. Have you read the docs around it yet?
[18:18:52] morfin: well, i saw this code and understand what it does, just not sure where start =)
[18:18:59] baweaver: though I'd think getting local file paths on a web server is dangerous
[18:19:11] baweaver: Make sure to chart it out
[18:19:37] baweaver: One sec, there was a decent article on the general philosophy I use
[18:20:02] morfin: do not forget local path can contain any number of symlinks =)
[18:20:06] alfiemax: has joined #RubyOnRails
[18:20:51] baweaver: https://makers.airware.com/engineering/lost-wax-method-rewriting-software/
[18:21:04] morfin: not sure... is this true for NFS
[18:21:33] baweaver: The big thing I do is use Acceptance Tests external to the app to verify workflows and run them against both sources
[18:25:32] morfin: so what? you compare behavior?
[18:27:05] morfin: as example user with personal discount 10% have cart 500$ and get 3% discount so he owe you 435$
[18:32:43] Dimik: has joined #RubyOnRails
[18:32:57] npgm: has joined #RubyOnRails
[18:36:01] apeiros: has joined #RubyOnRails
[18:41:28] l_tonz: has joined #RubyOnRails
[18:46:30] srinidhi: has joined #RubyOnRails
[18:52:26] bitch: has joined #RubyOnRails
[18:52:40] bronson: has joined #RubyOnRails
[18:53:34] wbsgrepit: baweaver: yeah it seems like they really want you to access files only via the service_url or by blob.dlownload'ing to a temp file seems very weird.
[18:55:12] ahrs: has joined #RubyOnRails
[18:55:30] sameerynho: has joined #RubyOnRails
[18:56:29] wbsgrepit: baweaver: The more I look at it the more I am not finding it useful -- it seems like they have attached to the idea that you _must_ one off transform the images instead of prerendering the renditions you need and that the access url has to be a temp signed one which kind of kills off any reasonable use fronting public assets with a CDN.
[18:57:07] waseem_: has joined #RubyOnRails
[18:57:30] wbsgrepit: No idea why I would want MRI generating a signed URL for high traffic assets on every reference. =/
[18:58:03] DTZUZO: has joined #RubyOnRails
[18:58:33] wbsgrepit: and in the case of aws or google hosted and public there is no reason to even touch my server (except to get the html that references the image on theirs).
[18:59:46] wbsgrepit: was excited to have a defacto way instead of paperclicp/carrierwave/shrine but the architecture just kind of stinks.
[19:03:05] l_tonz: has joined #RubyOnRails
[19:05:40] garyserj: baweaver: thanks
[19:11:33] sonOfRa: has joined #RubyOnRails
[19:19:48] l_tonz: has joined #RubyOnRails
[19:23:09] ephemer0l_: has joined #RubyOnRails
[19:24:14] sonOfRa: has joined #RubyOnRails
[19:31:38] kinduff: has joined #RubyOnRails
[19:33:23] NoGodDamnIdea: has joined #RubyOnRails
[19:34:51] l_tonz: has joined #RubyOnRails
[19:42:09] DTZUZO: has joined #RubyOnRails
[19:43:09] drale2k_: has joined #RubyOnRails
[19:46:23] kies: has joined #RubyOnRails
[19:53:00] DTZUZO: has joined #RubyOnRails
[19:55:20] cnk: has joined #RubyOnRails
[19:56:38] pwnd_nsfw: has joined #RubyOnRails
[19:59:13] ur5us: has joined #RubyOnRails
[20:02:00] DTZUZO: has joined #RubyOnRails
[20:05:51] l_tonz: has joined #RubyOnRails
[20:10:38] wethu: has joined #RubyOnRails
[20:16:00] ur5us: has joined #RubyOnRails
[20:16:09] l_tonz: has joined #RubyOnRails
[20:26:32] DTZUZO: has joined #RubyOnRails
[20:32:02] tfitts: has joined #RubyOnRails
[20:33:18] DTZUZO: has joined #RubyOnRails
[20:35:06] kdelante14: has joined #RubyOnRails
[20:39:50] jottr: has joined #RubyOnRails
[20:44:03] DTZUZO: has joined #RubyOnRails
[20:49:28] kdelante14: has left #RubyOnRails: ("Leaving")
[20:49:28] jottr_: has joined #RubyOnRails
[20:49:29] orbyt_: has joined #RubyOnRails
[20:57:59] bronson: has joined #RubyOnRails
[21:00:10] chrisgopher: has joined #RubyOnRails
[21:15:33] DTZUZO: has joined #RubyOnRails
[21:16:27] sameerynho: has joined #RubyOnRails
[21:16:31] troys: has joined #RubyOnRails
[21:18:44] darkhanb: has joined #RubyOnRails
[21:19:59] aiguuu: has joined #RubyOnRails
[21:26:48] quazimodo: has joined #RubyOnRails
[21:30:50] orbyt_: has joined #RubyOnRails
[21:31:59] sameerynho: has joined #RubyOnRails
[21:37:49] arBmind: has joined #RubyOnRails
[21:39:12] mikecmpbll: has joined #RubyOnRails
[21:46:35] tomaw: has joined #RubyOnRails
[21:47:07] desperek: has joined #RubyOnRails
[21:49:52] DTZUZO: has joined #RubyOnRails
[21:54:29] jottr_: has joined #RubyOnRails
[21:56:41] tycoon177: is the delegate method in a rails model still applicable in newer versions of rails or is it deprecated? I'm stuck with rails 3 at work for the time being, but we're slowly working towards upgrading rails. i just don't want to add a "delegate" if it's going to need to be replaced later on.
[22:18:47] l_tonz: has joined #RubyOnRails
[22:28:31] pfg_: has joined #RubyOnRails
[22:32:44] jottr_: has joined #RubyOnRails
[22:43:02] spectra: has joined #RubyOnRails
[22:45:30] marr: has joined #RubyOnRails
[22:46:40] quazimodo: has joined #RubyOnRails
[22:50:14] gambl0re: has joined #RubyOnRails
[22:58:43] bronson: has joined #RubyOnRails
[23:01:41] alfiemax: has joined #RubyOnRails
[23:04:46] ahrs: has joined #RubyOnRails
[23:07:30] orbyt_: has joined #RubyOnRails
[23:12:44] quazimodo: has joined #RubyOnRails
[23:27:31] sarink: has joined #RubyOnRails
[23:27:43] l_tonz: has joined #RubyOnRails
[23:31:35] DTZUZO: has joined #RubyOnRails
[23:31:43] JusticeFries: has joined #RubyOnRails
[23:40:41] Jameser: has joined #RubyOnRails
[23:44:14] moei: has joined #RubyOnRails
[23:44:28] tcopeland: looks like it’s not deprecated in 5.1.4 http://api.rubyonrails.org/classes/Module.html#method-i-delegate - I checked master too, not seeing deprecations there