Tuesday, May 18, 2010

[Rails] Re: Multiple Databases using an abstract class - help

On May 18, 8:39 pm, Kim <kim.gri...@gmail.com> wrote:
>  I am trying to figure out how to use an abstract class to access
> multiple databases. I can connect just fine using
> establish_connections in an abstract class, and I can query the
> database using find_by_sql on the abstract class. I am having problems
> with then using the data returned from the query. I am looking on any
> help on best practices and such.

Why are you calling find_by_sql on an abstract class ? When you try
and use the computer object (by calling name etc.) rails tries to work
out what it should do with attributes (eg is it a string, a date, a
number) and things of that order, and to do so it examines the schema
for the table it thinks the objects come from.

Fred

--
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


Real Estate