Sha256: ffd54a4a8b31628c2efe547294b57ded27d0b6464a110449d36416f95ec4578d

Contents?: true

Size: 1.09 KB

Versions: 24

Compression:

Stored size: 1.09 KB

Contents

class Ish::ImageAsset
  require 'aws-sdk'

  include Mongoid::Document
  include Mongoid::Timestamps
  include Mongoid::Paperclip

  belongs_to :location,           class_name: 'Gameui::Map', inverse_of: :image,       optional: true
  belongs_to :marker_image,       class_name: 'Gameui::Map', inverse_of: :image,       optional: true
  belongs_to :marker_title_image, class_name: 'Gameui::Map', inverse_of: :title_image, optional: true

  has_mongoid_attached_file :image,
                            :styles => {
                              :thumb  => "100x100#",
                            },
                            :storage => :s3,
                            :s3_credentials => ::S3_CREDENTIALS,
                            :path => "image_assets/:style/:id/:filename",
                            :s3_protocol => 'https',
                            :validate_media_type => false,
                            s3_region: ::S3_CREDENTIALS[:region]

  validates_attachment_content_type :image, :content_type => ["image/jpg", "image/jpeg", "image/png", "image/gif", 'application/octet-stream' ]

end


Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
ish_models-0.0.33.157 lib/ish/image_asset.rb
ish_models-0.0.33.156 lib/ish/image_asset.rb
ish_models-0.0.33.154 lib/ish/image_asset.rb
ish_models-0.0.33.153 lib/ish/image_asset.rb
ish_models-0.0.33.152 lib/ish/image_asset.rb
ish_models-0.0.33.151 lib/ish/image_asset.rb
ish_models-0.0.33.150 lib/ish/image_asset.rb
ish_models-0.0.33.149 lib/ish/image_asset.rb
ish_models-0.0.33.148 lib/ish/image_asset.rb
ish_models-0.0.33.147 lib/ish/image_asset.rb
ish_models-0.0.33.146 lib/ish/image_asset.rb
ish_models-0.0.33.145 lib/ish/image_asset.rb
ish_models-0.0.33.144 lib/ish/image_asset.rb
ish_models-0.0.33.143 lib/ish/image_asset.rb
ish_models-0.0.33.142 lib/ish/image_asset.rb
ish_models-0.0.33.141 lib/ish/image_asset.rb
ish_models-0.0.33.140 lib/ish/image_asset.rb
ish_models-0.0.33.139 lib/ish/image_asset.rb
ish_models-0.0.33.138 lib/ish/image_asset.rb
ish_models-0.0.33.137 lib/ish/image_asset.rb