Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Documentation fix: Change the example for habtm association to use proc according to changelog #5650

Merged
merged 1 commit into from

4 participants

@sekrett

The updated example works

@rafaelfranca

@sekrett you can push it directly to https://github.com/lifo/docrails

@vijaydev vijaydev merged commit b24f1ce into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  activerecord/lib/active_record/associations.rb
View
2  activerecord/lib/active_record/associations.rb
@@ -1596,7 +1596,7 @@ def belongs_to(name, options = {})
# has_and_belongs_to_many :categories, :join_table => "prods_cats"
# has_and_belongs_to_many :categories, :readonly => true
# has_and_belongs_to_many :active_projects, :join_table => 'developers_projects', :delete_sql =>
- # "DELETE FROM developers_projects WHERE active=1 AND developer_id = #{id} AND project_id = #{record.id}"
+ # proc { |record| "DELETE FROM developers_projects WHERE active=1 AND developer_id = #{id} AND project_id = #{record.id}" }
def has_and_belongs_to_many(name, options = {}, &extension)
Builder::HasAndBelongsToMany.build(self, name, options, &extension)
end
Something went wrong with that request. Please try again.