Sha256: a28e725b23a5b0d401334e376dec50544ea9422b1bfe07d461e1cb9f4414f827

Contents?: true

Size: 608 Bytes

Versions: 4

Compression:

Stored size: 608 Bytes

Contents

# @private
class Skyline::LinkSectionLink < ActiveRecord::Base
  include Skyline::BelongsToReferable
  include Skyline::Positionable
  
  set_table_name :skyline_link_section_links
  
  self.positionable_scope = :link_section_id
  
  belongs_to_referable :linked
  delegate :url, :external?, :file?, :blank?, :to => :linked
  
  belongs_to :link_section
  
  validates_presence_of :title
  validate :presence_of_linked
  
  default_scope :order => "position"  
  
  protected
  def presence_of_linked
    self.errors.add :linked, :empty if self.linked.blank? || self.linked.marked_for_destruction?
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
skylinecms-3.2.0 app/models/skyline/link_section_link.rb
skylinecms-3.1.0 app/models/skyline/link_section_link.rb
westarete-skylinecms-3.0.8.20100329 app/models/skyline/link_section_link.rb
westarete-skylinecms-3.0.8.20100330 app/models/skyline/link_section_link.rb