diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2011-05-20 22:53:02 -0500 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2011-05-20 22:54:55 -0500 |
commit | e0e8918003eab33c5446f17227c9035a6df75e5f (patch) | |
tree | c5a48c8440ba5c8ce04336eb705974bd66bb9398 /activerecord/lib | |
parent | 23e94a67f8e922a9ccde7f8b2e6abc56a925d6bf (diff) | |
download | rails-e0e8918003eab33c5446f17227c9035a6df75e5f.tar.gz rails-e0e8918003eab33c5446f17227c9035a6df75e5f.tar.bz2 rails-e0e8918003eab33c5446f17227c9035a6df75e5f.zip |
AliasTracker.pluralize use pluralize_table_names of model
Diffstat (limited to 'activerecord/lib')
-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 |