diff options
Diffstat (limited to 'activemodel/lib/active_model/model.rb')
-rw-r--r-- | activemodel/lib/active_model/model.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/model.rb b/activemodel/lib/active_model/model.rb new file mode 100644 index 0000000000..9228d54015 --- /dev/null +++ b/activemodel/lib/active_model/model.rb @@ -0,0 +1,22 @@ +module ActiveModel + module Model + def self.included(base) + base.class_eval do + extend ActiveModel::Naming + extend ActiveModel::Translation + include ActiveModel::Validations + include ActiveModel::Conversion + end + end + + def initialize(params={}) + params.each do |attr, value| + self.send(:"#{attr}=", value) + end if params + end + + def persisted? + false + end + end +end |