Update RssAgent#events_order

Akinori MUSHA 8 年之前
父节点
当前提交
63c35c0832
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      app/models/agents/rss_agent.rb

+ 6 - 2
app/models/agents/rss_agent.rb

@@ -82,8 +82,12 @@ module Agents
82 82
       validate_events_order
83 83
     end
84 84
 
85
-    def events_order
86
-      super.presence || DEFAULT_EVENTS_ORDER
85
+    def events_order(key = SortableEvents::EVENTS_ORDER_KEY)
86
+      if key == SortableEvents::EVENTS_ORDER_KEY
87
+        super.presence || DEFAULT_EVENTS_ORDER
88
+      else
89
+        raise ArgumentError, "unsupported key: #{key}"
90
+      end
87 91
     end
88 92
 
89 93
     def check