Skip to content

Restrict which columns can be mass assigned, similar to attr_accessible and attr_protected in Rails

License

Notifications You must be signed in to change notification settings

jontaylor/DBIx-Class-MassAssignable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DBIx-Class-MassAssignable

Restrict which columns can be mass assigned, similar to attr_accessible and attr_protected in Rails

Synopsis

__PACKAGE__->load_components(qw/ MassAssignable /);
__PACKAGE__->attr_accessible([qw( post_title post_content )]);
__PACKAGE__->attr_protected([qw( is_admin )]);

Description

With this component loaded the methods set_columns and set_inflated_columns will either ignore fields you haven't specified (if you use attr_accessible) or block fields that you have blacklisted (using attr_protected).

It is important to use only attr_accessible OR attr_protected. If you use both then it will default to using just the whitelisted values (as this is the safer option).

About

Restrict which columns can be mass assigned, similar to attr_accessible and attr_protected in Rails

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages