diff --git a/app/models/photo.rb b/app/models/photo.rb index 26fa3ea..118057f 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -15,8 +15,8 @@ class Photo < ActiveRecord::Base title end - def image=(image_path) - @image = CloudinaryImage.create(image_path) + def image=(file_upload) + @image = CloudinaryImage.create(file_upload) self.image_cloudinary_id = @image.id end diff --git a/spec/factories/photos.rb b/spec/factories/photos.rb index fe60121..74d20c3 100644 --- a/spec/factories/photos.rb +++ b/spec/factories/photos.rb @@ -4,6 +4,5 @@ FactoryGirl.define do factory :photo do title 'A Photo' description 'A lovely photo of a tree' - image nil end end diff --git a/spec/models/photo_spec.rb b/spec/models/photo_spec.rb index b0d0128..5c6877e 100644 --- a/spec/models/photo_spec.rb +++ b/spec/models/photo_spec.rb @@ -3,8 +3,6 @@ require 'spec_helper' describe Photo do it { should have_and_belong_to_many(:categories) } - it { should validate_presence_of(:image) } - let(:photo) { create(:photo) } it 'logs a view' do