module MongoMapper::ReadonlyAttributes
Public Instance Methods
attr_unchanged()
click to toggle source
# File lib/mongo_mapper/readonly_attributes.rb, line 10 def attr_unchanged self._attr_readonly.each do |attr| unless self[attr] == collection.find_one(:_id => self.id)[attr] errors.add(attr, 'cannot be changed') end end end