Sha256: 8e01d5a4d935c663ed5feb3088f0198ef61231f9c3c2dc6dd875a26d885cecf8
Contents?: true
Size: 1.12 KB
Versions: 51
Compression:
Stored size: 1.12 KB
Contents
#require 'fiona7/write_obj' module Fiona7 class ReleasedObj < WriteObj self.configure_for_content(:released) has_many :children, :class_name => self.name, :foreign_key => 'parent_obj_id' belongs_to :parent, :class_name => self.name, :foreign_key => 'parent_obj_id' if Fiona7.mode == :standalone default_scope do now = Time.now.utc.to_iso where("is_released = 1 AND suppress_export = 0").where('obj_class NOT IN (?)', ['X_Generic', 'X_Image', 'X_Container']).where("(valid_from IS NULL or valid_from <= :now) and (valid_until IS NULL or valid_until >= :now)", :now => now) end else # suppress_export can be misused in legacy mode # also valid_from and valid_until should be handled # by the application default_scope do now = Time.now.utc.to_iso where("is_released = 1").where('obj_class NOT IN (?)', ['X_Generic', 'X_Image', 'X_Container'])#.where("(valid_from IS NULL or valid_from <= :now) and (valid_until IS NULL or valid_until >= :now)", :now => now) end end # disable STI self.inheritance_column = :_type_disabled end end
Version data entries
51 entries across 51 versions & 1 rubygems