Skip to content

Instantly share code, notes, and snippets.

@oslego
Created January 4, 2012 16:05
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 oslego/1560701 to your computer and use it in GitHub Desktop.
Save oslego/1560701 to your computer and use it in GitHub Desktop.
Related Lists
class List < ActiveRecord::Base
has_many :related_lists, :finder_sql => 'SELECT * FROM related_lists WHERE list_a_id = #{id} OR list_b_id = #{id}'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment