jimmynicol/image-resizer-rails

#ir_background should return nil if URL is nil

johnkchow opened this issue · 1 comments

Sometimes URLs are persisted as nil (i.e. users w/ blank avatars) and when passed into #ir_background, it'll generate a background-image: url() CSS, which causes the page to essentially reload the document again. If we simply return nil here, we avoid the accidental page reloading.

Good catch, fixed and pushed. All ruby methods now return a nil when no valid source is provided.