Sha256: 74f5acf8be8a5d71c27174c52695ecf46f52cb34d1a64ddfe25bed4560c676da

Contents?: true

Size: 1.25 KB

Versions: 32

Compression:

Stored size: 1.25 KB

Contents

module Toolhound

  # Class to parse GitHub repository owner and name from
  # URLs and to generate URLs
  class Rental < Base


    # self.table_name   = :rental
    # self.primary_key  = :int_rental_id

    def default_selects
      #{ }"SELECT tblEntity.intEntityID, tblEntity.varEntityID AS job_no, tblLocation.intLocationID, tblLocationText.varLocationName  FROM tblEntity INNER JOIN tblLocation ON tblLocation.intEntityID = tblEntity.intEntityID INNER JOIN tblLocationText ON tblLocationText.intLocationID = tblLocation.intLocationID WHERE varEntityID LIKE '%10526.00%'"
      {
        rental: [
          :int_rental_id, :var_rental_number, :int_from_location_id, :int_entity_id, :dte_required_date, :int_rate_sheet_id,
          :int_job_id, :dte_created_date, :dte_modified_date
        ],
        job_text: [{var_job: :contact_name}]
      }
    end

    def default_joins
      arr = []
      arr << "LEFT OUTER JOIN tblJobText ON (tblJobText.intJobID = tblRental.intJobID AND varLocaleID = '#{locale}')"
      # arr << "INNER JOIN tblLocationText ON (tblLocationText.intLocationID = tblLocation.intLocationID)"

      arr
    end

    def for_entity(id)
      all(where: [{int_entity_id: id}])
    end

    # rename_attributes intLocationID: 'location_id'

  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
toolhound-ruby-1.0.37 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.36 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.35 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.34 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.33 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.32 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.31 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.30 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.29 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.28 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.27 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.26 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.25 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.24 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.23 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.22 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.21 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.20 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.19 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.18 lib/toolhound-ruby/rental.rb