{:include => [:resource_picture, :artist, :license]}
end
- def self.show cid, opt = {}
- Comic.find(cid, :include => self.show_include_opt(opt))
+ def self.show cid, author, opt = {}
+ pic = OriginalPicture.find(cid, :include => self.show_include_opt(opt))
+ raise ActiveRecord::Forbidden unless pic.own?(author)
+ pic
end
def self.show_include_opt opt = {}
- res = [:author]
+ res = [:license]
res.push(opt[:include]) if opt[:include]
res
end
def self.show_json_include_opt
- {:include => :author}
+ {:include => :license}
end
def destroy_with_file