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

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

Instance Method Summary collapse

Instance Method Details

#accessible_attributesObject



16
17
18
# File 'lib/mongo_mapper/plugins/accessible.rb', line 16

def accessible_attributes(*)
  _accessible_attributes
end

#accessible_attributes?Boolean

Returns:



20
21
22
# File 'lib/mongo_mapper/plugins/accessible.rb', line 20

def accessible_attributes?
  _accessible_attributes?
end

#attr_accessible(*attrs) ⇒ Object



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

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