20 lines
360 B
Ruby
20 lines
360 B
Ruby
# -*- encoding : utf-8 -*-
|
|
class CibleAlias < ActiveRecord::Base
|
|
include Rails.application.routes.url_helpers
|
|
belongs_to :menu_item
|
|
|
|
|
|
validates :menu_item_id, :presence => true
|
|
#has_one :link_content, :as => :cible
|
|
has_one :cibleable, :as => :cible
|
|
|
|
|
|
def url
|
|
if self.menu_item
|
|
menu_item_path(:url => self.menu_item.permalink)
|
|
end
|
|
|
|
end
|
|
|
|
end
|