Skip to content

Instantly share code, notes, and snippets.

@repertoire
Created January 18, 2011 21:25
Show Gist options
  • Save repertoire/785181 to your computer and use it in GitHub Desktop.
Save repertoire/785181 to your computer and use it in GitHub Desktop.
class Video < ActiveRecord::Base
has_many :video_locations
has_many :locations, :through => :video_locations
accepts_nested_attributes_for :locations
def locations_attributes=(attributes)
logger.debug "IS THIS EVEN GETTING CALLED!?!??!? Attributes: #{attributes.inspect}"
attributes.each do |attr|
locations.new(:lat => attr.lat, :lng => attr.lng)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment