Created
November 19, 2012 18:03
-
-
Save theinventor/4112372 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
if ad_records.count == 1 | |
ad_record = ad_records.first | |
ad = Ad.new( | |
:tagline => ad_record['tag_line'], | |
:service => service, | |
:image_url => ad_record['image_external_url'], | |
:citygrid_ad_id => ad_record['ad_id'] | |
) | |
ad.image = Image.new(:name => ad_record['image_external_url'], :role => "AD_IMAGE", :url => ad_record['image_external_url'], :format => ad_record['image_external_url'].to_s.split('.').last ) | |
#ad.geographies << self.get_geographies_by_service(service) | |
geo_ids = self.get_geographies_by_service(service).map &:id | |
#FIXME - need the importer to use the new AdGeography methods to create the join table rows | |
AdGeography.update_service_areas(geo_ids,ad) | |
ad.categories << self.get_categories_by_service(service) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment