1 class Pettanr::Content < Pettanr::Item
2 self.abstract_class = true
17 def self.operator operators
29 self.owner_type.to_s + '_id'
32 def self.edit content_id, operators
33 content = self.find content_id, self.show_opt
34 raise ActiveRecord::Forbidden unless content.own?(operators)
41 self.class.owner_model ? self.__send__(self.class.owner_model.item_name) : self
44 def visible? operators
46 return true if owner_model.own?(operators)
51 operator = self.class.operator operators
52 return false unless operator
53 owner_model.attributes[self.class.owner_column] == operator.id