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.17 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.16 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.15 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.14 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.13 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.12 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.11 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.10 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.9 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.8 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.7 lib/toolhound-ruby/rental.rb
toolhound-ruby-1.0.6 lib/toolhound-ruby/rental.rb