Sha256: 5f649a3e4a014b8f1f37e82b2c185ef9d42bcfea11d6271e628070ffd58c4e81

Contents?: true

Size: 521 Bytes

Versions: 15

Compression:

Stored size: 521 Bytes

Contents

class DesignHistory < ActiveRecord::Base
  
  belongs_to :user

  def self.record(object)
    dh = DesignHistory.new
    dh.system_id = object.system_id
    dh.model_id = object.id
    dh.model = object.class.name
    dh.body = object.body
    dh.header = object.header if object.has_attribute?(:header) 
    dh.footer = object.footer if object.has_attribute?(:footer) 
    dh.user_id = object.user_id
    dh.updated_at = Time.now
    dh.save
  end

  def source_object
    eval(self.model).find(self.model_id)
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
kit_cms-2.3.22 app/models/design_history.rb
kit_cms-2.3.20 app/models/design_history.rb
kit_cms-2.3.19 app/models/design_history.rb
kit_cms-2.3.18 app/models/design_history.rb
kit_cms-2.3.17 app/models/design_history.rb
kit_cms-2.3.16 app/models/design_history.rb
kit_cms-2.3.15 app/models/design_history.rb
kit_cms-2.3.14 app/models/design_history.rb
kit_cms-2.3.13 app/models/design_history.rb
kit_cms-2.3.11 app/models/design_history.rb
kit_cms-2.3.10 app/models/design_history.rb
kit_cms-2.3.9 app/models/design_history.rb
kit_cms-2.3.8 app/models/design_history.rb
kit_cms-2.3.7 app/models/design_history.rb
kit_cms-2.3.6 app/models/design_history.rb