Greg Willits wrote:
> Short version:
> 
> Is there any way to override the ReadOnly behavior of AR3 when a SELECT
> clause is specified?
> 
> I suspect I know why that change was made, but I have a Rails conversion
> / legacy data situation where I really need those returned models to be
> updatable.
> 
> Long version:
> 
> A collection of related apps sharing 4 databases, over 250 tables, with
> some of those tables having over 200 fields. It was designed to suit dbm
> philosophies not OO/ORM philosophies. From a Rails perspective they
> should be broken down into smaller tables and a boatload of has_one
> associations defined.

Why?  There's nothing remotely non-OO about having 200 fields if that's 
what's needed to define the object.

> But we can't do that.
> 
> While I am converting this one app to Rails, others needing to use the
> DB will not be converted just yet. So, I have to leave the schema 99.9%
> alone until after all apps are Rails, then we can refactor the schema.

Define some database views (in the SQL sense, not the Rails MVC sense) 
to expose a nicer interface to the Rails app.  You can use the 
rails_sql_views plugin to help with the migrations.

> I need a plan for evolving the models and schema over time. I'm hoping
> to find ways to define small models that somehow use only a prtion of
> those large tables. ActiveRecord probably won't be very good at that
> given the way it reflects on the table schema.

Why can't you just not touch the fields you don't want to touch?

The solution here is in your DB, not in your ORM, I think.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
Posted via http://www.ruby-forum.com/.

-- 
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].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to