Created
July 12, 2013 02:25
-
-
Save walter/5980966 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # for now, only run if we have a clean slate | |
| def self.load_from_apis_for_jurisdiction(abbreviation) | |
| return if self.in(abbreviation).count > 0 | |
| api_parse(results_for_jurisdiction(abbreviation)).map do |attributes| | |
| create_from_apis attributes | |
| end | |
| end | |
| def self.create_from_apis(attributes, options = {}) | |
| person = build_from_api(attributes) | |
| person.save! | |
| PersonDetailRetriever.new(person, options).retrieve! | |
| person | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment