module ActiveRecord end class ActiveRecord::Base def unsafe_attributes=(attributes) #:nodoc: return if attributes.nil? attributes.stringify_keys! multi_parameter_attributes = [] attributes.each do |k, v| k.include?("(") ? multi_parameter_attributes << [ k, v ] : send(k + "=", v) end assign_multiparameter_attributes(multi_parameter_attributes) save end # Will update attributes without sticking to "attr_protected" macros. # This can be used for superusers. def update_attributes_unsafely(attributes) self.unsafe_attributes = attributes save end end