class Toolhound::Vendor

Class to parse GitHub repository owner and name from URLs and to generate URLs

Public Instance Methods

default_joins() click to toggle source
# File lib/toolhound-ruby/vendor.rb, line 19
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
default_selects() click to toggle source

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

# File lib/toolhound-ruby/vendor.rb, line 11
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
find_by_entity_id(id) click to toggle source
# File lib/toolhound-ruby/vendor.rb, line 27
def find_by_entity_id(id)
  all(limit: 1, where: [{int_entity_id: id}]).first
end