Permalink
Browse files

AliasTracker.pluralize use pluralize_table_names of model

  • Loading branch information...
guilleiguaran committed May 21, 2011
1 parent 23e94a6 commit e0e8918003eab33c5446f17227c9035a6df75e5f
@@ -49,8 +49,8 @@ def aliased_name_for(table_name, aliased_name = nil)
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
@@ -32,7 +32,7 @@ def table_name_for(reflection)
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

0 comments on commit e0e8918

Please sign in to comment.