Sha256: f490a8757da33581d144cb6dd0dd1f5fb92028e078cd17ecdeef6195c1e3f803

Contents?: true

Size: 353 Bytes

Versions: 8

Compression:

Stored size: 353 Bytes

Contents

class Kindeditor::Asset < ActiveRecord::Base
  self.table_name = 'kindeditor_assets'
  mount_uploader :asset, 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

8 entries across 8 versions & 1 rubygems

Version Path
rails_kindeditor-0.3.16 lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/asset.rb
rails_kindeditor-0.3.15 lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/asset.rb
rails_kindeditor-0.3.14 lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/asset.rb
rails_kindeditor-0.3.13 lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/asset.rb
rails_kindeditor-0.3.12 lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/asset.rb
rails_kindeditor-0.3.11 lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/asset.rb
rails_kindeditor-0.3.10 lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/asset.rb
rails_kindeditor-0.3.9 lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/asset.rb