Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zarqman/unprotect_attributes
Rails 2.x plugin to override attr_protected/attr_accessible. Useful for admin interfaces.
https://github.com/zarqman/unprotect_attributes
Last synced: 2 days ago
JSON representation
Rails 2.x plugin to override attr_protected/attr_accessible. Useful for admin interfaces.
- Host: GitHub
- URL: https://github.com/zarqman/unprotect_attributes
- Owner: zarqman
- License: mit
- Created: 2012-06-06T05:08:20.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-06-06T06:54:14.000Z (over 12 years ago)
- Last Synced: 2023-04-10T16:53:58.065Z (over 1 year ago)
- Language: Ruby
- Size: 85.9 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: MIT-LICENSE
Awesome Lists containing this project
README
UnprotectAttributes
===================
Copyright 2008 t.e.morgan.
License: MITUpdates/info: http://iprog.com/project/unprotect_attributes
Contact: [email protected]A plugin to add methods to ActiveRecord to modify all attributes, including
protected ones. This is useful where some attributes are protected for general
user access, but a separate admin controller should be able to update
everything.Installation:
Simply add this plugin into your rails app.To add to your rails app:
./script/plugin install http://svn.iprog.com/projects/rails/plugins/unprotect_attributesMethods:
protected_attributes=(attributes)
Use just like attributes=.
Example: @user.protected_attributes = {:role=>'admin'}
update_protected_attributes(attributes) // update_protected_attributes!(attributes)
Use just like update_attributes and update_attributes!.
Example: @user.update_protected_attributes :role=>'admin'Other Notes:
Tested only with Rails 2.1, although I suspect it will work with 2.0 and 1.2.
If you find a bug, have a suggestion, or just want to tell me that it works,
I'd love to hear from you. Thanks for checking unprotect_attributes out!
--t ([email protected]; http://iprog.com/)