cs_app/app/models/portlet.rb
Nicolas Bally 8a08ee35c8 initial
2015-02-22 14:36:30 +01:00

40 lines
475 B
Ruby

# -*- encoding : utf-8 -*-
class Portlet < ActiveRecord::Base
belongs_to :block
belongs_to :content, :polymorphic => true
accepts_nested_attributes_for :content
attr_accessor :skip_before_update
def dup
@portlet = Portlet.new(self.attributes)
@portlet.id = nil
@portlet.content = self.content.dup
@portlet.save
@portlet
end
before_create do
end
before_update do
end
before_destroy do
end
end