Browse files

Fixed should_have_indices to always use the correct table name [#89] …

…[Jacob Harris]

 * Fixes the case where `set_table_name` is used to override a table name for abnormal naming schemes
  • Loading branch information...
1 parent c84e84d commit 37ca292bf1673ff71a37b625d51306ec2ee9b119 @rmm5t rmm5t committed Sep 26, 2008
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/shoulda/active_record/macros.rb
View
2 lib/shoulda/active_record/macros.rb
@@ -603,7 +603,7 @@ def should_have_db_column(name, opts = {})
# should_have_index :age
#
def should_have_indices(*columns)
- table = model_class.name.tableize
+ table = model_class.table_name
indices = ::ActiveRecord::Base.connection.indexes(table).map(&:columns)
columns.each do |column|

0 comments on commit 37ca292

Please sign in to comment.