Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use AS::Concern in ActiveModel

  • Loading branch information...
commit e7d6f48ea9a70438997219ef86e3a066f3bd005f 1 parent e767c65
@josh josh authored
View
9 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
View
6 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)

0 comments on commit e7d6f48

Please sign in to comment.
Something went wrong with that request. Please try again.