Sha256: 7733fe6056f90757fbf16bd969cd896d5cf7f3cc0aeab263dbd3b583612f07e6

Contents?: true

Size: 1.38 KB

Versions: 4

Compression:

Stored size: 1.38 KB

Contents

# == Schema Information
#
# Table name: assets
#
#  id                :integer(4)      not null, primary key
#  data_file_name    :string(255)     not null
#  data_content_type :string(255)
#  data_file_size    :integer(4)
#  assetable_id      :integer(4)      not null
#  assetable_type    :string(25)      not null
#  type              :string(25)
#  guid              :string(10)
#  locale            :integer(1)      default(0)
#  user_id           :integer(4)
#  created_at        :datetime
#  updated_at        :datetime
#  duration          :float           default(0.0)
#  resolution_id     :integer(1)      default(0)
#
# Indexes
#
#  index_assets_on_assetable_type_and_type_and_assetable_id  (assetable_type,type,assetable_id)
#  index_assets_on_assetable_type_and_assetable_id           (assetable_type,assetable_id)
#  index_assets_on_user_id                                   (user_id)
#

class Avatar < Asset
	has_attached_file :data,
	                  :url  => "/assets/avatars/:id/:style_:basename.:extension",
                    :path => ":rails_root/public/assets/avatars/:id/:style_:basename.:extension",
                    :convert_options => { :all => "-strip" },
	                  :styles => { :thumb => "50x50#", :small => "32x32#" }
	
	validates_attachment_size :data, :less_than => 1.megabyte
	validates_attachment_content_type :data, :content_type => Sunrise::Utils::IMAGE_TYPES
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sunrise-core-0.1.3 lib/generators/sunrise/templates/models/defaults/avatar.rb
sunrise-core-0.1.2 lib/generators/sunrise/templates/models/defaults/avatar.rb
sunrise-core-0.1.1 lib/generators/sunrise/templates/models/defaults/avatar.rb
sunrise-core-0.1.0 lib/generators/sunrise/templates/models/defaults/avatar.rb