Sha256: c944b49a90ce24d4429925380b1fcb44cd19c7b2be0bbcda144ec9494c2b5670

Contents?: true

Size: 648 Bytes

Versions: 27

Compression:

Stored size: 648 Bytes

Contents

class MenuItem < ActiveRecord::Base
  belongs_to :menu
  belongs_to :menuable, :polymorphic => true
  acts_as_list
  default_scope order("position asc")
  include Soapbox::MenuItem if File.exists? "app/models/soapbox/menu_item.rb"
  
  def label_text   
    link_label = self.label rescue nil
    link_label = nil if link_label == ""
    link_label = self.menuable.title rescue nil if link_label.nil?
    link_label = self.menuable.nav_label rescue nil if link_label.nil?
    link_label = self.menuable.name rescue nil if link_label.nil?
    link_label = self.menuable_type.titleize.pluralize rescue nil if link_label.nil?
    link_label
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
soapbox-0.3.1 app/models/menu_item.rb
soapbox-0.3.0 app/models/menu_item.rb
soapbox-0.2.24 app/models/menu_item.rb
soapbox-0.2.23 app/models/menu_item.rb
soapbox-0.2.21 app/models/menu_item.rb
soapbox-0.2.20 app/models/menu_item.rb
soapbox-0.2.18 app/models/menu_item.rb
soapbox-0.2.16 app/models/menu_item.rb
soapbox-0.2.15 app/models/menu_item.rb
soapbox-0.2.14 app/models/menu_item.rb
soapbox-0.2.12 app/models/menu_item.rb
soapbox-0.2.11 app/models/menu_item.rb
soapbox-0.2.10 app/models/menu_item.rb
soapbox-0.2.9 app/models/menu_item.rb
soapbox-0.2.8 app/models/menu_item.rb
soapbox-0.2.7 app/models/menu_item.rb
soapbox-0.2.6 app/models/menu_item.rb
soapbox-0.2.5 app/models/menu_item.rb
soapbox-0.2.4 app/models/menu_item.rb
soapbox-0.2.3 app/models/menu_item.rb