Skip to content
This repository
tree: 3185ac76ea
Fetching contributors…

Cannot retrieve contributors at this time

file 14 lines (11 sloc) 0.378 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14
require_relative 'converts_subscriber_to_feed_data'

class FindsOrCreatesFeeds
  def self.find_or_create(subscribe_to)
    feed = Feed.first(:id => subscribe_to)

    unless feed
      feed_data = ConvertsSubscriberToFeedData.get_feed_data(subscribe_to)
      feed = Feed.first(:remote_url => feed_data.url) || Feed.create_from_feed_data(feed_data)
    end

    feed
  end
end
Something went wrong with that request. Please try again.