You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pass keyword arguments to PostgreSQL Adapter Table methods
Fixesrails#54471
`t.exclusion_constraint` and `t.unique_constraint` are extensions
available only for the PostgreSQL adapter. These delegate the
given arguments to `SchemaStatements#add_exclusion_constraint` etc.,
but the current implementation receives all arguments as an array,
so keyword arguments cannot be passed correctly.
As a result, method calls that pass keyword arguments always result
in an argument error.
This change fixes this issue by forwarding arguments using `...`.
Currently, `t.validate_constraint` and `t.validate_check_constraint`
do not accept keyword arguments, but we changes them in preparation
for the future.
expect:add_exclusion_constraint,nil,[:delete_me,"daterange(start_date, end_date) WITH &&",using: :gist,where: "start_date IS NOT NULL AND end_date IS NOT NULL",name: "date_overlap"]
168
+
expect:add_exclusion_constraint,nil,[:delete_me,"daterange(start_date, end_date) WITH &&"],using: :gist,where: "start_date IS NOT NULL AND end_date IS NOT NULL",name: "date_overlap"
169
169
t.exclusion_constraint"daterange(start_date, end_date) WITH &&",using: :gist,where: "start_date IS NOT NULL AND end_date IS NOT NULL",name: "date_overlap"
0 commit comments