module ActiveRecordExtension::ClassMethods

Public Instance Methods

whitelisted() click to toggle source
# File lib/invisible_controller/active_record_extension.rb, line 4
def whitelisted()
  return self::WHITELISTED                                       if self.constants.include?(:WHITELISTED)
  return column_names_with_nested_attributes - self::BLACKLISTED if self.constants.include?(:BLACKLISTED)
  column_names_with_nested_attributes
end

Private Instance Methods

column_names_with_nested_attributes() click to toggle source
# File lib/invisible_controller/active_record_extension.rb, line 10
def column_names_with_nested_attributes
  deliverable = column_names.dup
  nested_attributes_options.keys.each do |key|
    deliverable << {"#{key}_attributes" => key.classify.constantize.whitelisted}
  end
  deliverable
end