Sha256: 867156618febf5c1898af01ec56d5054a1d3272e3e7d2a82e4602ea17769b101

Contents?: true

Size: 311 Bytes

Versions: 6

Compression:

Stored size: 311 Bytes

Contents

class Kindeditor::Asset < ActiveRecord::Base
  set_table_name "kindeditor_assets"
  validates_presence_of :asset
  before_save :update_asset_attributes
  attr_accessible :asset
  
  private
  def update_asset_attributes
    self.file_size = asset.file.size
    self.file_type = asset.file.content_type
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails_kindeditor-0.3.5 lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/asset.rb
rails_kindeditor-0.3.4 lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/asset.rb
rails_kindeditor-0.3.3 lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/asset.rb
rails_kindeditor-0.3.2 lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/asset.rb
rails_kindeditor-0.3.1 lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/asset.rb
rails_kindeditor-0.3.0 lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/asset.rb