diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-05-29 17:23:38 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-05-30 09:35:24 -0500 |
commit | e7d6f48ea9a70438997219ef86e3a066f3bd005f (patch) | |
tree | afb17c87de55b7e4a6e929b8d3f113f675096c9d | |
parent | e767c65cc9c1fc5e2691fbc27756afdf3a2086b3 (diff) | |
download | rails-e7d6f48ea9a70438997219ef86e3a066f3bd005f.tar.gz rails-e7d6f48ea9a70438997219ef86e3a066f3bd005f.tar.bz2 rails-e7d6f48ea9a70438997219ef86e3a066f3bd005f.zip |
Use AS::Concern in ActiveModel
-rw-r--r-- | activemodel/lib/active_model/validations.rb | 9 | ||||
-rw-r--r-- | activemodel/lib/active_model/validations_repair_helper.rb | 6 |
2 files changed, 6 insertions, 9 deletions
diff --git a/activemodel/lib/active_model/validations.rb b/activemodel/lib/active_model/validations.rb index 64343f7a5c..336c2757fc 100644 --- a/activemodel/lib/active_model/validations.rb +++ b/activemodel/lib/active_model/validations.rb @@ -1,9 +1,10 @@ module ActiveModel module Validations - def self.included(base) # :nodoc: - base.extend(ClassMethods) - base.__send__(:include, ActiveSupport::Callbacks) - base.define_callbacks :validate + extend ActiveSupport::Concern + include ActiveSupport::Callbacks + + included do + define_callbacks :validate end module ClassMethods diff --git a/activemodel/lib/active_model/validations_repair_helper.rb b/activemodel/lib/active_model/validations_repair_helper.rb index 99e3b2f631..432e411308 100644 --- a/activemodel/lib/active_model/validations_repair_helper.rb +++ b/activemodel/lib/active_model/validations_repair_helper.rb @@ -1,10 +1,6 @@ module ActiveModel module ValidationsRepairHelper - def self.included(base) - base.class_eval do - extend ClassMethods - end - end + extend ActiveSupport::Concern module Toolbox def self.record_validations(*model_classes) |