aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
diff options
context:
space:
mode:
authorJenner LaFave <jenner@jfave.com>2014-05-02 18:00:53 -0700
committerJenner LaFave <jenner@jfave.com>2014-05-05 12:41:26 -0700
commit5de7309b7b773a8c9eb5ef71ffdd9a79e08dda3c (patch)
treee380fd719ac1f68113b32772c0bf82b2ddfd61ed /activerecord/test/models
parent4efb0f373047c44249bc6542fdf9969e4c63dd88 (diff)
downloadrails-5de7309b7b773a8c9eb5ef71ffdd9a79e08dda3c.tar.gz
rails-5de7309b7b773a8c9eb5ef71ffdd9a79e08dda3c.tar.bz2
rails-5de7309b7b773a8c9eb5ef71ffdd9a79e08dda3c.zip
Add support for module-level table_suffix in models
This makes table_name_suffix work the same as table_name_prefix when using namespaced models. Pretty much the same as 67d1cec.
Diffstat (limited to 'activerecord/test/models')
-rw-r--r--activerecord/test/models/company_in_module.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/activerecord/test/models/company_in_module.rb b/activerecord/test/models/company_in_module.rb
index 38b0b6aafa..dae102d12b 100644
--- a/activerecord/test/models/company_in_module.rb
+++ b/activerecord/test/models/company_in_module.rb
@@ -46,6 +46,24 @@ module MyApplication
end
end
end
+
+ module Suffixed
+ def self.table_name_suffix
+ '_suffixed'
+ end
+
+ class Company < ActiveRecord::Base
+ end
+
+ class Firm < Company
+ self.table_name = 'companies'
+ end
+
+ module Nested
+ class Company < ActiveRecord::Base
+ end
+ end
+ end
end
module Billing