OSDN Git Service

t#29018:modify collect t on story
authoryasushiito <yas@pen-chan.jp>
Wed, 18 Jul 2012 08:05:16 +0000 (17:05 +0900)
committeryasushiito <yas@pen-chan.jp>
Wed, 18 Jul 2012 08:05:16 +0000 (17:05 +0900)
app/models/story.rb
spec/models/story_spec.rb

index 7ae9f3a..3f58e68 100644 (file)
@@ -43,7 +43,6 @@ class Story < ActiveRecord::Base
   
   def self.collect_t story
     r = Story.find(:all, :conditions => ['comic_id = ?', story.comic_id], :order => 't')
-    r << story if story.new_record?
     r.map {|s| s.t}
   end
   
index 2d3a769..93f3a63 100644 (file)
@@ -425,14 +425,6 @@ describe Story do
         r.sort.should eq [0, 1]
       end
     end
-    #DBからの取得では新規作成のデータを含められないかも?
-    context '新規作成のとき' do
-      it '自身を落とさず収集している' do
-        @story2 = Factory.build :story, :t => 1, :comic_id => @comic.id, :panel_id => @panel.id, :author_id => @author.id
-        r = Story.collect_t @story2
-        r.sort.should eq [0, 1]
-      end
-    end
   end
   describe 'tチェックに於いて' do
     before do