Skip to content

Instantly share code, notes, and snippets.

@jagira
Created August 3, 2010 13:20
Show Gist options
  • Save jagira/506354 to your computer and use it in GitHub Desktop.
Save jagira/506354 to your computer and use it in GitHub Desktop.
module Associations
....
def has_many(association_id, options = {}, &extension)
reflection = create_has_many_reflection(association_id, options, &extension)
configure_dependency_for_has_many(reflection)
add_association_callbacks(reflection.name, reflection.options)
if options[:through]
collection_accessor_methods(reflection, HasManyThroughAssociation)
else
collection_accessor_methods(reflection, HasManyAssociation)
end
end
....
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment