[Rails] Re: Overriding or aliasing name of column in legacy database using Rails/ActiveRecord
I would like to be able to support mssql, postgres, oracle, and
sqlite3. My understanding is that updateable views wouldn't work for
sqlite3, but I'll have to do a bit more research.
Thanks for your suggestion.
On Dec 5, 11:51 am, "E. Litwin" <elit...@rocketmail.com> wrote:
> On Dec 5, 8:26 am, Mike B <mbern...@gmail.com> wrote:
>
> > Let me ask you this:
>
> > If I do set up a view to rename the columns, can I override the create
> > and update method in ActiveRecord::Base to make it insert into the
> > original table (rather than the view)? Having looked at
> > ActiveRecord::Base a little bit it would seem that I can do this
> > without any ill effects.
>
> Why can't you just insert/update the view? As long as the view isn't
> joining any other tables, you can treat it as a regular table (AFAIK
> in MySQL, SQL Server, PostgreSQL).
--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home