OSDN Git Service

Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
[pettanr/pettanr.git] / app / models / scroll_panel.rb
index 9ce35bb..12fab0f 100644 (file)
@@ -6,7 +6,6 @@ class ScrollPanel < Peta::Leaf
   
   validates :scroll_id, :presence => true, :numericality => true, :existence => {:both => false}
   validates :panel_id, :presence => true, :numericality => true, :existence => {:both => false}
-  validates :author_id, :presence => true, :numericality => true, :existence => {:both => false}
   validates :t, :presence => true, :numericality => {:greater_than_or_equal_to => 0}
   
   def supply_default
@@ -16,29 +15,25 @@ class ScrollPanel < Peta::Leaf
   end
   
   def overwrite operators
-    return false unless operators.author
-    self.author_id = operators.author.id
   end
   
-  def self.public_list_order
-    'scroll_panels.updated_at desc'
+  def self.public_list_where list
+    'scrolls.visible > 0'
   end
   
-  def self.public_list_where
-    'scrolls.visible > 0'
+  def self.by_author_list_includes
+    {
+      :scroll => {
+        :author => {}
+      }
+    }
   end
   
   def self.show_opt
     {:include => {
-      :author => {}, 
       :scroll => {
         :author => {}
       }, 
-      :panel => {
-        :author => {}, 
-        :panel_pictures => {:picture => {:artist => {}, :license => {}}}, 
-        :speech_balloons =>{:balloon => {}, :speech => {}}
-      }
     }}
   end