railsbp/rails_best_practices — pull request #105 by amutz (2012-03-06 23:22:54+00:00)
Title: removing string injection in order to prevent problems with activerecord

Hi,

The current version of RailsBestPractices injects a method called "table_name" into the class String. This causes problems when other code assumes the class String will have no method that is named this.

ActiveRecord (all versions > 3.0) has code that assumes String has no method named "table_name". See this line of code for an example:

https://github.com/rails/rails/blob/3-2-stable/activerecord/lib/active_record/migration.rb#L585

This caused migrations to fail in my environment when including the RailsBestPractices gem. I am including a patch that removes this injection.

Thanks!