scope :active, -> { where(:status => %w[active confirmed]) }
scope :identifiable, -> { where(:data_public => true) }
- has_one_attached :avatar
+ has_one_attached :avatar, :service => Settings.avatar_storage
validates :display_name, :presence => true, :length => 3..255,
:exclusion => %w[new terms save confirm confirm-email go_public reset-password forgot-password suspended]
end
# Used in test suite, not something that we would normally need to do.
- event :deactivate do
- transitions :from => :active, :to => :pending
+ if Rails.env.test?
+ event :deactivate do
+ transitions :from => :active, :to => :pending
+ end
end
# To confirm an account is used to override the spam scoring