Sha256: 0613d00005c7159f84c3441f9e9c63fcd19700739374b94c2c11624a5e328b2d
Contents?: true
Size: 591 Bytes
Versions: 11
Compression:
Stored size: 591 Bytes
Contents
module RailsConnector # The CMS news object # # This class models the join table between channels and objects. # Instances of this class also hold information about validity range. # @api public class News < CmsBaseModel self.primary_key = "news_id" belongs_to :object, class_name: "Obj", foreign_key: "object_id" def self.table_name "#{table_name_prefix}" "news" end scope :active, -> { where("? BETWEEN valid_from AND valid_until", Time.now.to_s(:number)) } scope :for_channel, ->(channel_name) { where(channel_name: channel_name) } end end
Version data entries
11 entries across 11 versions & 1 rubygems