Skip to content

Instantly share code, notes, and snippets.

@dkubb
Created July 30, 2008 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dkubb/3311 to your computer and use it in GitHub Desktop.
Save dkubb/3311 to your computer and use it in GitHub Desktop.
@identity_map = Hash.new do |h,model|
resource = h[model.base_model]
# set the IM if the resource's model is an ancestor of model
h[model] = resource if resource.model >= model
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment