我尝试在feedjira中加载Feed条目时出错

时间:2015-07-24 06:01:51

标签: ruby-on-rails mongoid feedjira

我尝试加载Feed条目时出错

ArgumentError (wrong number of arguments (2 for 1)):

我使用feedjira 2.0,mongoid 使用1.6.0时没有错误。

  def load_feed_entries
    last_entry = self.feed_entries.last
    if last_entry.nil?
      feed = Feedjira::Feed.fetch_and_parse(self.url)
    else
      feed = Feedjira::Feed.fetch_and_parse(self.url,
        :if_modified_since => last_entry.published_at.to_time)
    end

    Source.add_entries(feed.entries, self.id)
  end

  def self.update_all_feeds(urls)
    Feedjira::Feed.fetch_and_parse(urls,
      :on_success => lambda { |url, feed|
        rss = Source.only(:id).where(:url => url).first
        Source.add_entries(feed.entries, rss.id)
      }
    )
  end

0 个答案:

没有答案