Well like I said, I am trying to figure out how to use an abstract
class to access a separate database. I understand why calling the
object attribute is not working, what I am looking for is the proper
way to interact with the separate database. If an abstract class is
not the way, what is? If not find_by_sql then is connection.execute
the right way? Looking for an actual solution.

Thanks.



On May 18, 1:33 pm, Frederick Cheung <frederick.che...@gmail.com>
wrote:
> 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to