Sha256: 07ef971e421484362f0bc1c6cb5e02e183a0e27949abff9f5c66caadbd9cbe2e

Contents?: true

Size: 512 Bytes

Versions: 32

Compression:

Stored size: 512 Bytes

Contents

class Segment < ActiveRecord::Base
  attr_accessible :organization, :search, :search_id, :name

  belongs_to :organization
  belongs_to :search

  default_scope { order("created_at DESC") }

  validates_presence_of :organization_id
  validates_presence_of :search_id
  validates :name, :presence => true, :length => { :maximum => 128 }

  delegate :length, :to => :search
  delegate :description, :to => :search

  def people
    @people ||= search.people
  end

  def tag(tag)
    self.search.tag(tag)
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
artfully_ose-1.2.0.pre.11 app/models/segment.rb
artfully_ose-1.2.0.pre.10 app/models/segment.rb
artfully_ose-1.2.0.pre.9 app/models/segment.rb
artfully_ose-1.2.0.pre.8 app/models/segment.rb
artfully_ose-1.2.0.pre.7 app/models/segment.rb
artfully_ose-1.2.0.pre.6 app/models/segment.rb
artfully_ose-1.2.0.pre.5 app/models/segment.rb
artfully_ose-1.2.0.pre.4 app/models/segment.rb
artfully_ose-1.2.0.pre.3 app/models/segment.rb
artfully_ose-1.2.0.pre.2 app/models/segment.rb
artfully_ose-1.2.0.pre.1 app/models/segment.rb
artfully_ose-1.2.0.pre app/models/segment.rb