Module: ActiveModel::Model
- Included in:
- WebConsole::ConsoleSession
- Defined in:
- lib/active_model/model.rb
Overview
Comment stripped version of ActiveModel::Model from rails/rails revision 85750d43fa714f6773396b8304430f2d1f459350.
Class Method Summary collapse
-
.included(base) ⇒ Object
:nodoc:.
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
:nodoc:
5 6 7 8 9 10 11 12 |
# File 'lib/active_model/model.rb', line 5 def self.included(base) #:nodoc: base.class_eval do extend ActiveModel::Naming extend ActiveModel::Translation include ActiveModel::Validations include ActiveModel::Conversion end end |
Instance Method Details
#initialize(params = {}) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/active_model/model.rb', line 14 def initialize(params={}) params.each do |attr, value| self.public_send("#{attr}=", value) end if params super() end |
#persisted? ⇒ Boolean
22 23 24 |
# File 'lib/active_model/model.rb', line 22 def persisted? false end |