module Sequel::Plugins::WhitelistSecurity::ClassMethods
def freeze
def freeze @allowed_columns.freeze super end
def get_setter_methods
def get_setter_methods if allowed_columns allowed_columns.map{|x| "#{x}="} else super end end
def set_allowed_columns(*cols)
Artist.set(name: 'Bob', hometown: 'Sactown') # No Error
Artist.set_allowed_columns(:name, :hometown)
the allowed fields per call.
It may be better to use +set_fields+ which lets you specify
mass assignment, they need to be listed here as well (without the =).
setter methods (methods that end in =) that you want to be used during
any columns not listed here will not be modified. If you have any virtual
Set the columns to allow when using mass assignment (e.g. +set+). Using this means that
def set_allowed_columns(*cols) clear_setter_methods_cache @allowed_columns = cols end