mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Use AS::Concern in ActiveModel
This commit is contained in:
parent
e767c65cc9
commit
e7d6f48ea9
2 changed files with 6 additions and 9 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue