Frederick Cheung wrote in post #975445:
> On Jan 17, 12:44pm, Sem Ptiri <li...@ruby-forum.com> wrote:
>> class App < ActiveRecord::Base
>>  abstract_class = true
>>
> this should be self.abstract_class = true (right now you're just
> setting a local variable)

Point taken.

>>  def initialize
>>   establish_connection :app_development
>>  end
>>
> This is dodgy. First of all you're overriding initialize, but without
> calling through to the super class, so your activerecord objects won't
> get initialized properly.
Taken from online suggestions for handling multiple DBs.

> You've also change the signature of
> initialize. Also, do you really want to be reconnecting to the
> database everytime a new instance is created? lastly this
> establish_connection is a class method

Thanks. I'll fix all that and get back to you.

-- 
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 rubyonrails-talk@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