Displaying 1 result from an estimated 1 matches for "aimag".
Did you mean:
imag
2014 Feb 18
0
How to Test Multimodel Paperclip attachments?
...attributes_for :uploads, allow_destroy: true
end
Upload.rb
class Upload < ActiveRecord::Base
belongs_to :car
has_attached_file :upload, styles: { medium: '300x300>', thumb:
'100x100>' }
validates_attachment_content_type :upload, content_type:
/\Aimage\/.*\Z/
validates_attachment_presence :upload
end
As you can see there is a has_many and belongs_to relationship between
the two.
car_spec.rb
require 'spec_helper'
describe Car do
before do
@car = Car.new(FactoryGirl.attributes_for(:car))
end...