Sha256: c69e114236f9e5f7ea9c6b9e500fb68aeb54b9ceba8632ff8e6aad07249f611a

Contents?: true

Size: 395 Bytes

Versions: 10

Compression:

Stored size: 395 Bytes

Contents

# -*- encoding : utf-8 -*-
class Kindeditor::Asset < ActiveRecord::Base
  self.table_name = 'kindeditor_assets'
  mount_uploader :asset, ::Kindeditor::AssetUploader
  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

10 entries across 10 versions & 1 rubygems

Version Path
loyal_core-0.0.11 app/models/kindeditor/asset.rb
loyal_core-0.0.10 app/models/kindeditor/asset.rb
loyal_core-0.0.8 app/models/kindeditor/asset.rb
loyal_core-0.0.7 app/models/kindeditor/asset.rb
loyal_core-0.0.6 app/models/kindeditor/asset.rb
loyal_core-0.0.5 app/models/kindeditor/asset.rb
loyal_core-0.0.4 app/models/kindeditor/asset.rb
loyal_core-0.0.3 app/models/kindeditor/asset.rb
loyal_core-0.0.2 app/models/kindeditor/asset.rb
loyal_core-0.0.1 app/models/kindeditor/asset.rb