If you don't want to dig through all the modules, use the default:
class Message
include ActiveModel::Model
end
This is pretty handy, because it already extends Naming and Translation, and includes Validations and Conversion. And it comes with a nifty initializer that allows to pass attributes in Message.new(title: "...") and offers a persisted? method.
If you don't want to dig through all the modules, use the default:
This is pretty handy, because it already extends Naming and Translation, and includes Validations and Conversion. And it comes with a nifty initializer that allows to pass attributes in Message.new(title: "...") and offers a persisted? method.
See: https://github.com/rails/rails/blob/master/activemodel/lib/active_model/model.rb