No other answer? I do not have you convinced yet then .. I hope that does 
not bother you if I try again.

About 'this is not active record': with ruby ActiveRecord you have improved 
the pattern yet mixing it with STI and supporting associations with macros.
About 'this is duplicated code': what about STI? where in the migrations 
code or in schema.rb or even in the database itself persist the information 
that an attribute belongs to a children class and not on the whole 
hierarchy classes? And where in the migration code is 

eg
class Content < AR::Base
class Article < Content
class Video < Content

create_table content
   add_column :title ..
   add_column :url ..
   add_column :text ..  

Here Video instances will respond to :text, and Article will respond_to 
:url without batting an eye. moreover even in the schema.rb the 'contents' 
table schema is all you can find.. perhaps this is a consequence of 
ActiveRecord not yet supporting STI very well.

This can't be the same of:

class Content < AR::Base
   field :title

class Article < Content
   field :text

class Video < Content
   field :url

there is a very important information here: text is something that belongs 
to Article, and url is something that belongs to Video. This way you could 
also enforce that Video should not respond to 'text' and Article should not 
respond to 'url'. This is nothing you can express with migrations! 
Migrations are only a history to keep track of changes you made to 
database. They are not good to express the *logical *structure of the 
application domain.

All that i ask to you is what you think about that? But answer without 
focusing on my purposed solution, but in a more abstract way. I think the 
topic of discussion here is not whether to make a change ​​or not to 
ActiveRecord .. I probably said bad in this regard.. but I'd like to know 
what you think of this lack.. first of all.. do you think this is so? have 
you ever thought of it?

For me this was the first thing I noticed when i approached ruby on rails 
from java world. This leak significantly restricts the ability to refactor, 
mantain, document and reuse code, in other word a weakness in dealing with 
changes over time. Why do not just try to make things better? You have just 
done it in past, em i wrong?

Maurizio

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-core/-/bV8pccOcgjgJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to