Add image to product
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
class Product
|
||||
include SimplyStored::Couch
|
||||
include ActiveModel::SerializerSupport
|
||||
include Paperclip::Glue
|
||||
|
||||
property :name
|
||||
property :code
|
||||
@@ -26,6 +27,17 @@ class Product
|
||||
is_dirty
|
||||
end
|
||||
|
||||
property :image_file_name
|
||||
property :image_content_type
|
||||
property :image_file_size, :type => Fixnum
|
||||
property :image_updated_at, :type => Time
|
||||
has_attached_file :image,
|
||||
url: '/system/product/:id/images/:style.:extension',
|
||||
styles: {medium: '512x512>', thumb: '128x128>', large: '896x896>', small: '320x320>'},
|
||||
default_url: '/assets/user/blank-pixel.png'
|
||||
validates_attachment :image, content_type: {content_type: ["image/jpg", "image/jpeg", "image/png", "image/gif"]}
|
||||
|
||||
|
||||
private
|
||||
|
||||
def persist_product_category_ids
|
||||
|
||||
Reference in New Issue
Block a user