aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/fixtures
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-12-13 00:39:51 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-12-13 00:39:51 +0000
commite5d9ad3e2903597e708fcb3ad76f08b4a600d82d (patch)
treec677481cd60c2af38655fbcb5d6d71efd9cf126e /activerecord/test/fixtures
parentf7e39c4ec78e81c4336a1ef470f3ff0a2430fc7a (diff)
downloadrails-e5d9ad3e2903597e708fcb3ad76f08b4a600d82d.tar.gz
rails-e5d9ad3e2903597e708fcb3ad76f08b4a600d82d.tar.bz2
rails-e5d9ad3e2903597e708fcb3ad76f08b4a600d82d.zip
Added option inheritance for find calls on has_and_belongs_to_many and has_many assosociations [DHH] Added option to specify :group, :limit, :offset, and :select options from find on has_and_belongs_to_many and has_many assosociations [DHH]
Added form_remote_for (form_for meets form_remote_tag) [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3287 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/fixtures')
-rwxr-xr-xactiverecord/test/fixtures/company.rb1
-rw-r--r--activerecord/test/fixtures/project.rb1
2 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/test/fixtures/company.rb b/activerecord/test/fixtures/company.rb
index 6d33d4e1a8..d4a68900fe 100755
--- a/activerecord/test/fixtures/company.rb
+++ b/activerecord/test/fixtures/company.rb
@@ -14,6 +14,7 @@ class Firm < Company
has_many :clients_of_firm, :foreign_key => "client_of", :class_name => "Client", :order => "id"
has_many :dependent_clients_of_firm, :foreign_key => "client_of", :class_name => "Client", :order => "id", :dependent => true
has_many :exclusively_dependent_clients_of_firm, :foreign_key => "client_of", :class_name => "Client", :order => "id", :exclusively_dependent => true
+ has_many :limited_clients, :class_name => "Client", :order => "id", :limit => 1
has_many :clients_like_ms, :conditions => "name = 'Microsoft'", :class_name => "Client", :order => "id"
has_many :clients_using_sql, :class_name => "Client", :finder_sql => 'SELECT * FROM companies WHERE client_of = #{id}'
has_many :clients_using_counter_sql, :class_name => "Client",
diff --git a/activerecord/test/fixtures/project.rb b/activerecord/test/fixtures/project.rb
index f8519f1b8c..c1aa4145f9 100644
--- a/activerecord/test/fixtures/project.rb
+++ b/activerecord/test/fixtures/project.rb
@@ -1,5 +1,6 @@
class Project < ActiveRecord::Base
has_and_belongs_to_many :developers, :uniq => true
+ has_and_belongs_to_many :limited_developers, :class_name => "Developer", :limit => 1
has_and_belongs_to_many :developers_named_david, :class_name => "Developer", :conditions => "name = 'David'", :uniq => true
has_and_belongs_to_many :salaried_developers, :class_name => "Developer", :conditions => "salary > 0"
has_and_belongs_to_many :developers_with_finder_sql, :class_name => "Developer", :finder_sql => 'SELECT t.*, j.* FROM developers_projects j, developers t WHERE t.id = j.developer_id AND j.project_id = #{id}'