Created
December 28, 2011 20:44
-
-
Save hamannp/1529642 to your computer and use it in GitHub Desktop.
scraper.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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