Re: [Feature request] has_many option to generate additionnal has_many for each given scope.

57 views
Skip to first unread message
Message has been deleted
Message has been deleted

Julien Grillot

unread,
Apr 9, 2017, 5:36:31 PM4/9/17
to Ruby on Rails: Core
Here is the PR: https://github.com/rails/rails/pull/28626

Does somebody have a thought on it?

Joshua Flanagan

unread,
Apr 10, 2017, 11:16:10 AM4/10/17
to Ruby on Rails: Core
The "before" version really doesn't seem that painful. Compared with the cost to the rails team to maintain the syntax, and the cost in understandability to other developers that happen upon your code. DSLs are only helpful when they are well understood by everyone that has to read them - something like this would be very rarely used, so every dev that encounters it in the wild will have to look up what "compose" means, (or try to figure out where published_posts is defined if they dont know the trick is to look at the posts has_many definition) to try and figure out the magic.

I think you're better off being more explicit in these cases.

Kevin Deisz

unread,
Apr 10, 2017, 11:36:25 AM4/10/17
to rubyonra...@googlegroups.com
Probably a better first step would be to move this into a gem and then if it garners wide enough adaption making the case then.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.



--
Kevin D. Deisz
Localytics Software Engineer
Reply all
Reply to author
Forward
0 new messages