Commit b63f446d by Ben A. Morgan Committed by GitHub

Merge pull request #384 from jhawthorn/rails_5_1_0_beta1

Fix UniquenessParanoiaValidator on rails 5.1.0.beta1
parents 103c33b0 4c4519c7
......@@ -284,8 +284,8 @@ require 'paranoia/rspec' if defined? RSpec
module ActiveRecord
module Validations
module UniquenessParanoiaValidator
def build_relation(klass, table, attribute, value)
relation = super(klass, table, attribute, value)
def build_relation(klass, *args)
relation = super
return relation unless klass.respond_to?(:paranoia_column)
arel_paranoia_scope = klass.arel_table[klass.paranoia_column].eq(klass.paranoia_sentinel_value)
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