I'm trying to upload seed data for my Photoshoot model which consists of multiple for urls like so:
10.times {
urls = [
'http://lorempixel.com/400/400/',
'http://lorempixel.com/400/400/',
'http://lorempixel.com/400/400/',
'http://lorempixel.com/400/400/',
'http://lorempixel.com/400/400/',
'http://lorempixel.com/400/400/',
'http://lorempixel.com/400/400/',
'http://lorempixel.com/400/400/'
]
time = Faker::Time.between(DateTime.now - 1, DateTime.now + 3)
photoshoot = Photoshoot.new( user_id: Faker::Number.between(1, 19), photograph_id: Faker::Number.between(1, 19), start_time: time, end_time: time + Faker::Number.between(1, 2).hours, message: Faker::TheFreshPrinceOfBelAir.quote )
photoshoot.save!
photoshoot.photo_urls = urls
}
But I'm getting the following error message in my seed:
NoMethodError: undefined method `photos_urls=' for
My model is the following :
class Photoshoot < ApplicationRecord
has_attachment :photos, maximum: 20
belongs_to :photograph
belongs_to :user
end