aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activemodel/lib')
-rw-r--r--activemodel/lib/active_model/validations.rb9
-rw-r--r--activemodel/lib/active_model/validations_repair_helper.rb6
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)