On Friday, September 14, 2012 8:24:53 AM UTC+1, Panayotis Matsinopoulos 
wrote:
>
> Hi,
>
> Since "belongs_to" does not actually reflect (as an English wording) the 
> real association that one object might have to another, I was thinking 
> about aliasing it using the following code:
>
> class ActiveRecord::Base
>   class << self
>     alias :refers_to :belongs_to
>     alias :is_of     :belongs_to
>     alias :has_a     :belongs_to
>   end
> end
>
> Well I think that would work, but personally I wouldn't - I think you're 
sacrificing readability of the source (people have to know/remember about 
your extensions) just to make it sound better in english (has_a in 
particular muddies the water further between has_one & belongs_to). Dave 
Thomas articulated this better than I could a while 
ago: http://pragdave.blogs.pragprog.com/pragdave/2008/03/the-language-in.html


Fred 

>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/PiHuxshy4Y0J.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to