Oguz Bilgic
2011-Jan-15 06:41 UTC
NoMethodError: undefined method `more_results'' for #<Mysql>
I am trying to create rake task to import data from my old php
application.But I can not connect to mysql database properly, when I run
Old::User.all on rails console ,I get this error :
NoMethodError: undefined method `more_results'' for #<Mysql>
from
/Library/Ruby/Gems/1.8/gems/activerecord-3.0.3/lib/active_record/connection_adapters/mysql_adapter.rb:623:in
`select''
from
/Library/Ruby/Gems/1.8/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in
`select_all''
from
/Library/Ruby/Gems/1.8/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/query_cache.rb:56:in
`select_all''
from
/Library/Ruby/Gems/1.8/gems/activerecord-3.0.3/lib/active_record/base.rb:467:in
`find_by_sql''
from
/Library/Ruby/Gems/1.8/gems/activerecord-3.0.3/lib/active_record/relation.rb:64:in
`to_a''
from
/Library/Ruby/Gems/1.8/gems/activerecord-3.0.3/lib/active_record/relation/finder_methods.rb:143:in
`all''
from
/Library/Ruby/Gems/1.8/gems/activerecord-3.0.3/lib/active_record/base.rb:439:in
`__send__''
from
/Library/Ruby/Gems/1.8/gems/activerecord-3.0.3/lib/active_record/base.rb:439:in
`all''
from (irb):1
Model class Old/user.rb
class Old::User < ActiveRecord::Base
establish_connection "old_database"
# Because table name is lowercase
def self.table_name()
"user"
end
end
database.yml
old_database:
adapter: mysql
database: old_database
username: root
password:
socket: /Applications/MAMP/tmp/mysql/mysql.sock
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
