Sha256: 22cad95d83b8cf20329f4914fad2a592a038923db8a78d3060853e02183d030e

Contents?: true

Size: 454 Bytes

Versions: 3

Compression:

Stored size: 454 Bytes

Contents

require 'friendly_id'

module PlanB
  class Itinerary < ActiveRecord::Base
    extend FriendlyId
    attr_accessible :title, :start, :end, :preplanning, :summary, :published

    has_many :itinerary_templates, dependent: :destroy
    has_many :hiking_templates, through: :itinerary_templates, source: :template, source_type: 'PlanB::HikingTemplate'

    friendly_id :title, use: :slugged

    validates :title, presence: true, uniqueness: true
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
plan_b-0.0.2.pre1 app/models/plan_b/itinerary.rb
plan_b-0.0.1.pre1 app/models/plan_b/itinerary.rb
plan_b-0.0.1.pre app/models/plan_b/itinerary.rb