diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-09-17 21:19:44 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-09-17 21:19:44 +0000 |
commit | 81d619ea0d7e936bdf5a643c8731e4b3f3746b8e (patch) | |
tree | 34aef34ef446db68d9122cde405c7e75bf771101 /activerecord/test/fixtures | |
parent | 6b1901da8f2db638884d3e51f84d4392775e7667 (diff) | |
download | rails-81d619ea0d7e936bdf5a643c8731e4b3f3746b8e.tar.gz rails-81d619ea0d7e936bdf5a643c8731e4b3f3746b8e.tar.bz2 rails-81d619ea0d7e936bdf5a643c8731e4b3f3746b8e.zip |
Associations macros accept extension blocks alongside modules. Closes #9346.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7504 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/fixtures')
-rw-r--r-- | activerecord/test/fixtures/developer.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/fixtures/developer.rb b/activerecord/test/fixtures/developer.rb index 75fb307b19..c868cddecd 100644 --- a/activerecord/test/fixtures/developer.rb +++ b/activerecord/test/fixtures/developer.rb @@ -29,6 +29,16 @@ class Developer < ActiveRecord::Base :association_foreign_key => "project_id", :extend => [DeveloperProjectsAssociationExtension, DeveloperProjectsAssociationExtension2] + has_and_belongs_to_many :projects_extended_by_name_and_block, + :class_name => "Project", + :join_table => "developers_projects", + :association_foreign_key => "project_id", + :extend => DeveloperProjectsAssociationExtension do + def find_least_recent + find(:first, :order => "id ASC") + end + end + has_and_belongs_to_many :special_projects, :join_table => 'developers_projects', :association_foreign_key => 'project_id' validates_inclusion_of :salary, :in => 50000..200000 |