lib/tasks/db_upsert_businesses.rake
# Create or update a record.
Create or update a record.
Create or update a record .
def upsert_business_record(yelp_business)
  params = build_params(yelp_business)
  business = Business.find_or_initialize_by(yelp_uid: yelp_business[:id])
  business.update_attributes(params)
end
def upsert_business_record ( yelp_business ) params = build_params ( yelp_business ) business = Business . find_or_initialize_by ( yelp_uid : yelp_business [ :id ] ) business . update_attributes ( params ) end
Create or update a record.
Create or update a record .
yelp_business