Permalink
Browse files

Fix plugin for Rails 3.2

  • Loading branch information...
daveyeu committed Feb 27, 2012
1 parent 7befe11 commit cb6b74ef488a6c5b7b2d98bd4cf3b773d21395d6
Showing with 2 additions and 5 deletions.
  1. +0 −4 lib/rails3_acts_as_paranoid.rb
  2. +2 −1 lib/validations/uniqueness_without_deleted.rb
@@ -31,10 +31,6 @@ def acts_as_paranoid(options = {})
alias_method :destroy!, :destroy
end
- ActiveRecord::Reflection::AssociationReflection.class_eval do
- alias_method :foreign_key, :primary_key_name unless respond_to?(:foreign_key)
- end
-
# Magic!
default_scope where("#{paranoid_column_reference} IS ?", nil)
@@ -9,7 +9,8 @@ def validate_each(record, attribute, value)
value = YAML.dump value
end
- sql, params = mount_sql_and_params(finder_class, record.class.quoted_table_name, attribute, value)
+ table = Arel::Table.new(record.class.table_name)
+ sql, params = build_relation(finder_class, table, attribute, value)
# This is the only changed line from the base class version - it does finder_class.unscoped
relation = finder_class.where(sql, *params)

0 comments on commit cb6b74e

Please sign in to comment.