Module: MongoMapper::Plugins::Accessible::ClassMethods

Defined in:
lib/mongo_mapper/plugins/accessible.rb

Instance Method Summary collapse

Instance Method Details

#accessible_attributesObject



14
15
16
# File 'lib/mongo_mapper/plugins/accessible.rb', line 14

def accessible_attributes
  self.read_inheritable_attribute(:attr_accessible)
end

#accessible_attributes?Boolean

Returns:



10
11
12
# File 'lib/mongo_mapper/plugins/accessible.rb', line 10

def accessible_attributes?
  !accessible_attributes.nil?
end

#attr_accessible(*attrs) ⇒ Object



5
6
7
8
# File 'lib/mongo_mapper/plugins/accessible.rb', line 5

def attr_accessible(*attrs)
  raise AccessibleOrProtected.new(name) if try(:protected_attributes?)
  self.write_inheritable_attribute(:attr_accessible, Set.new(attrs) + (accessible_attributes || []))
end