OSDN Git Service

add folder
[pettanr/pettanr.git] / app / models / scroll.rb
index 4c1d21a..e7c9f55 100644 (file)
@@ -1,4 +1,4 @@
-class Scroll < Peta::Content
+class Scroll < Peta::Binder
   load_manifest
   has_many :scroll_panels
   belongs_to :author
@@ -17,15 +17,21 @@ class Scroll < Peta::Content
   end
   
   def visible? operators
-    return false unless super
-    self.visible > 0
+    case super
+    when nil # super return
+      return true
+    when false
+      return false
+    else
+      self.visible > 0
+    end
   end
   
   def scroll_panels_count
     ScrollPanel.where(['scroll_panels.scroll_id = ?', self.id]).count
   end
   
-  def self.list_order
+  def self.public_list_order
     'scrolls.updated_at desc'
   end