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.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/fixtures/developer.rb b/activerecord/test/fixtures/developer.rb
index 29555d926a..75fb307b19 100644
--- a/activerecord/test/fixtures/developer.rb
+++ b/activerecord/test/fixtures/developer.rb
@@ -4,6 +4,12 @@ module DeveloperProjectsAssociationExtension
end
end
+module DeveloperProjectsAssociationExtension2
+ def find_least_recent
+ find(:first, :order => "id ASC")
+ end
+end
+
class Developer < ActiveRecord::Base
has_and_belongs_to_many :projects do
def find_most_recent
@@ -17,6 +23,12 @@ class Developer < ActiveRecord::Base
:association_foreign_key => "project_id",
:extend => DeveloperProjectsAssociationExtension
+ has_and_belongs_to_many :projects_extended_by_name_twice,
+ :class_name => "Project",
+ :join_table => "developers_projects",
+ :association_foreign_key => "project_id",
+ :extend => [DeveloperProjectsAssociationExtension, DeveloperProjectsAssociationExtension2]
+
has_and_belongs_to_many :special_projects, :join_table => 'developers_projects', :association_foreign_key => 'project_id'
validates_inclusion_of :salary, :in => 50000..200000