Sha256: ba2c8155a21800f2b8f208526751b240746f3085e1fb3191e3407144cad9f8c3

Contents?: true

Size: 361 Bytes

Versions: 22

Compression:

Stored size: 361 Bytes

Contents

module Spina
  class Navigation < ApplicationRecord
    has_many :navigation_items, dependent: :destroy
    has_many :pages, through: :navigation_items

    scope :sorted, -> { order(:position) }

    validates :name, :label, presence: true
    validates :name, uniqueness: true

    def cache_key
      super + "_" + Mobility.locale.to_s
    end
    
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
spina-2.12.0 app/models/spina/navigation.rb
spina-2.11.0 app/models/spina/navigation.rb
spina-2.10.0 app/models/spina/navigation.rb
spina-2.9.1 app/models/spina/navigation.rb
spina-2.9.0 app/models/spina/navigation.rb
spina-2.8.1 app/models/spina/navigation.rb
spina-2.8.0 app/models/spina/navigation.rb
spina-2.7.0 app/models/spina/navigation.rb
spina-2.6.2 app/models/spina/navigation.rb
spina-2.6.1 app/models/spina/navigation.rb
spina-2.6.0 app/models/spina/navigation.rb
spina-2.5.0 app/models/spina/navigation.rb
spina-2.4.0 app/models/spina/navigation.rb
spina-2.3.5 app/models/spina/navigation.rb
spina-2.3.4 app/models/spina/navigation.rb
spina-2.3.3 app/models/spina/navigation.rb
spina-2.3.2 app/models/spina/navigation.rb
spina-2.3.1 app/models/spina/navigation.rb
spina-2.3.0 app/models/spina/navigation.rb
spina-2.2.0 app/models/spina/navigation.rb