DBIx::Class::MassAssignable - use set_columns in DBIx::Class safely in a web app
__PACKAGE__->load_components(qw/ MassAssignable /); __PACKAGE__->attr_accessible([qw( post_title post_content )]); __PACKAGE__->attr_protected([qw( is_admin )]); #Get a list of mass_assignable_columns $row->mass_assignable_columns()
Load this as a component into your DBIx::Class result classes then specify either which columns can be mass assigned (whitelist), or which ones are not allowed (blacklist) using set_columns.
None by default.
Concept stolen from Ruby on Rails.
Jonathan Taylor, <jon@stackhaus.com>
Copyright (C) 2012 by Jonathan Taylor
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.
To install DBIx::Class::MassAssignable, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Class::MassAssignable
CPAN shell
perl -MCPAN -e shell install DBIx::Class::MassAssignable
For more information on module installation, please visit the detailed CPAN module installation guide.