From e7d6f48ea9a70438997219ef86e3a066f3bd005f Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Fri, 29 May 2009 17:23:38 -0500 Subject: [PATCH] Use AS::Concern in ActiveModel --- activemodel/lib/active_model/validations.rb | 9 +++++---- .../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) -- GitLab