app/models/georgia/link.rb in georgia-0.7.8 vs app/models/georgia/link.rb in georgia-0.8.0

- old
+ new

@@ -3,15 +3,14 @@ include Concerns::Contentable belongs_to :menu, class_name: Georgia::Menu, touch: true - acts_as_list scope: :menu + # acts_as_list scope: :menu has_ancestry orphan_strategy: :adopt - attr_accessible :parent_id, :menu_id - scope :ordered, order('position ASC') + scope :ordered, -> { order('position ASC') } before_validation :ensure_forward_slash, on: :create def ensure_forward_slash self.contents.each do |content| @@ -20,8 +19,16 @@ end # returns only the last part of the url def slug @slug ||= text.match(/([\w-]*)$/)[0] + end + + def url + @url ||= self.text + end + + def self.policy_class + Georgia::NavigationPolicy end end end \ No newline at end of file