diff options
author | Frederick Cheung <frederick.cheung@gmail.com> | 2008-04-25 23:23:48 +0100 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2008-04-26 12:14:50 +1200 |
commit | 44d214235271cb6d2af1c327d592a3010e1ced3e (patch) | |
tree | 5db346cc10ff1dab291e62545a2480a819271f74 /activerecord/test/models | |
parent | a37546517dad9f6d9a7de6e1dba4d960909d71e8 (diff) | |
download | rails-44d214235271cb6d2af1c327d592a3010e1ced3e.tar.gz rails-44d214235271cb6d2af1c327d592a3010e1ced3e.tar.bz2 rails-44d214235271cb6d2af1c327d592a3010e1ced3e.zip |
Ensure table names are quoted by the association preloading code.
[#45 state:resolved]
Signed-off-by: Michael Koziarski <michael@koziarski.com>
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/job.rb | 5 | ||||
-rw-r--r-- | activerecord/test/models/person.rb | 5 | ||||
-rw-r--r-- | activerecord/test/models/reference.rb | 4 |
3 files changed, 14 insertions, 0 deletions
diff --git a/activerecord/test/models/job.rb b/activerecord/test/models/job.rb new file mode 100644 index 0000000000..3333a02e27 --- /dev/null +++ b/activerecord/test/models/job.rb @@ -0,0 +1,5 @@ +class Job < ActiveRecord::Base + has_many :references + has_many :people, :through => :references + belongs_to :ideal_reference, :class_name => 'Reference' +end diff --git a/activerecord/test/models/person.rb b/activerecord/test/models/person.rb index 366f9fb708..4f4d695b24 100644 --- a/activerecord/test/models/person.rb +++ b/activerecord/test/models/person.rb @@ -2,4 +2,9 @@ class Person < ActiveRecord::Base has_many :readers has_many :posts, :through => :readers has_many :posts_with_no_comments, :through => :readers, :source => :post, :include => :comments, :conditions => 'comments.id is null' + + has_many :references + has_many :jobs, :through => :references + has_one :favourite_reference, :class_name => 'Reference', :conditions => ['favourite=?', true] + end diff --git a/activerecord/test/models/reference.rb b/activerecord/test/models/reference.rb new file mode 100644 index 0000000000..479e8b72c6 --- /dev/null +++ b/activerecord/test/models/reference.rb @@ -0,0 +1,4 @@ +class Reference < ActiveRecord::Base + belongs_to :person + belongs_to :job +end |