Sha256: 80286e5a93489e92a0ee4debc1a95e142c2ba1688dbcd982f3200f025ad0aca4
Contents?: true
Size: 720 Bytes
Versions: 33
Compression:
Stored size: 720 Bytes
Contents
require 'digest/md5' class Article < ActiveRecord::Base belongs_to :player belongs_to :game has_and_belongs_to_many :news_filters, :join_table => "articles_news_filters" def self.find_by_category(category) Article.find(:all, :conditions => ['category = ?', category], :order => 'published_at DESC') end def set_digest str = (self["published_at"].nil?) ? self["title"] : (self["title"] + self["published_at"].to_s) self["digest"] = Digest::SHA1.hexdigest(str) end def is_article? true end def is_video? false end def is_twitter? false end def sn_url self["link"] end end
Version data entries
33 entries across 33 versions & 1 rubygems