Sha256: 4f7d65b10a056aa519f8414cbf41b74747b24df38035f4c1cdd1ddf5b4c53edf

Contents?: true

Size: 229 Bytes

Versions: 54

Compression:

Stored size: 229 Bytes

Contents

class Avatar < ApplicationRecord
  has_many :users, as: :avatar

  include WithTargetAudience

  def self.sample_for(user)
    with_current_audience_for(user).sample
  end

  def self.sample
    order('RANDOM()').first
  end
end

Version data entries

54 entries across 54 versions & 2 rubygems

Version Path
mumuki-domain-9.23.0 app/models/avatar.rb
mumuki-domain-9.22.1 app/models/avatar.rb
mumuki-domain-9.22.0 app/models/avatar.rb
mumuki-domain-9.21.0 app/models/avatar.rb
mumuki-domain-9.20.0 app/models/avatar.rb
mumuki-domain-9.19.0 app/models/avatar.rb
mumuki-domain-9.18.0 app/models/avatar.rb
mumuki-domain-9.17.0 app/models/avatar.rb
mumuki-domain-9.16.0 app/models/avatar.rb
mumuki-domain-9.15.0 app/models/avatar.rb
mumuki-domain-9.14.1 app/models/avatar.rb
mumuki-domain-9.14.0 app/models/avatar.rb
mumuki-domain-9.13.1 app/models/avatar.rb
mumuki-domain-9.13.0 app/models/avatar.rb
mumuki-domain-9.12.0 app/models/avatar.rb
mumuki-domain-9.11.0 app/models/avatar.rb
mumuki-domain-9.10.0 app/models/avatar.rb
mumuki-domain-9.9.0 app/models/avatar.rb
mumuki-domain-9.8.1 app/models/avatar.rb
mumuki-domain-9.8.0 app/models/avatar.rb