Sha256: b9c8d2d9dd36a78e045a4157ec2d4bec104943351a65ab506c9c828a69f9afd2

Contents?: true

Size: 1.35 KB

Versions: 32

Compression:

Stored size: 1.35 KB

Contents

module Toolhound

  # Class to parse GitHub repository owner and name from
  # URLs and to generate URLs
  class Vendor < 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%'"
      {
        vendor: [:int_vendor_id, {var_vendor_id: :vendor_no}, :dte_created_date, :dte_modified_date, :bol_active, :int_payment_term_id, :int_state_id, :int_country_id],
        vendor_text: [:var_organization, :var_address, :var_city, :var_state, :var_postal_code, :var_contact, :var_title, :var_email, :var_telephone, :var_home_phone]
      }
    end

    def default_joins
      arr = []
      arr << "INNER JOIN tblVendorText ON (tblVendorText.intvendorID = tblVendor.intvendorID) AND varLocaleID = '#{locale}'"
      # arr << "INNER JOIN tblLocationText ON (tblLocationText.intLocationID = tblLocation.intLocationID)"

      arr
    end

    def find_by_entity_id(id)
      all(limit: 1, where: [{int_entity_id: id}]).first
    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/vendor.rb
toolhound-ruby-1.0.16 lib/toolhound-ruby/vendor.rb
toolhound-ruby-1.0.15 lib/toolhound-ruby/vendor.rb
toolhound-ruby-1.0.14 lib/toolhound-ruby/vendor.rb
toolhound-ruby-1.0.13 lib/toolhound-ruby/vendor.rb
toolhound-ruby-1.0.12 lib/toolhound-ruby/vendor.rb
toolhound-ruby-1.0.11 lib/toolhound-ruby/vendor.rb
toolhound-ruby-1.0.10 lib/toolhound-ruby/vendor.rb
toolhound-ruby-1.0.9 lib/toolhound-ruby/vendor.rb
toolhound-ruby-1.0.8 lib/toolhound-ruby/vendor.rb
toolhound-ruby-1.0.7 lib/toolhound-ruby/vendor.rb
toolhound-ruby-1.0.6 lib/toolhound-ruby/vendor.rb