Skip to content

Instantly share code, notes, and snippets.

@hamannp
Created December 28, 2011 20:44
Show Gist options
  • Save hamannp/1529642 to your computer and use it in GitHub Desktop.
Save hamannp/1529642 to your computer and use it in GitHub Desktop.
scraper.rb
def self.existing_claim_with_same_insurance_provider_claim_id_and_insurance_provider insurance_provider_claim_id,insurance_provider
claims = Claim.where( :insurance_provider_claim_id => insurance_provider_claim_id.to_s ).entries
if claims.present?
claims.each do |claim|
return claim if claim.insurance_provider === insurance_provider
end
end
false
end
def self.merge_columns_with_attrs attrs, claim
CLAIM_COLUMNS_TO_MERGE.each do |col|
attrs[col] = attrs[col].to_f + claim[col].to_f if attrs[col]
end
attrs
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment