Sha256: 9ea039aa513b87e282cbf576525506325188d7cd12240907e1b46d342baf2a6b

Contents?: true

Size: 1.01 KB

Versions: 5

Compression:

Stored size: 1.01 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
#
# 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 Picture < Asset		
  sunrise_uploader PictureUploader

	validates :data_content_type, :inclusion => {:in => Sunrise::Utils::IMAGE_TYPES }
	validates_integrity_of :data
	validates_filesize_of :data, :maximum => 2.megabytes.to_i
end

Version data entries

5 entries across 3 versions & 1 rubygems

Version Path
sunrise-core-0.2.2 lib/generators/sunrise/templates/models/defaults/picture.rb
sunrise-core-0.2.1 lib/generators/sunrise/templates/models/defaults/picture.rb
sunrise-core-0.2.1 spec/tmp/app/models/defaults/picture.rb
sunrise-core-0.2.0 lib/generators/sunrise/templates/models/defaults/picture.rb
sunrise-core-0.2.0 spec/tmp/app/models/defaults/picture.rb