This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Thu Jun 05 19:43:34 -0700 2008 | |
| |
README | Thu Jun 05 19:45:55 -0700 2008 | |
| |
Rakefile | Thu Jun 05 19:43:34 -0700 2008 | |
| |
init.rb | Thu Jun 05 19:43:34 -0700 2008 | |
| |
install.rb | Thu Jun 05 19:43:34 -0700 2008 | |
| |
lib/ | Thu Jun 05 19:43:34 -0700 2008 | |
| |
tasks/ | Thu Jun 05 19:43:34 -0700 2008 | |
| |
test/ | Thu Jun 05 19:43:34 -0700 2008 | |
| |
uninstall.rb | Thu Jun 05 19:43:34 -0700 2008 |
README
MassAssignmentMurderer ====================== For all has_many associations you define in your models, Rails creates a mass assignment method, giving you the ability to change specific attributes of your associated models through mass assignment. This can be very dangerous when your users can create new records. For example, if a User has_many Comments, a comment_ids method is added to the User model, which contains an array of all Comments which belong to that User. For more clarification on the dangers of this issue, check out Railscast episode 26. MassAssignmentMurderer disables mass assignment for has_many association assignment methods. An equivalent effect can be achieved by making the appropriate declarations with attr_protected or attr_accessible. If you are already using attr_accessible in all of your models, then you are already safe. Example ======= class Comment < ActiveRecord::Base belongs_to :user end class User < ActiveRecord::Base # this declaration creates attribute accessor methods for comment_ids has_many :comments # No more mass assignment security hole. has_mass_assignment_murderer end Copyright (c) 2008 [Alex J. Sharp], released under the MIT license







