feeds/app/models/site_feed.rb

22 lines
466 B
Ruby
Raw Normal View History

2015-07-07 11:51:56 +00:00
class SiteFeed
include Mongoid::Document
include Mongoid::Timestamps
field :remote_site_url
field :merge_with_category
field :channel_name
2015-11-09 17:38:30 +00:00
field :channel_title, :localize => true
2015-07-07 11:51:56 +00:00
field :channel_key
field :feed_name, localize: true
field :disabled, type: Boolean, default: false
field :feed_url
field :feed_uid
scope :enabled, ->{where(:disabled => false)}
2016-04-12 06:23:43 +00:00
def category
Category.find(self.merge_with_category) rescue nil
end
2015-07-07 11:51:56 +00:00
end