simonlehmann / Group3-Real-Estate-Site

Real Estate trading site - Diploma in Programming, Semester 1, 2016 @ North Metropolitan TAFE
http://group3.centralapp.com.au
Other
3 stars 1 forks source link

(Issue) Devise Registration#Create isn't saving image for user on Prod #276

Closed ulternate closed 8 years ago

ulternate commented 8 years ago

In development the code in Registration#Create would grab a random user icon from the /public/usericons/ folder and then add it to the user object.

This functionality doesn't work anymore in Prod. When a user is created they get given the usericon_#{colour}.png file but Paperclip doesn't save it in the assets directory for the user.

This doesn't break the site, or stop a user signing up. But it will mean they won't have an initial image until they upload their own image.

If I have time this week/early next, I will add some logging to the function and monitor it on the production server.

NB. I've assigned @slehmann36, @jayden2 and myself to this in case they want to have a crack at this beforehand.

In summary, when the user signs up, our Registration#Create method overrides the Devise one, but the only difference is some code I added to randomly pick an image from the usericons folder and upload that using Paperclip. It was working in Dev.

Cheers,

Dan

ulternate commented 8 years ago

It is created, but only the original size, not the thumbnail size. Ken and I worked on this for a while and couldn't find a fix.

Any custom uploaded images work find, but not the one auto generated when signing up.

Marking won't fix, although #295 is a hacky change that at least removes the error on the settings pages by using :original rather than :thumb