Model::import raises NameError

13 views
Skip to first unread message

gregory grey

unread,
Oct 1, 2014, 12:05:10 PM10/1/14
to rubyonra...@googlegroups.com
Hi, guys
Need a hand here:

puts All.connection
puts All.all.inspect
All.import columns, values

gives me the following error

#<ActiveRecord::ConnectionAdapters::SQLite3Adapter:0x00000006568e38>
 #<ActiveRecord::Relation []>
rake
aborted! NameError: uninitialized constant All::Name /usr/local/rvm/gems/ruby-2.1.2/gems/activerecord-4.1.6/lib/active_record/inheritance.rb:133:in

So, I can connect, I can inspect, but I cant import into my model.

The model is following:

class All < ActiveRecord::Base
has_one :name
has_one :email
has_one :subject
has_one :contents
end

Any help would be highly appreciated,

Cheers,
Gregory

Frederick Cheung

unread,
Oct 2, 2014, 1:58:27 AM10/2/14
to rubyonra...@googlegroups.com
The model is following:

class All < ActiveRecord::Base
has_one :name
has_one :email
has_one :subject
has_one :contents
end


Do you have  a model called Name (in name.rb)?

Fred
Reply all
Reply to author
Forward
0 new messages