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.7.0 app/models/avatar.rb
mumuki-domain-9.6.0 app/models/avatar.rb
mumuki-domain-9.5.0 app/models/avatar.rb
mumuki-domain-9.4.0 app/models/avatar.rb
mumuki-domain-9.3.0 app/models/avatar.rb
mumuki-domain-9.2.1 app/models/avatar.rb
mumuki-domain-9.2.0 app/models/avatar.rb
mumuki-domain-9.1.2 app/models/avatar.rb
mumuki-domain-9.1.1 app/models/avatar.rb
mumuki-domain-9.1.0 app/models/avatar.rb
mumuki-domain-9.0.6 app/models/avatar.rb
mumuki-domain-9.0.5 app/models/avatar.rb
mumuki-domain-9.0.4 app/models/avatar.rb
mumuki-domain-9.0.3 app/models/avatar.rb
mumuki-domain-9.0.2 app/models/avatar.rb
mumuki-domain-9.0.0 app/models/avatar.rb
mumuki-domain-8.6.1 app/models/avatar.rb
mumuki-domain-8.6.0 app/models/avatar.rb
mumuki-domain-8.5.0 app/models/avatar.rb
mumuki-domain-8.4.0 app/models/avatar.rb