Sha256: b6c380e90f4272e87a8ed93271380159212b79f42bc66c3148e41bc8e0e7aac7
Contents?: true
Size: 702 Bytes
Versions: 35
Compression:
Stored size: 702 Bytes
Contents
# This is a join table for assets and acts_as_attachable module Effective class Attachment < ActiveRecord::Base self.table_name = EffectiveAssets.attachments_table_name.to_s belongs_to :asset belongs_to :attachable, :polymorphic => true structure do position :integer, :validates => [:presence, :numericality] box :string, :default => 'assets', :validates => [:presence] # This is essentially a category end default_scope -> { includes(:asset).order("\"#{EffectiveAssets.attachments_table_name.to_s}\".\"position\" ASC, \"#{EffectiveAssets.attachments_table_name.to_s}\".\"asset_id\" ASC") } validates_presence_of :asset_id end end
Version data entries
35 entries across 35 versions & 1 rubygems