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