Sha256: c36fb24f43b771f174297bb9a95655f854dc49921e97e78b3c12471dbb3208d4
Contents?: true
Size: 614 Bytes
Versions: 12
Compression:
Stored size: 614 Bytes
Contents
module Ucpengine class Entry < ActiveRecord::Base scope :published, -> { where('published_at <= ?', Time.zone.now) } include Ucpengine::Concerns::Searchable def self.content_attr(attr_name, attr_type = :string) content_attributes[attr_name] = attr_type define_method(attr_name) do self.payload ||= {} self.payload[attr_name.to_s] end define_method("#{attr_name}=".to_sym) do |value| self.payload ||= {} self.payload[attr_name.to_s] = value end end def self.content_attributes @content_attributes ||= {} end end end
Version data entries
12 entries across 12 versions & 1 rubygems