In my Rails 3.2.11 and "development" environment when I try to have an active model:
class DisponibilityApi
include ActiveModel::Model
attr_accessor :start_time, :end_time
validates :start_time, :end_time, :presence => true
end
I have an error:
NameError: uninitialized constant ActiveModel::Model
But when I include it manually:
class DisponibilityApi
extend ActiveModel::Naming
extend ActiveModel::Translation
include ActiveModel::Validations
include ActiveModel::Conversion
attr_accessor :start_time, :end_time
validates :start_time, :end_time, :presence => true
end
Now it works !
Am I missing something ?
Thanks !
persisted?
method. – Catheterize