diff options
author | josevalim <jose.valim@gmail.com> | 2008-05-23 11:20:13 +0200 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2008-05-24 17:58:03 +1200 |
commit | 8d0b4fa39fab6e5d1e3382b4b137cc47e559b0be (patch) | |
tree | 06a4ff2e8bbb4646082fd627ed6633d79a4ee949 /activerecord/test/models/company.rb | |
parent | 5b8d0f134a5766aa1b3d0945b79f04d2bb911c02 (diff) | |
download | rails-8d0b4fa39fab6e5d1e3382b4b137cc47e559b0be.tar.gz rails-8d0b4fa39fab6e5d1e3382b4b137cc47e559b0be.tar.bz2 rails-8d0b4fa39fab6e5d1e3382b4b137cc47e559b0be.zip |
Added :select option to has_one and belongs_to, remove unused :order option on belongs_to.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#241 state:resolved]
Diffstat (limited to 'activerecord/test/models/company.rb')
-rwxr-xr-x | activerecord/test/models/company.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/test/models/company.rb b/activerecord/test/models/company.rb index f637490c59..cc521d2a02 100755 --- a/activerecord/test/models/company.rb +++ b/activerecord/test/models/company.rb @@ -47,6 +47,7 @@ class Firm < Company has_many :readonly_clients, :class_name => 'Client', :readonly => true has_one :account, :foreign_key => "firm_id", :dependent => :destroy + has_one :account_with_select, :foreign_key => "firm_id", :select => "id, firm_id" has_one :readonly_account, :foreign_key => "firm_id", :class_name => "Account", :readonly => true end @@ -64,6 +65,7 @@ end class Client < Company belongs_to :firm, :foreign_key => "client_of" belongs_to :firm_with_basic_id, :class_name => "Firm", :foreign_key => "firm_id" + belongs_to :firm_with_select, :class_name => "Firm", :foreign_key => "firm_id", :select => "id" belongs_to :firm_with_other_name, :class_name => "Firm", :foreign_key => "client_of" belongs_to :firm_with_condition, :class_name => "Firm", :foreign_key => "client_of", :conditions => ["1 = ?", 1] belongs_to :readonly_firm, :class_name => "Firm", :foreign_key => "firm_id", :readonly => true |