OSDN Git Service

Override Issue opened scope. Now reopened issues also included
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Tue, 9 Apr 2013 12:04:31 +0000 (15:04 +0300)
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Tue, 9 Apr 2013 12:04:31 +0000 (15:04 +0300)
app/models/issue.rb

index 54d9af7..cb7ee9f 100644 (file)
@@ -54,4 +54,7 @@ class Issue < ActiveRecord::Base
 
     state :closed
   end
+
+  # Both open and reopened issues should be listed as opened
+  scope :opened, -> { with_state(:opened, :reopened) }
 end