Sha256: c569b89e4b2f9b195bd158b38adfb8b3f1a7f0b4a15d617ec85264ab2c1707c5
Contents?: true
Size: 820 Bytes
Versions: 5
Compression:
Stored size: 820 Bytes
Contents
# DEPRECATED MODEL, NOT USED ANY MORE class CamaleonCms::PostRelationship < ActiveRecord::Base self.table_name = "#{PluginRoutes.static_system_info["db_prefix"]}term_relationships" # attr_accessible :objectid, :term_taxonomy_id, :term_order default_scope ->{ order(term_order: :asc) } belongs_to :post_type, :class_name => "CamaleonCms::PostType", foreign_key: :term_taxonomy_id, inverse_of: :post_relationships, required: false belongs_to :post, ->{ order("#{CamaleonCms::Post.table_name}.id DESC") }, foreign_key: :objectid, inverse_of: :post_relationships, dependent: :destroy, required: false # callbacks after_create :update_count before_destroy :update_count private def update_count self.post_type.update_column('count', self.post_type.posts.size) if self.post_type.present? end end
Version data entries
5 entries across 5 versions & 1 rubygems