aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/type/adapter_specific_registry.rb17
1 files changed, 11 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/type/adapter_specific_registry.rb b/activerecord/lib/active_record/type/adapter_specific_registry.rb
index 3509429058..d440eac619 100644
--- a/activerecord/lib/active_record/type/adapter_specific_registry.rb
+++ b/activerecord/lib/active_record/type/adapter_specific_registry.rb
@@ -4,14 +4,20 @@ module ActiveRecord
# :stopdoc:
module Type
class AdapterSpecificRegistry < ActiveModel::Type::Registry
+ def add_modifier(options, klass, **args)
+ registrations << DecorationRegistration.new(options, klass, **args)
+ end
+
private
-
+
def registration_klass
Registration
end
-
- def decoration_registration_klass
- DecorationRegistration
+
+ def find_registration(symbol, *args)
+ registrations
+ .select { |registration| registration.matches?(symbol, *args) }
+ .max
end
end
@@ -118,8 +124,7 @@ module ActiveRecord
end
end
- class TypeConflictError < ::ActiveModel::TypeConflictError
+ class TypeConflictError < StandardError
end
-
# :startdoc:
end