OSDN Git Service

fix license picture
[pettanr/pettanr.git] / app / models / scroll_panel.rb
index 6cc22b6..412e803 100644 (file)
@@ -20,53 +20,23 @@ class ScrollPanel < Peta::Leaf
     self.author_id = operators.author.id
   end
   
-  def self.public_list_order
-    'scroll_panels.updated_at desc'
-  end
-  
   def self.public_list_where
     'scrolls.visible > 0'
   end
   
-  def self.list_opt
+  def self.by_author_list_includes
     {
-      :author => {}, 
       :scroll => {
         :author => {}
-      }, 
-      :panel => {
-        :author => {}, 
-        :panel_pictures => {:picture => {:artist => {}, :license => {}}}, 
-        :speech_balloons =>{:balloon => {}, :speech => {}}
       }
     }
   end
   
-  def self.list_json_opt
-    {:include => {
-      :author => {}, 
-      :scroll => {
-        :author => {}
-      }, 
-      :panel => {
-        :author => {}, 
-        :panel_pictures => {:picture => {:artist => {}, :license => {}}}, 
-        :speech_balloons =>{:balloon => {}, :speech => {}}
-      }
-    }}
-  end
-  
   def self.show_opt
     {:include => {
-      :author => {}, 
       :scroll => {
         :author => {}
       }, 
-      :panel => {
-        :author => {}, 
-        :panel_pictures => {:picture => {:artist => {}, :license => {}}}, 
-        :speech_balloons =>{:balloon => {}, :speech => {}}
-      }
     }}
   end
   
@@ -79,25 +49,4 @@ class ScrollPanel < Peta::Leaf
     self.scroll.own?(operators) and self.panel.usable?(operators)
   end
   
-  def store operators, old_t = nil
-    res = false
-    self.class.transaction do
-      case self.allow? operators
-      when true
-        self.rotate old_t
-      when false
-        raise ActiveRecord::Forbidden
-      else
-      end
-      res = self.save
-      raise ActiveRecord::Rollback unless res
-      res = self.class.validate_t(self.scroll_id) 
-      unless res
-        self.errors.add :t, 'unserialized'
-        raise ActiveRecord::Rollback 
-      end
-    end
-    res
-  end
-  
 end