I am trying to create a Active Record tableless Model. My user.rb looks like this
class User < ActiveRecord::Base
class_inheritable_accessor :columns
Just for anyone still struggling with this. For rails 2.x.x
class TestImp < ActiveRecord::Base
def self.columns
@columns ||= []
end
end
For rails 3.1.x you can either include ActiveModel (as explained by @ducktyped) without inheriting from ActiveRecord or If you do need to inherit from ActiveRecord::Base due to some reason then the above with one other addition:
class TestImp < ActiveRecord::Base
def attributes_from_column_definition
[]
end
def self.columns
@columns ||= []
end
end