hummingbird-me/hummingbird — pull request #125 by vevix (2014-07-02 01:44:57+00:00)
Title: Fix avatar syncing (I hope?)

This seems to be the issue related to forum avatars not getting updated.

```ruby
# https://github.com/jrgifford/delayed_paperclip/blob/master/lib/delayed_paperclip/attachment.rb#L94
# delayed_paperclip uses ActiveRecord::Relation#update_all which does not invoke
# ActiveRecord callbacks such as after_save, this patch changes the update method
# to use ActiveRecord::Relation#update, so avatar syncing is working as intended.
```

------

It seems the reason avatars have even been syncing is due to the following check

```ruby
avatar_changed = (not self.avatar_processing) and (self.avatar_processing_changed? or self.avatar_updated_at_changed?)
```

```ruby
2.1.2 :004 > avatar_changed = (not false) and (false or false); avatar_changed
=> true
```

So it has been evaluating `avatar_changed` to being true when someone updates something like their cover image, or other unrelated setting.

We get expected results with the change to `&&, ||`

```ruby
2.1.2 :005 > avatar_changed = (not false) && (false || false); avatar_changed
=> false
```

------

:+1: or :-1:, I'd like to add a test but i am really tired and will attempt it later on.