Commit 4c4519c7 by John Hawthorn

Fix UniquenessValidator on rails 5.1.0.beta1

parent 103c33b0
...@@ -284,8 +284,8 @@ require 'paranoia/rspec' if defined? RSpec ...@@ -284,8 +284,8 @@ require 'paranoia/rspec' if defined? RSpec
module ActiveRecord module ActiveRecord
module Validations module Validations
module UniquenessParanoiaValidator module UniquenessParanoiaValidator
def build_relation(klass, table, attribute, value) def build_relation(klass, *args)
relation = super(klass, table, attribute, value) relation = super
return relation unless klass.respond_to?(:paranoia_column) return relation unless klass.respond_to?(:paranoia_column)
arel_paranoia_scope = klass.arel_table[klass.paranoia_column].eq(klass.paranoia_sentinel_value) arel_paranoia_scope = klass.arel_table[klass.paranoia_column].eq(klass.paranoia_sentinel_value)
if ActiveRecord::VERSION::STRING >= "5.0" if ActiveRecord::VERSION::STRING >= "5.0"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment