Skip to content

Commit 1c3ceef

Browse files
committed
Rails 5.2.0 changed the options of the methods belongs_to, has_many and has_one.
See: rails/rails@9b53f74 Closes #19
1 parent 4a0d2e4 commit 1c3ceef

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/polymorphic_integer_type/extensions.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module PolymorphicIntegerType
33
module Extensions
44
module ClassMethods
55

6-
def belongs_to(name, scope = nil, options = {})
6+
def belongs_to(name, scope = nil, **options)
77
options = scope if scope.kind_of? Hash
88
integer_type = options.delete :integer_type
99
super
@@ -94,7 +94,7 @@ def retrieve_polymorphic_type_mapping(polymorphic_type:, class_name:)
9494
end
9595
end
9696

97-
def has_many(name, scope = nil, options = {}, &extension)
97+
def has_many(name, scope = nil, **options, &extension)
9898
if scope.kind_of? Hash
9999
options = scope
100100
scope = nil
@@ -104,7 +104,7 @@ def has_many(name, scope = nil, options = {}, &extension)
104104
super(name, options.delete(:scope), options, &extension)
105105
end
106106

107-
def has_one(name, scope = nil, options = {})
107+
def has_one(name, scope = nil, **options)
108108
if scope.kind_of? Hash
109109
options = scope
110110
scope = nil

0 commit comments

Comments
 (0)