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
Since terminal_table aliases String#ljust, to left, any instance of String responds to left when using this gem. In the example above this leads to an ArgumentError. This happens to me on Rails 4.0.12, but I've verified that similar code exists in Rails 4.2.0 as well. To reproduce, create a scope with a manual join, and then invoke the exists? method on the scope. For example:
classFoo < ActiveRecord::Basebelongs_to:barscope:baz,->{joins('INNER JOIN bars on bars.id = foos.bar_id')}endFoo.baz.exists?(1)
I would suggest removing the aliases in String completely and using the ljust and rjust methods internally instead; left is a very generic method name to add to a core class like String and is likely to conflict with other libraries as well.
The text was updated successfully, but these errors were encountered:
I recently had to track down a problem with a Rails application where a query was failing and isolated it to this code in Active Record:
Since terminal_table aliases
String#ljust
, toleft
, any instance of String responds toleft
when using this gem. In the example above this leads to an ArgumentError. This happens to me on Rails 4.0.12, but I've verified that similar code exists in Rails 4.2.0 as well. To reproduce, create a scope with a manual join, and then invoke theexists?
method on the scope. For example:I would suggest removing the aliases in
String
completely and using theljust
andrjust
methods internally instead;left
is a very generic method name to add to a core class like String and is likely to conflict with other libraries as well.The text was updated successfully, but these errors were encountered: