> 2 - application-specific classes can't be used inside migrations (is this > really a disadvantage?)
agree. > Some people like the idea of updating some data in the database during a > migration by using the ORM itself inside the migrations. > > While this can be handy sometimes, it can create some issues too. > > For instance, your migration is now relying on your application code by the > time you created the migration. You're right, i did not put enough attention, this other approach would solve the problem: class Content < AR::Base inheritable ... class Article < Content rails g migration create_articles --from Article --strategy mti > Back to the subject: > > I've tried to convince you not to argue about defining the properties inside > the models to avoid duplication of code in migrations because they should be > really isolated from each other from my point of view I totally agree i don't was arguing to define properties inside the models to avoid duplication of code.. i was just answering to a previous response ;). What you say is just the same that i say: migrations need to be more isolated from the rest. From your response i guess you have missed the conversation from the begining am i right? My concern was that implementing properties in models ActiveRecord could have the same benefits that some other ORMs are taking advantage yet. > Now, I'd like to share that I like the ability to quickly see what are the > column names for some domain by looking at its source-code. Your solution > provides that, but it is not the only way to achieve this goal. Really.. this is not enough.. what i want is to have them defined in models.. there are many solutions to document schema.. not the main point. Availability of attributes in mixins, properly use of inheritance, more indirection.. these are benefits we can't miss. The fact that models are self-documented would be a nice side effect achieved for free. To see what benefits i'm talking about refer to https://github.com/mcasimir/active_record_schema (yes i'know.. ugly name) or to previous messages. Thanks Maurizio -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. 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.
