[Rails-core] has_many doc inconsistency/missing info in upgrade doc related to dependent option behavior change from Rails 3 to 4

2013-12-16 Thread Gary Weaver
A team member just found the following out about an inconsistency in the Rails documentation. Although: https://github.com/rails/rails/pull/7188/files indicates for the dependent option: "When no option is given, the behaviour is to do nothing with the associated records when destroying a record

Re: [Rails-core] Delegate default value option

2013-12-16 Thread Amiel Martin
I like this idea and would use it. -Amiel http://carnesmedia.com On Fri, Dec 13, 2013 at 2:44 PM, Scott Johnson <7.scot...@gmail.com> wrote: > I find I often use delegate and many nil guards in my facades. Adding a > default_value option to delegate would simplify this, but I am interested >

Re: [Rails-core] UrlHelper: Extracting url_for to separate module

2013-12-16 Thread richard schneeman
Do you have a PR you could send over? I'm taking the silence here as either a :+1: or people have no idea what you're talking about. Cleaning up url_for is a pretty huge task. By putting it into a module are you suggesting that a user would need to manually include it? I'm not sure how one exclude

Re: [Rails-core] Delegate default value option

2013-12-16 Thread Scott Johnson
Thanks. I will work up a pull request and see if I can get it added. On Mon, Dec 16, 2013 at 11:37 AM, Amiel Martin wrote: > I like this idea and would use it. > > -Amiel > > http://carnesmedia.com > > > On Fri, Dec 13, 2013 at 2:44 PM, Scott Johnson <7.scot...@gmail.com>wrote: > >> I find I of

Re: [Rails-core] Delegate default value option

2013-12-16 Thread Rafael Mendonça França
What is the advantage over? def name person.name || ""end I am really against adding new options to delegate method since all that it does is define methods like this in the class. Rafael Mendonça França http://twitter.com/rafaelfranca https://github.com/rafaelfranca On Mon, Dec 16, 2013 at

Re: [Rails-core] Delegate default value option

2013-12-16 Thread Matt Jones
On Dec 13, 2013, at 5:44 PM, Scott Johnson wrote: > I find I often use delegate and many nil guards in my facades. Adding a > default_value option to delegate would simplify this, but I am interested how > others feel about it. > > Implementation would look something like: > > class PersonFa

Re: [Rails-core] Delegate default value option

2013-12-16 Thread Scott Johnson
This is why I wanted to ask the group before making the pull request. As for Rafael's question -- it is no different from writing the methods out, but either is delegate. I just found that many times where I would have used delegate I ended up writing out the individual methods only to add || = "

Re: [Rails-core] Delegate default value option

2013-12-16 Thread Rafael Mendonça França
We already rejected this feature before. See https://github.com/rails/rails/pull/11908 Rafael Mendonça França http://twitter.com/rafaelfranca https://github.com/rafaelfranca On Mon, Dec 16, 2013 at 6:20 PM, Scott Johnson <7.scot...@gmail.com> wrote: > This is why I wanted to ask the group befor

Re: [Rails-core] Delegate default value option

2013-12-16 Thread Scott Johnson
Fair enough, thanks for the reference. On Mon, Dec 16, 2013 at 2:28 PM, Rafael Mendonça França < rafaelmfra...@gmail.com> wrote: > We already rejected this feature before. See > https://github.com/rails/rails/pull/11908 > > Rafael Mendonça França > http://twitter.com/rafaelfranca > https://gith

Re: [Rails-core] UrlHelper: Extracting url_for to separate module

2013-12-16 Thread Pier-Olivier Thibault
url_for is not a trivial thing, it's intertwined with many aspect of rails. I agree that it's not trivial to use url_for to link dynamically different engine's routing. I think I understand your frustration with the routing system and rails::engine. On Monday, December 16, 2013 1:11:38 PM UTC-5