OSDN Git Service

t#29983:show panel with license
[pettanr/pettanr.git] / app / models / story.rb
index 5bfb195..3a7f329 100644 (file)
@@ -148,6 +148,14 @@ class Story < ActiveRecord::Base
     '[' + ary.map {|i| i.story_as_json(au) }.join(',') + ']'
   end
   
+  def self.licensed_pictures stories
+    r = {}
+    stories.each do |story|
+      r.merge! story.panel.licensed_pictures
+    end
+    r
+  end
+  
   def self.new_t comic_id
     r = Story.max_t(comic_id)
     r.blank? ? 0 : r.to_i + 1