Skip to content
This repository
Browse code

Change the example for habtm association to use proc according to cha…

…ngelog
  • Loading branch information...
commit 0f2555f0af279c925280e051db3a3c29359c3d2a 1 parent e51322a
Alexander Zubkov authored March 29, 2012
2  activerecord/lib/active_record/associations.rb
@@ -1596,7 +1596,7 @@ def belongs_to(name, options = {})
1596 1596
       #   has_and_belongs_to_many :categories, :join_table => "prods_cats"
1597 1597
       #   has_and_belongs_to_many :categories, :readonly => true
1598 1598
       #   has_and_belongs_to_many :active_projects, :join_table => 'developers_projects', :delete_sql =>
1599  
-      #   "DELETE FROM developers_projects WHERE active=1 AND developer_id = #{id} AND project_id = #{record.id}"
  1599
+      #   proc { |record| "DELETE FROM developers_projects WHERE active=1 AND developer_id = #{id} AND project_id = #{record.id}" }
1600 1600
       def has_and_belongs_to_many(name, options = {}, &extension)
1601 1601
         Builder::HasAndBelongsToMany.build(self, name, options, &extension)
1602 1602
       end

0 notes on commit 0f2555f

Please sign in to comment.
Something went wrong with that request. Please try again.