mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Changed attr_accessible example to reflect grouped roles
Related to the request #5699 - https://github.com/rails/rails/pull/5699 and not documented.
This commit is contained in:
parent
167a0b9e83
commit
0149a6eef9
1 changed files with 4 additions and 2 deletions
|
@ -141,8 +141,10 @@ module ActiveModel
|
|||
#
|
||||
# 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|
|
||||
|
|
Loading…
Reference in a new issue