WARNING : This gem has been much more difficult to build that I initialy thought. It doesn’t work, don’t use it
This gem serves a very simple purpose : allowing some roles to bypass the mass assignment security
Mass assignment protection is very important and this gem is not about disabling it (there is a config option in rails for that).
This gem is about giving superpowers to some roles like ‘system’ or ‘admin’. A ‘system’ role could be used to deserialize some objects from a redis database, an ‘admin’ role could be used for doing some management of records from a protected section of the app, …
#config/initializers/mass_assignable.rb MassAssignable::Config.configure do |c| c.mass_assigners = %w(admin) end module ActiveAdmin class BaseController with_role :admin end end
I intend to use this gem on my own project and do the maintenance as far as I need it. This means that I’m very likely to work on bugs but less likely to work on features demands.
This code is released under the Beer-ware License