blog_perso_app/app/models/link_content.rb
Nicolas Bally 56a0aa9848 initial
2012-06-17 21:11:12 +02:00

35 lines
455 B
Ruby

# -*- encoding : utf-8 -*-
class LinkContent < ActiveRecord::Base
belongs_to :item
belongs_to :cible, :polymorphic => true
accepts_nested_attributes_for :cible
def url
if self.cible
cible.url
else
""
end
end
has_one :portlet, :as => :content, :dependent => :destroy
validates :name, :presence => true
def url
if self.cible
cible.url
else
""
end
end
STYLES = [["Style 1",1], ["Style 2",2]]
end