Advertisement
Guest User

Untitled

a guest
Oct 10th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.68 KB | None | 0 0
  1. require 'active_record'
  2. ActiveRecord::Base.establish_connection(
  3. :adapter => 'mysql2',
  4. :username => 'asdf',
  5. :password => 'asdf',
  6. :database => 'asdf',
  7. :password => 'asdf',
  8. :host => '127.0.0.1'
  9. )
  10.  
  11. class SwitchHistory < ActiveRecord::Base
  12. set_table_name "history"
  13. end
  14.  
  15. puts SwitchHistory.first.inspect
  16.  
  17.  
  18. rails runner lib/import_rateplans.rb 1937 christoph
  19. /home/christoph/.rvm/gems/ruby-1.9.2-p180@history/gems/mysql2-0.2.7/lib/active_record/connection_adapters/mysql2_adapter.rb:634:in `select': wrong number of arguments (3 for 2) (ArgumentError)
  20. from /home/christoph/.rvm/gems/ruby-1.9.2-p180@history/gems/activerecord-3.1.0.rc4/lib/active_record/connection_adapters/abstract/database_statements.rb:9:in `select_all'
  21. from /home/christoph/.rvm/gems/ruby-1.9.2-p180@history/gems/activerecord-3.1.0.rc4/lib/active_record/connection_adapters/abstract/query_cache.rb:62:in `select_all'
  22. from /home/christoph/.rvm/gems/ruby-1.9.2-p180@history/gems/activerecord-3.1.0.rc4/lib/active_record/base.rb:473:in `find_by_sql'
  23. from /home/christoph/.rvm/gems/ruby-1.9.2-p180@history/gems/activerecord-3.1.0.rc4/lib/active_record/relation.rb:109:in `to_a'
  24. from /home/christoph/.rvm/gems/ruby-1.9.2-p180@history/gems/activerecord-3.1.0.rc4/lib/active_record/relation/finder_methods.rb:370:in `find_first'
  25. from /home/christoph/.rvm/gems/ruby-1.9.2-p180@history/gems/activerecord-3.1.0.rc4/lib/active_record/relation/finder_methods.rb:122:in `first'
  26. from /home/christoph/.rvm/gems/ruby-1.9.2-p180@history/gems/activerecord-3.1.0.rc4/lib/active_record/base.rb:444:in `first'
  27. from lib/import_rateplans.rb:3:in `<top (required)>'
  28. from /home/christoph/.rvm/gems/ruby-1.9.2-p180@history/gems/railties-3.1.0.rc4/lib/rails/commands/runner.rb:47:in `eval'
  29. from /home/christoph/.rvm/gems/ruby-1.9.2-p180@history/gems/railties-3.1.0.rc4/lib/rails/commands/runner.rb:47:in `<top (required)>'
  30. from /home/christoph/.rvm/gems/ruby-1.9.2-p180@history/gems/railties-3.1.0.rc4/lib/rails/commands.rb:63:in `require'
  31. from /home/christoph/.rvm/gems/ruby-1.9.2-p180@history/gems/railties-3.1.0.rc4/lib/rails/commands.rb:63:in `<top (required)>'
  32. from script/rails:6:in `require'
  33. from script/rails:6:in `<main>'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement