mirror of https://github.com/rails/rails
Merge pull request #50773 from skipkayhil/hm-fix-another-compat-issue
Fix t.references validating options on Rails < 7.1
This commit is contained in:
commit
474ee0a014
|
@ -1,5 +1,5 @@
|
||||||
* Fix Migrations with versions older than 7.1 validating options given to
|
* Fix Migrations with versions older than 7.1 validating options given to
|
||||||
`add_reference`.
|
`add_reference` and `t.references`.
|
||||||
|
|
||||||
*Hartley McGuire*
|
*Hartley McGuire*
|
||||||
|
|
||||||
|
|
|
@ -82,6 +82,11 @@ module ActiveRecord
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def references(*args, **options)
|
||||||
|
options[:_skip_validate_options] = true
|
||||||
|
super
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def raise_on_if_exist_options(options)
|
def raise_on_if_exist_options(options)
|
||||||
end
|
end
|
||||||
|
|
|
@ -673,6 +673,7 @@ module NoOptionValidationTestCases
|
||||||
change_table :tests do |t|
|
change_table :tests do |t|
|
||||||
t.change :some_id, :float, null: false, wrong_index: true
|
t.change :some_id, :float, null: false, wrong_index: true
|
||||||
t.integer :another_id, wrong_unique: true
|
t.integer :another_id, wrong_unique: true
|
||||||
|
t.references :yet_another_table, bad: :option
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}.new
|
}.new
|
||||||
|
|
Loading…
Reference in New Issue