Sha256: e34432e94249736bbba80273185ee8a74e7749f64e3ff827564714637fac639a

Contents?: true

Size: 245 Bytes

Versions: 16

Compression:

Stored size: 245 Bytes

Contents

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

16 entries across 16 versions & 1 rubygems

Version Path
ibm_db-5.2.0 test/models/customer_carrier.rb
ibm_db-5.1.0 test/models/customer_carrier.rb
ibm_db-5.0.5 test/models/customer_carrier.rb
ibm_db-5.0.4 test/models/customer_carrier.rb
ibm_db-5.0.3 test/models/customer_carrier.rb
ibm_db-5.0.2 test/models/customer_carrier.rb
ibm_db-4.0.0-x86-mingw32 test/models/customer_carrier.rb
ibm_db-4.0.0 test/models/customer_carrier.rb
ibm_db-3.0.4-x86-mingw32 test/models/customer_carrier.rb
ibm_db-3.0.4 test/models/customer_carrier.rb
ibm_db-3.0.3-x86-mingw32 test/models/customer_carrier.rb
ibm_db-3.0.3 test/models/customer_carrier.rb
ibm_db-3.0.2-x86-mingw32 test/models/customer_carrier.rb
ibm_db-3.0.2 test/models/customer_carrier.rb
ibm_db-3.0.1 test/models/customer_carrier.rb
ibm_db-3.0.1-x86-mingw32 test/models/customer_carrier.rb