Class: Toolhound::Vendor
Overview
Class to parse GitHub repository owner and name from URLs and to generate URLs
Constant Summary
Constants inherited from Base
Base::DATE_TIME_FORMAT, Base::DB_TYPE_REGEX
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #default_joins ⇒ Object
-
#default_selects ⇒ Object
self.table_name = :rental self.primary_key = :int_rental_id.
- #find_by_entity_id(id) ⇒ Object
Methods inherited from Base
#_build_joins, #_build_selects, #_build_where, #all, #build_and_query, #build_group, #build_joins, #build_selects, #build_sql, #build_update_attributes, #build_update_sql, #build_where, #default_wheres, #find, #formatted_table_and_column, #formatted_table_name, #formmatted_column_name, #get_operator, #initialize, #insert, #locale, #merge_options, #parse_time, primary_key, #primary_key, primary_key=, #procedure, #query, rename_attributes, renamed_attributes, #table_name, table_name, table_name=, #transform_attribute_key, #transform_attributes, #transform_procedure_key, #transform_procedure_value, #transform_procedure_variables, #update, #update_query
Methods included from Util
#acronym_regex, #acronyms, #camelize, #demodulize, #underscore
Constructor Details
This class inherits a constructor from Toolhound::Base
Instance Method Details
#default_joins ⇒ Object
19 20 21 22 23 24 25 |
# 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 ⇒ Object
self.table_name = :rental self.primary_key = :int_rental_id
11 12 13 14 15 16 17 |
# 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) ⇒ Object
27 28 29 |
# File 'lib/toolhound-ruby/vendor.rb', line 27 def find_by_entity_id(id) all(limit: 1, where: [{int_entity_id: id}]).first end |