aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/company.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/models/company.rb')
-rwxr-xr-xactiverecord/test/models/company.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/test/models/company.rb b/activerecord/test/models/company.rb
index c33f188a02..3d76dfd398 100755
--- a/activerecord/test/models/company.rb
+++ b/activerecord/test/models/company.rb
@@ -40,8 +40,10 @@ class Firm < Company
:counter_sql => 'SELECT COUNT(*) FROM companies WHERE client_of = 1000'
has_many :clients_using_finder_sql, :class_name => "Client", :finder_sql => 'SELECT * FROM companies WHERE 1=1'
has_many :plain_clients, :class_name => 'Client'
+ has_many :readonly_clients, :class_name => 'Client', :readonly => true
has_one :account, :foreign_key => "firm_id", :dependent => :destroy
+ has_one :readonly_account, :foreign_key => "firm_id", :class_name => "Account", :readonly => true
end
class DependentFirm < Company
@@ -60,6 +62,7 @@ class Client < Company
belongs_to :firm_with_basic_id, :class_name => "Firm", :foreign_key => "firm_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
# Record destruction so we can test whether firm.clients.clear has
# is calling client.destroy, deleting from the database, or setting