Sha256: 0bede5badb8be7572ca40afd2a6abd645fdae1c58a531c26359b1857ca8bd881

Contents?: true

Size: 292 Bytes

Versions: 4

Compression:

Stored size: 292 Bytes

Contents

# frozen_string_literal: true

class CustomerCarrier < ActiveRecord::Base
  cattr_accessor :current_customer

  belongs_to :customer
  belongs_to :carrier

  default_scope -> {
    if current_customer
      where(customer: current_customer)
    else
      all
    end
  }
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ibm_db-5.5.0-x86-mingw32 test/models/customer_carrier.rb
ibm_db-5.4.1-x86-mingw32 test/models/customer_carrier.rb
ibm_db-5.4.0-x86-mingw32 test/models/customer_carrier.rb
ibm_db-5.3.2-x86-mingw32 test/models/customer_carrier.rb