Sha256: f4afbfff45c37fe0fd13b3bacff1023e503bc57f8b3db95ac16bd0a62465a619

Contents?: true

Size: 644 Bytes

Versions: 3

Compression:

Stored size: 644 Bytes

Contents

module PushType
  class Node < ActiveRecord::Base

    include PushType::Customizable
    include PushType::Nestable
    include PushType::Templatable
    include PushType::Unexposable
    include PushType::Publishable
    include PushType::Trashable

    belongs_to :creator, class_name: 'PushType::User'
    belongs_to :updater, class_name: 'PushType::User'

    acts_as_tree name_column: 'slug', order: 'sort_order'

    validates :title, presence: true
    validates :slug,  presence: true, uniqueness: { scope: :parent_id }

    def permalink
      @permalink ||= self_and_ancestors.map(&:slug).reverse.join('/')
    end    
    
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
push_type_core-0.2.1 app/models/push_type/node.rb
push_type_core-0.2.0 app/models/push_type/node.rb
push_type_core-0.2.0.beta2 app/models/push_type/node.rb