« Back to channel list

#RubyOnRails - 24 November 2017

« Back 1 day Forward 1 day »
[00:02:56] Or1on: has joined #RubyOnRails
[00:10:31] drowze: has joined #RubyOnRails
[00:28:35] dviola: has joined #RubyOnRails
[00:38:41] shilon: has left #RubyOnRails: ()
[00:38:51] Troy1: has joined #RubyOnRails
[00:43:08] sevenseacat: has joined #RubyOnRails
[00:59:41] _aeris_: has joined #RubyOnRails
[01:13:19] fragamus: has joined #RubyOnRails
[01:23:03] LambdaSource: has joined #RubyOnRails
[01:23:33] LambdaSource: has joined #RubyOnRails
[01:43:27] xlegoman: has joined #RubyOnRails
[01:58:29] drowze: has joined #RubyOnRails
[02:04:12] FastJack: has joined #RubyOnRails
[02:14:09] drowze: has joined #RubyOnRails
[02:24:53] FastJack: has joined #RubyOnRails
[02:28:00] FilthyBanana: has joined #RubyOnRails
[02:54:15] MrCrackPotBuilde: has joined #RubyOnRails
[02:54:40] shilon: has joined #RubyOnRails
[03:10:46] Technodrome: has joined #RubyOnRails
[03:17:01] bronson: has joined #RubyOnRails
[04:02:37] FredStockton: has joined #RubyOnRails
[04:09:29] sunya7a: has joined #RubyOnRails
[04:10:08] sunya7a: hello all. With the new form_with replacing form_for....is there an alternative fields_for as well?
[04:21:26] FredStockton: has left #RubyOnRails: ()
[04:26:07] MrCrackPotBuilde: hhhhmmm i thought i had broken my app but it seams this tutorial https://www.youtube.com/watch?v=PWoOpJtkyjI doesnt work with rails apps. :(
[04:26:25] MrCrackPotBuilde: i susspect something to do with the rendering and layouts
[04:28:29] Radar: MrCrackPotBuilde: That's a 20 min tutorial. Which part didn't work?
[04:29:54] MrCrackPotBuilde: just to be sure before i commented
[04:30:01] MrCrackPotBuilde: i built a brand new app
[04:30:07] Radar: !enternotspace
[04:30:08] helpa: The enter key should not be used as a space bar. Lines on IRC can be up to 400 characters long.
[04:30:21] truenito: has joined #RubyOnRails
[04:30:45] MrCrackPotBuilde: but when i built a local folder index.html stylesheets images
[04:31:14] MrCrackPotBuilde: everything worked fine. When i transfered them over to rails and run the server i just have a blank page
[04:49:59] Jameser: has joined #RubyOnRails
[04:50:50] Technodrome: has joined #RubyOnRails
[04:54:04] guardianx: has joined #RubyOnRails
[05:01:28] tenderlove: has joined #RubyOnRails
[05:03:26] tenderlove: has joined #RubyOnRails
[05:23:57] tenderlove: has joined #RubyOnRails
[05:36:34] iamarun: has joined #RubyOnRails
[05:49:04] LambdaSource: has joined #RubyOnRails
[06:13:57] Jameser: has joined #RubyOnRails
[07:03:19] apeiros: has joined #RubyOnRails
[07:23:25] BloodyMer: has joined #RubyOnRails
[07:27:40] marr: has joined #RubyOnRails
[07:34:51] apeiros: has joined #RubyOnRails
[07:55:58] iamarun: has joined #RubyOnRails
[08:05:59] srinidhi: has joined #RubyOnRails
[08:07:42] elcontrastador: has joined #RubyOnRails
[08:13:46] sunya7a: has joined #RubyOnRails
[08:26:01] apeiros: where does rails4 store which asset files have which hash? e.g. when you have application-40dd90e46bc110ca.css, and you do stylesheet_link_tag 'application', from where does it know the file with the 40dd90e46bc110ca hash is the currently needed file?
[08:27:08] sevenseacat: in the generated manifest.json I believe
[08:29:44] apeiros: public/assets/.sprockets-manifest-<hash>.json?
[08:29:55] sevenseacat: ummm I dont know
[08:30:19] apeiros: I didn't find another file with manifest in the name in public :-/
[08:30:42] apeiros: I too thought there was a manifest file, but that one was the only I could find and it itself contains a hash in the name too
[08:36:53] apeiros: from the contents it seems to partially fit. two top level keys "files" and "assets". assets is a straight "file.css" => "file-<hash>.css" hash. "files" seems to be about meta-data for all the assets. but the size is too small. only about half as big as I'd expect it from the number of existing assets.
[08:46:15] dminuoso: apeiros: As far as I can tell from the sprockets source code, that hash for the manifest is completely random and irrelevant.
[08:46:43] apeiros: dminuoso: ok
[08:47:08] dminuoso: The source code does something like Dir["manifest*.json"] to find the manifest
[08:47:15] apeiros: and I figured the difference in size. the .gz files are not in the manifest (makes sense), also some assets which have no hash at all aren't in either (makes sense too)
[08:48:02] defsdoor: has joined #RubyOnRails
[08:48:03] apeiros: those diffs taken into account, it fits, so that file seems to be the manifest I was looking for.
[08:48:07] apeiros: thanks @ sevenseacat :)
[09:04:36] ams__: has joined #RubyOnRails
[09:13:33] qmr: has joined #RubyOnRails
[09:13:49] qmr: getting lots of err 11 resource temporarily unavailable in nginx logs nginx <-> unicorn. any suggestions? servers do not seem overloaded
[09:23:20] mikecmpbll: has joined #RubyOnRails
[09:30:32] iamarun: has joined #RubyOnRails
[09:30:33] NL3limin4t0r: has joined #RubyOnRails
[09:36:22] LambdaSource: has joined #RubyOnRails
[09:38:58] NL3limin4t0r: has joined #RubyOnRails
[10:02:36] arBmind: has joined #RubyOnRails
[10:03:07] blackmesa1: has joined #RubyOnRails
[10:09:30] blackmesa1: has joined #RubyOnRails
[10:14:41] rmhonji: has joined #RubyOnRails
[10:14:50] rmhonji: has left #RubyOnRails: ()
[10:15:22] rmhonji: has joined #RubyOnRails
[10:18:15] rmhonji: has joined #RubyOnRails
[10:38:37] ur5us: has joined #RubyOnRails
[11:02:24] drowze: has joined #RubyOnRails
[11:21:47] arBmind: has joined #RubyOnRails
[11:28:51] blackmesa1: has joined #RubyOnRails
[11:32:51] drowze: has joined #RubyOnRails
[11:40:20] jottr: has joined #RubyOnRails
[11:55:25] sevenseacat: has joined #RubyOnRails
[12:12:29] apparition: has joined #RubyOnRails
[12:13:36] conta: has joined #RubyOnRails
[12:15:46] alexday: has joined #RubyOnRails
[12:15:52] alexday: what is this error for? https://gist.github.com/argentum47/5d0b957e0f2aaf32d42d59bff88b119e
[12:18:54] alexday: redis conn
[12:21:04] alexday: has left #RubyOnRails: ("WeeChat 1.8")
[12:23:04] truenito: has joined #RubyOnRails
[12:49:27] airdisa: has joined #RubyOnRails
[13:00:28] alexday: has joined #RubyOnRails
[13:02:22] alexday: I have another question. there is a lib/tasks folder. and there is a Rakefile. and in the Ralefie there is no loading of this directory or require of these files. will bundle exec rake, run these .rake file as well? or only the Rakefile
[13:06:31] mikecmpbll: alexday : does your Rakefile have Rails.application.load_tasks ?
[13:06:57] alexday: require File.expand_path('../config/application', __FILE__)
[13:06:58] alexday: Rails.application.load_tasks
[13:07:00] alexday: core_client = Gem::Specification.find_by_name 'core-client'
[13:07:02] alexday: load "#{core_client.gem_dir}/lib/tasks/create_mysql_schema_for_ci.rake"
[13:07:08] mikecmpbll: Rails.application.load_tasks calls this https://github.com/rails/rails/blob/20c91119903f70eb19aed33fe78417789dbf070f/railties/lib/rails/engine.rb#L648
[13:07:18] mikecmpbll: so the answer is yes.
[13:14:52] sunya7a: has joined #RubyOnRails
[13:27:50] tlaxkit: has joined #RubyOnRails
[13:33:27] alexday: it only loads the file doesn't execute the tasks right?
[13:33:57] alexday: I added a puts "Hello" in all of them. they don't get logged though
[13:39:54] blackmesa1: has joined #RubyOnRails
[13:49:25] jordansz: has joined #RubyOnRails
[13:50:07] jordansz: hi everyone i wanted to ask some advice regarding a strange issue; im using a Organisation.uuid now this uuid method is suddenly inside ruby 2.4 and overruling my model attribute
[13:50:11] jordansz: i wondered how this is possible
[13:50:16] jordansz: and how to solve this?
[13:50:36] jordansz: i havent had this problem it just came up recently, somehow model attribute is overruled by ruby method
[13:52:01] jordansz: like model method def get_uuid; return self.uuid; end also fails. that self.UUID part is always called from securerand.rb method def uuid
[13:54:59] alexday: if there is a def self.uuid method then it shouldn't pick it up from securerandom
[13:55:11] jordansz: yes there is alexday
[13:55:38] jordansz: it picks the one from securerandom and not my model attribute, i mean Organisation.uuid that uuid just calls the securerandom method ON my object. strange?! i havent had this issue before
[13:55:50] jordansz: i thought of monkey patching it out for now but thats an ugly way
[13:56:00] jordansz: thought of using model alias attribute but seems deprecated
[13:56:10] jordansz: have tried using a model method like Organisation.get_uuid which has the same issue
[13:56:10] alexday: securerandom require'd in your file?
[13:56:30] alexday: maybe gist some cofe
[13:56:35] alexday: s/cofe/code
[13:56:44] jordansz: strange thing is that i havent had this issue before
[13:57:23] jordansz: i only do @organisation.uuid in my views the result on each page reload is a uuid generated by the securrandom method not using the uuid attribute from the organiation model
[13:58:26] jordansz: like so = Organisation.find(this_organisation.id).uuid
[13:58:44] jordansz: is there a way i can make sure it gets the model attribute?
[14:01:54] alexday: maybe someone overrwote the method in initialzer to mess :D .
[14:02:00] alexday: not sure why
[14:03:07] morfin: has joined #RubyOnRails
[14:03:30] morfin: i forgot how can i update some record(s) without triggering callback?
[14:20:18] dminuoso: morfin: ActiveRecord::Base.suppressor
[14:23:36] mcr1: has joined #RubyOnRails
[14:27:54] morfin: only in certain context?
[14:34:15] alexday: save(false)
[14:34:52] alexday: or skip_callbacks=true
[14:39:36] mcr1: has joined #RubyOnRails
[14:51:10] iamarun: has joined #RubyOnRails
[14:53:22] Technodrome: has joined #RubyOnRails
[15:00:40] dviola: has joined #RubyOnRails
[15:01:25] iamarun: has joined #RubyOnRails
[15:11:39] Technodrome: has joined #RubyOnRails
[15:14:28] sunya7a: has joined #RubyOnRails
[15:20:58] helpa: has joined #RubyOnRails
[15:39:06] Puffball: has joined #RubyOnRails
[15:46:41] Galaxor: has joined #RubyOnRails
[15:47:12] xlegoman: has joined #RubyOnRails
[15:48:55] Galaxor: Hi. I don't want to require javascript in order for delete links to work. Instead, I would like to make it so that when you put into routes.rb a line like resources :things, it automatically defines routes for things/:id/delete, just like it does for things/:id/edit
[15:49:38] Galaxor: I would like to not have to say resources :things do member do get :delete, for each and every single one of my models, because I'm trying not to repeat myself.
[15:49:48] Galaxor: Is it possible to set this up?
[15:50:10] dminuoso: You do not need javascript for delete links to work.
[15:50:43] Galaxor: dminuoso: Oh? Is there some way to do delete links, that the tutorial is not showing me?
[15:50:52] dminuoso: Galaxor: Yes.
[15:51:03] Galaxor: dminuoso: Can I see an example?
[15:51:48] dminuoso: Galaxor: One way is <form action="..."><input type="hidden" name="_method" value="DELETE" ><button>Delete me</button></form>
[15:52:21] lupine: Galaxor: you should not have a route like `get :delete`
[15:52:31] dminuoso: Galaxor: Rails has a middleware that specifially looks for a _method parameter. If you set it, rails will think it is a DELETE request.
[15:52:36] lupine: various browsers will automatically follow all links on a page, for instance
[15:52:38] dminuoso: (Or whatever HTTP verb you use there)
[15:52:43] Galaxor: lupine: get :delete would take you to a confirmation screen that has a delete button.
[15:52:47] jordansz: has joined #RubyOnRails
[15:52:52] lupine: well, that'd be fine
[15:53:02] jordansz: hi everyone how could i make :my_form_id dynamic? cannot find anything regarding this
[15:53:04] dminuoso: Galaxor: Just define a member :delete route then.
[15:53:09] jordansz: i need to add a custom variable inside the :form_name
[15:53:19] dminuoso: Galaxor: i.e.: resources :posts do; member :delete; end
[15:53:52] dminuoso: jordansz: can you please explain more clearly what you are trying to do?
[15:54:13] jordansz: dminuoso i have a = radio_button_tag(:division_id ', division.id, true)
[15:54:31] jordansz: and that :division_id needs to be dymic ( it gets the name attribute in the html )
[15:54:35] Galaxor: dminuoso: Right. I could define this for every one of my models. I mentioned this option above. I want to avoid having a bunch of cut-and-paste stanzas of this in my routes.rb, though.
[15:54:38] jordansz: :division_id + 'x' for example which falis
[15:55:01] Galaxor: dminuoso: I want these routes to be defined automatically when I say resource :thingy, in the same way as the edit routes and so forth are defined automatically.
[15:55:06] dminuoso: Galaxor: What's wrong with the way it is?
[15:55:29] Galaxor: dminuoso: I would be repeating myself. For every model, I would have to cut-and-paste a bunch of stanzas into my routes.rb
[15:55:50] Galaxor: dminuoso: I thought the whole point of rails was so that I could "DRY" not repeat myself.
[15:55:58] dminuoso: Galaxor: Im just asking because initially you mentioned issues with JavaScript. But that does not seem to be the point of this excercise.
[15:56:21] dminuoso: jordansz: convert the symbol into a string first.
[15:57:39] apeiros: has joined #RubyOnRails
[15:58:07] jackhum: has joined #RubyOnRails
[15:58:11] jordansz: howvdo you mean dminuoso
[15:58:17] Galaxor: dminuoso: It seems like the preferred pattern in the Rails community for deleting a resource is to print out a link with something like <%= link_to 'Destroy', thingy_path(thingy), method: :delete, data: { confirm: 'Are you sure?' }
[15:58:31] dminuoso: Galaxor: Oh turns out, that by default there's another trick.
[15:58:38] dminuoso: Galaxor: no this will not use javascript.
[15:58:52] jackhum: has joined #RubyOnRails
[15:59:09] dminuoso: Galaxor: it will generate something like <a href="thingy" data-method="delete" data-confirm="Are you sure?" rel="nofollow">Destroy</a>
[15:59:13] Galaxor: dminuoso: This will use javascript. If I turn off javascript, using the NoScript extension, then clicking the "Destroy" link will end up doing the Show action.
[15:59:25] lupine: (`data-*` uses JS)
[15:59:34] Galaxor: dminuoso: right. data-method and data-confirm are only meaningful because of the "ujs" library.
[15:59:34] lupine: Galaxor: I think there's a way to extend the router. give me a mo
[15:59:39] Galaxor: lupine: Thanks.
[15:59:45] dminuoso: Galaxor: well you can definitely generate your own helper to just generate this:
[15:59:48] jackhum: has joined #RubyOnRails
[15:59:49] dminuoso: <form action="..."><input type="hidden" name="_method" value="DELETE" ><button>Delete me</button></form>
[15:59:55] dminuoso: Galaxor: that way you dont have to touch your routes.
[16:00:15] dminuoso: I think its a bit cleaner than generating a new set of routes and subsequent views.
[16:00:40] Galaxor: dminuoso: Yeah, I can generate that with <%= button_to 'Destroy', method: :delete %>
[16:00:55] dminuoso: Galaxor: Will that also generate a form?
[16:01:00] Galaxor: dminuoso: Yeah.
[16:01:08] jackhum: has joined #RubyOnRails
[16:01:25] lupine: there's http://edgeguides.rubyonrails.org/routing.html#routing-concerns which isn't amazing
[16:01:39] lupine: ideally you'd have access to `with_params` in the router or somethign similar
[16:01:42] Galaxor: dminuoso: You can also add data: { confirm: 'Are you sure?' } to that too, and UJS will put up a confirmation dialog.
[16:02:03] Galaxor: dminuoso: But with the delete form button like that, there's no confirmation screen that doesn't require javascript.
[16:02:14] dminuoso: Galaxor: Ahhh I see where you are getting at.
[16:02:16] Galaxor: lupine: Okay, thanks. I'll check this out...
[16:02:20] dminuoso: Galaxor: http://api.rubyonrails.org/classes/ActionDispatch/Routing/Mapper/Resources.html you can prepend onto this.
[16:02:28] jackhum: has joined #RubyOnRails
[16:02:42] dminuoso: Galaxor: or better yet just define your own method my_resources that does magic
[16:02:44] LambdaSource: has joined #RubyOnRails
[16:03:27] dminuoso: Galaxor: Note in particular the implementation of: http://api.rubyonrails.org/classes/ActionDispatch/Routing/Mapper/Resources.html#method-i-resources
[16:03:48] jackhum: has joined #RubyOnRails
[16:04:18] safetypin: has joined #RubyOnRails
[16:04:36] lupine: with_defaults, rather, but it doesn't exist in the router
[16:05:02] dminuoso: def set_member_mappings_for_resource # :doc:
[16:05:07] dminuoso: this seems to be where the magic happens
[16:05:28] jackhum: has joined #RubyOnRails
[16:05:32] mtkd: has joined #RubyOnRails
[16:05:44] dminuoso: So copy the implementation of set_member_mappings_for_resource and resources, adapt accordingly.
[16:06:56] jackhum: has joined #RubyOnRails
[16:07:13] Galaxor: lupine: These 'concerns' seem quite interesting. I could define a :deletable concern, maybe. I'd still have to put concerns: :deletable on all my resources.
[16:07:16] apeiros: has joined #RubyOnRails
[16:08:02] jackhum: has joined #RubyOnRails
[16:08:07] Galaxor: dminuoso's plan to make a my_resources thing might be a good thing to work with this.
[16:08:37] Galaxor: I think we've got the beginnings of a good plan here, I'll have to dig in.
[16:09:22] jackhum: has joined #RubyOnRails
[16:10:03] marr: has joined #RubyOnRails
[16:10:39] apeiros: has joined #RubyOnRails
[16:10:48] jackhum: has joined #RubyOnRails
[16:11:27] lupine: "why not both?" :p
[16:11:46] dminuoso: Galaxor: https://gist.github.com/anonymous/37c8b3e06d95c9dd7372b73e62791cd6
[16:11:54] dminuoso: This is a shotgun solution. You probably want something more clean than that.
[16:11:59] jackhum: has joined #RubyOnRails
[16:12:19] dminuoso: You have to make sure you do this before rails initializes.
[16:12:52] dminuoso: So the modification has to occur in config/application.rb
[16:13:07] jackhum: has joined #RubyOnRails
[16:14:16] jackhum: has joined #RubyOnRails
[16:14:44] Galaxor: dminuoso: Okay, that's looking good, thanks!
[16:15:33] jackhum: has joined #RubyOnRails
[16:16:36] jackhum: has joined #RubyOnRails
[16:16:40] conta: has joined #RubyOnRails
[16:17:21] Galaxor: So, this "delete confirmation screen without javascript" seems like pretty basic functionality. Would it make sense to whip this into shape and send a pull request to actionpack?
[16:18:28] safetypin: has joined #RubyOnRails
[16:20:56] dminuoso: Galaxor: If you think it has merit, just do it. Worst case it get ignored or there's a discussion why the rails team wont have it.
[16:21:16] dminuoso: You seem to need it either way, so its no loss.
[16:21:34] Galaxor: Right. Ok.
[16:24:14] Galaxor: In my opinon, everybody needs it! Isn't it necessary for accessibility compliance that an app work without javascript turned on? So blind users can use text-only browsers like lynx and stuff?
[16:24:28] dminuoso: Galaxor: So I laid out the things you need to touch. You need to extend the default_actions in ActionDispatch::Routing::Mapper::Resources::Resource to include some action, lets call it "delete"
[16:25:07] dionysus69: has joined #RubyOnRails
[16:25:11] dminuoso: Galaxor: You then need to modify or duplicate ActionDispatch::Routing::Mapper::Resources#resource ActionDispatch::Routing::Mapper::Resources#resources and/or ActionDispatch::Routing::Mapper::Resourcesset_member_mappings_for_resource
[16:27:24] dminuoso: Galaxor: I dont think blind people use text-only browsers though.
[16:29:17] dminuoso: Galaxor: I think its more about managing aria attributes properly. ;-)
[16:29:35] Galaxor: Yeah, it doesn't look like WCAG says anything about javascript. Huh.
[16:30:08] dminuoso: Galaxor: unobstrusive js is mostly just for paranoid folks surfing with noscript
[16:30:37] Galaxor: dminuoso: That's me, so I have a lot of sympathy for these people!
[16:30:39] lupine: or, sensible people, as they're called
[16:35:50] andywww: has joined #RubyOnRails
[16:37:50] andywww: i’m writing some basic logging that wraps up the details of a request into a udp packet but requests over a certain size are larger than what will fit in a single packet
[16:38:31] andywww: I’m trying to find the quickest way to identify if a post request has a file attached
[16:38:41] andywww: any ideas?
[16:39:18] andywww: i’d ideally like it to work across all post requests, traversing the hash looking for a ActionDispatch::Http::UploadedFile
[16:42:33] drowze: has joined #RubyOnRails
[16:46:41] safetypin: has joined #RubyOnRails
[16:50:55] ornerymoose: has joined #RubyOnRails
[16:51:57] ornerymoose: Hello. I’m trying to understand how to update a relationship instead of creating a new one when updating an outage with children. Or maybe I’m overlooking something in my custom validation method in the relationship model: https://gist.github.com/ornerymoose/863d6b0ccd1e036792d9af229b6be7c8 Any insight is appreciated
[16:55:37] Galaxor: dminuoso: So, I put your code redefining set_member_mappings_for_resource into the config/application.rb file, but it had no effect. I also tried with it in a file in config/initializers, but it also had no effect. It seems that the code that defines the canonical set_member_mappings_for_resource is run at some later time, and overwrites what I put in here.
[16:56:18] Galaxor: I don't suppose you have any insight into the rails startup process that'd help me narrow down the search of where I can effectively stick this code?
[16:57:10] safetypin: has joined #RubyOnRails
[17:06:06] Technodrome: has joined #RubyOnRails
[17:08:30] Galaxor: I even stuck the code in the block that defines my routes. So, Rails.application.routes.draw do <your code> \n resource :thing
[17:09:02] Galaxor: (I mean resources: thing)
[17:13:42] safetypin: has joined #RubyOnRails
[17:13:49] armyriad: has joined #RubyOnRails
[17:14:17] jackhum: has joined #RubyOnRails
[17:16:05] mwlang: has joined #RubyOnRails
[17:21:24] uks: has joined #RubyOnRails
[17:21:55] uksio: has joined #RubyOnRails
[17:24:46] jackhum: has joined #RubyOnRails
[17:25:44] AzaToth: has joined #RubyOnRails
[17:38:58] tcopeland: has joined #RubyOnRails
[17:42:53] dviola: has joined #RubyOnRails
[17:55:20] NL3limin4t0r: ornerymoose: The reason your form doesn't work is because Outage doesn't contain the association. Your association is containt within Relationship (belongs_to).
[17:57:22] ornerymoose: NL3limin4t0r: correct, what would be a decent way to attack this situation? As I mentioned in the gist, I can update an outage with children that do not have a current association, or can remove existing children from that outage. but if a child belongs to a different outage, then that’s where the validation issue comes into play (ie, trying to update an outage with a child that is already associated to a different outage)
[17:59:43] mikecmpbll: has joined #RubyOnRails
[18:03:37] jackhum: has joined #RubyOnRails
[18:05:01] jackhum: has joined #RubyOnRails
[18:05:40] NL3limin4t0r: If I understand correctly you want to update the Child association to Outage with a new one. My question is if you want to update the association to the old Outage, why are you using a many-to-many association?
[18:06:20] NL3limin4t0r: It seems like you need a one-to-many association in that scenario.
[18:06:56] Sigyn: has joined #RubyOnRails
[18:07:58] ornerymoose: ‘If I understand correctly you want to update the Child association to Outage with a new one’ correct, so it’d be updating the Relationship. so an example would be having a Relationship entry of outage_id: 1 and child_id:2, and changing the outage_id to 2
[18:08:34] ornerymoose: ah you mean Child has_one relatonship through outages?
[18:10:06] NL3limin4t0r: I would say Child has the following association: `belongs_to :outage, optional: true`.
[18:10:41] mtkd: has joined #RubyOnRails
[18:10:55] NL3limin4t0r: In this case Child can have one or no associations and you can easily update the association with one to a new Outage.
[18:12:05] NL3limin4t0r: With a many-to-many association you will walk into the problem of wich association to update, since Child can have multiple associations to Outage.
[18:13:08] ornerymoose: gotcha, indicated by this line: has_many :outages, through: :relationships in child.rb
[18:13:18] ornerymoose: let me give this a whirl and let you know here. Appreciate the help
[18:15:05] NL3limin4t0r: The change will make Relationship obsolete and will leave Outage with the association `has_many :childs`.
[18:18:40] NL3limin4t0r: `has_many :children` *
[18:23:13] Dimik: has joined #RubyOnRails
[18:32:34] blackmesa1: has joined #RubyOnRails
[18:36:25] jackhum_: has joined #RubyOnRails
[18:45:52] workmad3: has joined #RubyOnRails
[19:18:00] NoGodDamnIdea: has joined #RubyOnRails
[19:18:11] noob_on_rails: messages POST   /messages(.:format)  messages#create // <%= form_tag messages_path, method: :post do %> .... <%= submit_tag 'Send', class: 'btn btn-primary' %>
[19:18:19] noob_on_rails: why isnt this hitting the controller action
[19:24:53] LambdaSource: has joined #RubyOnRails
[19:47:07] blackmesa: has joined #RubyOnRails
[20:06:09] dionysus69: has joined #RubyOnRails
[20:10:40] argoneus: I have a table called "match results", which basically has team1_id, team2_id, and I'm wondering
[20:10:55] argoneus: id1=5, id2=8 for example should return the same matches as id1=8, id2=5
[20:11:10] argoneus: is this something that's doable in the database directly or do I just make another select if the first yields no results?
[20:11:21] argoneus: or make two selects and merge the results or idk
[20:12:01] emerson: has joined #RubyOnRails
[20:12:47] someuser: has joined #RubyOnRails
[20:15:51] xlegoman: has joined #RubyOnRails
[20:16:27] alexertech: has joined #RubyOnRails
[20:19:18] fragamus: has joined #RubyOnRails
[20:21:10] alexertech: has joined #RubyOnRails
[20:23:45] jottr: has joined #RubyOnRails
[20:36:48] ur5us: has joined #RubyOnRails
[20:39:02] ur5us: has joined #RubyOnRails
[20:39:29] rfoust: has joined #RubyOnRails
[20:55:50] ornerymoose: has joined #RubyOnRails
[21:06:08] arBmind: has joined #RubyOnRails
[21:16:25] ghormoon: has joined #RubyOnRails
[21:39:44] xibalba: has joined #RubyOnRails
[21:39:51] conta2: has joined #RubyOnRails
[21:39:59] Technodrome: has joined #RubyOnRails
[21:41:02] safetypin: has joined #RubyOnRails
[21:48:22] sent-hil: has joined #RubyOnRails
[21:50:21] xibalba: has joined #RubyOnRails
[21:53:11] Technodrome: has joined #RubyOnRails
[21:55:44] drowze: has joined #RubyOnRails
[22:17:51] NoGodDamnIdea: has joined #RubyOnRails
[22:18:52] mostlybadfly: has joined #RubyOnRails
[22:42:11] safetypin: has joined #RubyOnRails
[22:46:11] workmad3: has joined #RubyOnRails
[22:49:55] ornerymoose: has joined #RubyOnRails
[23:10:51] DoubleMalt: has joined #RubyOnRails
[23:31:49] tpendragon: has joined #RubyOnRails
[23:33:51] blackmesa1: has joined #RubyOnRails
[23:46:05] workmad3: has joined #RubyOnRails