No commit activity in last 3 years
No release in over 3 years
Rid yourself of attr_accessible and attr_protected. This plugin allows you to stop using mass assignment, and gives you a more flexible way of interacting with your controller params.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme
ActsAsApplyable
===============

acts_as_applyable is a Rails plugin that allows you to ditch attr_accessible and attr_protected, in favor of a cleaner way of dealing with mass assignment

Example
=======

Old way:
@user = User.new(params[:user])
@user.save

New way:
@user = User.new
@user.params = params[:user]
@user.apply(:username, :email, :password, :password_confirmation)

In order to enable it, run this on your model

If you want to act similar to attr_accessible, you can define a method called applyable_attributes that returns
the array of fields you want to appy by default.

def applyable_fields
 [:name, :email, :password]
end

that way you can run @user.apply and it will use these

Copyright (c) 2008 RailsJedi.com, released under the MIT license