OSDN Git Service

rename model name
[pettanr/pettanr.git] / app / controllers / comics_controller.rb
index 3ef277e..975288b 100644 (file)
@@ -9,10 +9,6 @@ class ComicsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
-
-  def self.model
-    Comic
-  end
   
   def index
     filer_list
@@ -28,10 +24,11 @@ class ComicsController < ApplicationController
   
   def show_html_format format
     format.html {
-      play_list = Locmare::ListGroup.list 'comic_story', 'play'
-      @play_count = play_list.count(@operators, 
+      play_list = Locmare::ListGroup.list(
+        'comic_stories', 'by_comic', @operators, 
         {:id => @item.id, :my_play => @item.own?(@operators)}
       )
+      @play_count = play_list.count(@operators)
     }
   end
   
@@ -47,18 +44,19 @@ class ComicsController < ApplicationController
   end
   
   def play
-    @item = self.class.model.show(params[:id], @operators)
     set_play
-    @items = @list.items(@operators, 
-      {:id => params[:id], :my_play => @item.own?(@operators)},
-      0, -1 # no limit
+    @list = Locmare::ListGroup.list(
+      @my_controller.name, 
+      @my_action.name, @operators, 
+      {:id => @item.id, :offset => 0, :limit => -1}# no limit
     )
-    @count = @items.count
+    @items = @list.items(@operators)
+    @count = @list.count @operators
     # no pager
     respond_to do |format|
       format.html {
         if @item.own? @operators
-          @new_story_items = assist_items('story', 'private')
+          @new_story_items = assist_items('home', 'stories')
         end
       }
       format.json { render json: @items.to_json }