class Item
include Mongoid::Document
field :name, type: String
field :description, type: String
embeds_many :photos, cascade_callbacks: true
accepts_nested_attributes_for :photos
end
class Photo
include Mongoid::Document
include Mongoid::Paperclip
embedded_in :items, :inverse_of => :photos
has_mongoid_attached_file :attachment,
:storage => :s3,
:bucket => APP_CONFIG[:amazon_s3_photos_bucket],
:styles => {
:original => ['1920x1680>', :jpg],
:small => ['100x100#', :jpg],
:medium => ['250x250', :jpg],
:large => ['500x500>', :jpg]
},
:convert_options => { :all => '-background white -flatten +matte' }
end
I'm seeing undefined method `first' for #ActionDispatch::Http::UploadedFile:0x00000109915b68 error when I try to save the Item..
class Item
include Mongoid::Document
field :name, type: String
field :description, type: String
embeds_many :photos, cascade_callbacks: true
accepts_nested_attributes_for :photos
end
class Photo
include Mongoid::Document
include Mongoid::Paperclip
embedded_in :items, :inverse_of => :photos
has_mongoid_attached_file :attachment,
:storage => :s3,
:bucket => APP_CONFIG[:amazon_s3_photos_bucket],
:styles => {
:original => ['1920x1680>', :jpg],
:small => ['100x100#', :jpg],
:medium => ['250x250', :jpg],
:large => ['500x500>', :jpg]
},
:convert_options => { :all => '-background white -flatten +matte' }
end
I'm seeing undefined method `first' for #ActionDispatch::Http::UploadedFile:0x00000109915b68 error when I try to save the Item..