Sha256: ec29cef20fbd0dc6c8594848d418524c3ffedbda0849bf5b44b912d39f29f4c1

Contents?: true

Size: 259 Bytes

Versions: 8

Compression:

Stored size: 259 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

8 entries across 8 versions & 1 rubygems

Version Path
ibm_db-5.2.0-x86-mingw32 test/models/customer_carrier.rb
ibm_db-5.1.0-x86-mingw32 test/models/customer_carrier.rb
ibm_db-5.0.5-x86-mingw32 test/models/customer_carrier.rb
ibm_db-5.0.4-x86-mingw32 test/models/customer_carrier.rb
ibm_db-5.0.3-x86-mingw32 test/models/customer_carrier.rb
ibm_db-5.0.2-x86-mingw32 test/models/customer_carrier.rb
ibm_db-3.0.5-x86-mingw32 test/models/customer_carrier.rb
ibm_db-3.0.5 test/models/customer_carrier.rb