1 class Pettanr::Content < Pettanr::Item
2 self.abstract_class = true
9 def self.operator operators
21 self.owner_type.to_s + '_id'
24 def self.edit content_id, operators
25 content = self.find content_id, self.show_opt
26 raise ActiveRecord::Forbidden unless content.own?(operators)
36 def visible? operators
38 return true if owner_model.own?(operators)
43 operator = self.class.operator operators
44 return false unless operator
45 owner_model.attributes[self.class.self.class.owner_column] == operator.id