README.md in scoped_attr_accessible-0.1.2 vs README.md in scoped_attr_accessible-0.1.3
- old
+ new
@@ -13,10 +13,13 @@
gem 'scoped_attr_accessible'
To our Gemfile and running `bundle install`.
+If you encounter issues, please make sure you add it right after activerecord or rails - Otherwise, you might
+encounter issues where the process it uses to hook into ActiveModel fails.
+
## Usage
With it enabled, your application should continue to work as usual with classic `attr_accessible` and `attr_protected`.
When in use, you can simply pass the `:scope` option in your declaration to declare a scope in which it should be accessible.
@@ -106,10 +109,10 @@
# Reeopen the class
class User < ActiveRecord::Base
sanitizer_scope_recognizer :admin do |record, scope_value|
- scope_value.is_a?(User) && user.admin?
+ scope_value.is_a?(User) && scope_value.admin?
end
sanitizer_scope_recognizer :owner do |record, scope_value|
scope_value.is_a?(User) && scope_value == record
end