diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-05-21 01:30:00 -0700 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-05-21 01:30:00 -0700 |
commit | d62a39a22b7ad56efa79089177aa06fda0d41f86 (patch) | |
tree | 1323af2dd5870c4d17863974550b6f9efca887e7 /activerecord/lib/active_record/associations | |
parent | 7288682be4f9384ad4083415342d8af876f77db8 (diff) | |
parent | e0e8918003eab33c5446f17227c9035a6df75e5f (diff) | |
download | rails-d62a39a22b7ad56efa79089177aa06fda0d41f86.tar.gz rails-d62a39a22b7ad56efa79089177aa06fda0d41f86.tar.bz2 rails-d62a39a22b7ad56efa79089177aa06fda0d41f86.zip |
Merge pull request #1162 from guilleiguaran/singularize_individual_table_name
Singularize individual table name
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/alias_tracker.rb | 4 | ||||
-rw-r--r-- | activerecord/lib/active_record/associations/join_helper.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/alias_tracker.rb b/activerecord/lib/active_record/associations/alias_tracker.rb index 44e2ee141e..bd98cf2f46 100644 --- a/activerecord/lib/active_record/associations/alias_tracker.rb +++ b/activerecord/lib/active_record/associations/alias_tracker.rb @@ -49,8 +49,8 @@ module ActiveRecord end end - def pluralize(table_name) - ActiveRecord::Base.pluralize_table_names ? table_name.to_s.pluralize : table_name.to_s + def pluralize(table_name, base) + base.pluralize_table_names ? table_name.to_s.pluralize : table_name.to_s end private diff --git a/activerecord/lib/active_record/associations/join_helper.rb b/activerecord/lib/active_record/associations/join_helper.rb index eae546e76e..87e33891a5 100644 --- a/activerecord/lib/active_record/associations/join_helper.rb +++ b/activerecord/lib/active_record/associations/join_helper.rb @@ -32,7 +32,7 @@ module ActiveRecord end def table_alias_for(reflection, join = false) - name = alias_tracker.pluralize(reflection.name) + name = alias_tracker.pluralize(reflection.name, reflection.active_record) name << "_#{alias_suffix}" name << "_join" if join name |