Skip to content

Instantly share code, notes, and snippets.

@masterkain
Created September 9, 2008 22:00
Show Gist options
  • Save masterkain/9777 to your computer and use it in GitHub Desktop.
Save masterkain/9777 to your computer and use it in GitHub Desktop.
has_many :documents, :through => :contributions, :select => "documents.*, join_table.rich_attribute" do
def push_with_attributes(document, rich_join_attrs)
Contribution.send(:with_scope, :create => rich_join_attrs) { self << document }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment