Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module CustomerQueries
- extend ActiveSupport::Concern
- included do
- establish_connection(
- :adapter => 'sqlserver',
- :host => ENV["OMNI_HOST"],
- :username => ENV["OMNI_UNAME"],
- :password => ENV["OMNI_PW"],
- :database => ENV["OMNI_DB"]
- )
- end
- table_name = ENV["TABLE_NAME"]
- module ClassMethods
- def lookup_phone(phone_number)
- find_by_sql [ENV["lookup_phone_query"], phone_number]
- end
- def lookup_account_code(account_code)
- find_by_sql [ENV["lookup_account_code_query"], account_code]
- end
- def lookup_account_id(account_id)
- find_by_sql [ENV["lookup_account_id_query"], account_id]
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement