aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/fixtures/developer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/fixtures/developer.rb')
-rw-r--r--activerecord/test/fixtures/developer.rb17
1 files changed, 14 insertions, 3 deletions
diff --git a/activerecord/test/fixtures/developer.rb b/activerecord/test/fixtures/developer.rb
index 336b48f087..ce65ff78c0 100644
--- a/activerecord/test/fixtures/developer.rb
+++ b/activerecord/test/fixtures/developer.rb
@@ -1,10 +1,21 @@
+module DeveloperProjectsAssociationExtension
+ def find_most_recent
+ find(:first, :order => "id DESC")
+ end
+end
+
class Developer < ActiveRecord::Base
- has_and_belongs_to_many :projects, :extend => Module.new {
+ has_and_belongs_to_many :projects do
def find_most_recent
find(:first, :order => "id DESC")
end
- }
-
+ end
+
+ has_and_belongs_to_many :projects_extended_by_name,
+ :class_name => "Project",
+ :join_table => "developers_projects",
+ :association_foreign_key => "project_id",
+ :extend => DeveloperProjectsAssociationExtension
has_and_belongs_to_many :special_projects, :join_table => 'developers_projects', :association_foreign_key => 'project_id'