Sha256: 986937ca52b986eace321a6f3373823fbf4646e27626d24a85a650b8a87b6db2

Contents?: true

Size: 255 Bytes

Versions: 62

Compression:

Stored size: 255 Bytes

Contents

module WithTargetAudience
  extend ActiveSupport::Concern

  included do
    enum target_audience: [:grown_ups, :kids]
  end

  class_methods do
    def with_current_audience_for(user)
      where(target_audience: user.current_audience)
    end
  end
end

Version data entries

62 entries across 62 versions & 2 rubygems

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