Rails 4 - Feedzirra NoMethodError - undefined method `updated?' for nil:NilClass

208 Views Asked by At

I'm trying to check a feed for updates using Feedzirra::Feed.update(feed) with the feedzirra gem but I keep getting "NoMethodError - undefined method `updated?' for nil:NilClass". The feed I'm fetching from doesn't have etag properties, but it does have last_modified info which I understand needs to be used for the update function to work, but I still can't figure out where I'm going wrong

def self.update_from_feed

    feed_url = ENV['FEED_URL']
    feed = Feedzirra::Feed.fetch_and_parse(feed_url)
    add_entries(feed.entries)
    last_modified = feed.last_modified
end

def self.update_from_feed_continuously

  updated_feed = Feedzirra::Feed.update(feed)
  add_entries(updated_feed.new_entries) if updated_feed.updated?

end
0

There are 0 best solutions below