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-8.3.1 app/models/avatar.rb
mumuki-domain-8.2.0 app/models/avatar.rb
mumuki-domain-8.1.3 app/models/avatar.rb
mumuki-domain-8.1.2 app/models/avatar.rb
mumuki-domain-8.1.1 app/models/avatar.rb
mumuki-domain-8.1.0 app/models/avatar.rb
mumuki-domain-8.0.0 app/models/avatar.rb
mumuki-domain-7.12.2 app/models/avatar.rb
mumuki-domain-7.12.1 app/models/avatar.rb
mumuki-domain-7.12.0 app/models/avatar.rb
mumuki-domain-7.11.1 app/models/avatar.rb
mumuki-laboratory-7.11.1 vendor/bundle/ruby/2.6.0/bundler/gems/mumuki-domain-c92f2a7212e2/app/models/avatar.rb
mumuki-laboratory-7.11.0 vendor/bundle/ruby/2.6.0/bundler/gems/mumuki-domain-2e15c3330133/app/models/avatar.rb
mumuki-domain-7.11.0 app/models/avatar.rb