Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changed attr_accessible example to reflect grouped roles

Related to the request #5699 - #5699 and
not documented.
  • Loading branch information...
commit 0149a6eef9ab9201db8b48efeea35c46125a84f0 1 parent 167a0b9
@laknath laknath authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 activemodel/lib/active_model/mass_assignment_security.rb
View
6 activemodel/lib/active_model/mass_assignment_security.rb
@@ -141,8 +141,10 @@ def attr_protected(*args)
#
# attr_accessor :name, :credit_rating
#
- # attr_accessible :name
- # attr_accessible :name, :credit_rating, :as => :admin
+ # # Both admin and default user can change name of a customer
+ # attr_accessible :name, :as => [:admin, :default]
+ # # Only admin can change credit rating of a customer
+ # attr_accessible :credit_rating, :as => :admin
#
# def assign_attributes(values, options = {})
# sanitize_for_mass_assignment(values, options[:as]).each do |k, v|
Please sign in to comment.
Something went wrong with that request. Please try again.