You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think that this method should be gone, for two reasons:
it's an alias for underline, the real ANSI method
it conflicts with the DB table name inflectors around.
This is typical for the name where one monkey-patches String class with the Term::ANSIColor module. By doing this, one changes the behaviour expected by most ORMs, namely ActiveRecord and Sequel. I've seen this break with Sequel and ActiveRecord 2 (No known reports from ActiveRecord 3, but I assume that it will break nonetheless if the include is done before requiring activerecord, which rarely happens).
Example:
require 'sequel'
require 'logger'
require 'term/ansicolor'
String.send :include, Term::ANSIColor
DB = Sequel.sqlite
DB.loggers = [Logger.new(STDOUT)]
DB.create_table :cars do
primary_key :id
end
class Car < Sequel::Model
end
puts "table name is #{Car.table_name}"
DB.drop_table :cars
The text was updated successfully, but these errors were encountered:
silkeh
added a commit
to silkeh/term-ansicolor
that referenced
this issue
Feb 15, 2018
I think that this method should be gone, for two reasons:
This is typical for the name where one monkey-patches String class with the Term::ANSIColor module. By doing this, one changes the behaviour expected by most ORMs, namely ActiveRecord and Sequel. I've seen this break with Sequel and ActiveRecord 2 (No known reports from ActiveRecord 3, but I assume that it will break nonetheless if the include is done before requiring activerecord, which rarely happens).
Example:
The text was updated successfully, but these errors were encountered: