aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/models')
-rw-r--r--activerecord/test/models/developer.rb8
-rw-r--r--activerecord/test/models/without_table.rb3
2 files changed, 10 insertions, 1 deletions
diff --git a/activerecord/test/models/developer.rb b/activerecord/test/models/developer.rb
index e35de3b9b0..de68fd7f24 100644
--- a/activerecord/test/models/developer.rb
+++ b/activerecord/test/models/developer.rb
@@ -55,6 +55,12 @@ class Developer < ActiveRecord::Base
def log=(message)
audit_logs.build :message => message
end
+
+ def self.all_johns
+ self.with_exclusive_scope :find => where(:name => 'John') do
+ self.all
+ end
+ end
end
class AuditLog < ActiveRecord::Base
@@ -103,4 +109,4 @@ end
class PoorDeveloperCalledJamis < ActiveRecord::Base
self.table_name = 'developers'
default_scope :conditions => { :name => 'Jamis', :salary => 50000 }
-end \ No newline at end of file
+end
diff --git a/activerecord/test/models/without_table.rb b/activerecord/test/models/without_table.rb
new file mode 100644
index 0000000000..87f80911e1
--- /dev/null
+++ b/activerecord/test/models/without_table.rb
@@ -0,0 +1,3 @@
+class WithoutTable < ActiveRecord::Base
+ default_scope where(:published => true)
+end \ No newline at end of file