Sha256: be11891ee6e4105608e9341c7310cf55bd54934bee83f3280ed008a810edf659

Contents?: true

Size: 1.32 KB

Versions: 5

Compression:

Stored size: 1.32 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
  has_attached_file :data,
                    :url  => "/assets/pictures/:id/:style_:basename.:extension",
                    :path => ":rails_root/public/assets/pictures/:id/:style_:basename.:extension",
                    :convert_options => { :all => "-strip" },
	                  :styles => { :content => '575>', :thumb => '80x80#' }
	
	validates_attachment_presence :data
	validates_attachment_size :data, :less_than => 2.megabytes
	validates_attachment_content_type :data, :content_type => Sunrise::Utils::IMAGE_TYPES
end

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
sunrise-widgets-0.1.1 spec/dummy/app/models/defaults/picture.rb
sunrise-widgets-0.1.0 spec/dummy/app/models/defaults/picture.rb
sunrise-questions-0.1.0 spec/dummy/app/models/defaults/picture.rb
sunrise-core-0.1.5 lib/generators/sunrise/templates/models/defaults/picture.rb
sunrise-core-0.1.4 lib/generators/sunrise/templates/models/defaults/picture.rb