SO,
I have been working on this for a while, I posted a much larger question that didn’t get any replies, but I’ll ask a much simpler one here.
My question is, how else can I assign something without using self.attribute = in the following context:
def photo_from_url(url)
remote_photo = open(url)
def remote_photo.original_filename;base_uri.path.split('/').last; end
**self.photo = remote_photo**
self.save
end
I need to make photo_from_url a class method so I can call it from delayed_job however when I add self, it gives me “no method found photo=”.
Please help! Thanks in advance…
Option 1: you want to create new object each time you call this method:
Option 2: you want to update existing object, then you need to get object id you want to modify: