Forum: Ruby on Rails ActiveRecord: Reading MySQL views

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A458c4d941f0a6f5b01d924c1c3fc004?d=identicon&s=25 Brian Jones (Guest)
on 2007-01-26 19:24
(Received via mailing list)
My production environment is actually Oracle, in which case if I say:

set_table_name "v_table"

It will treat it as a readonly table.

However, doing the same under MySQL throws an
ActiveRecord::StatementInvalid error, saying that the table db.view
doesn't exist.  Is there a way to get around this?  I am using MySQL to
test some new code I am working on, and wouldn't mind making the code
compatible across products.


Brian Jones
A458c4d941f0a6f5b01d924c1c3fc004?d=identicon&s=25 Brian Jones (Guest)
on 2007-01-26 19:26
(Received via mailing list)
Wow that's embarrassing, seconds after posting this it boiled down to a
spelling mistake.

Everything works now.  Sorry for the list spam.

Carry on.


Brian Jones
31254903db793bf6f84bbd607fe092fd?d=identicon&s=25 Anthony Eden (Guest)
on 2007-01-26 19:40
(Received via mailing list)
In case you need it, I've implemented a plugin for Rails which
supports views in migrations and schema dumps. You can find out more
at: http://activewarehouse.rubyforge.org/rails_sql_views/

It currently supports MySQL and PostgreSQL in the latest release and
SQL Server in the trunk.

V/r
Anthony

On 1/26/07, Brian Jones <mojobojo@gmail.com> wrote:
>
>
> >
>


--
Cell: 808 782-5046
Current Location: Melbourne, FL
This topic is locked and can not be replied to.