Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArgumentError: comparison of Symbol with String failed #43

Open
jsimpson opened this issue Jul 27, 2018 · 1 comment
Open

ArgumentError: comparison of Symbol with String failed #43

jsimpson opened this issue Jul 27, 2018 · 1 comment

Comments

@jsimpson
Copy link

Installed and ran against a Rails 5.1.4 app using Ruby 2.5.0p0. I get the following exception:

Traceback (most recent call last):
        12: from /Users/omitted/.rbenv/versions/2.5.0/gemsets/omitted/bin/consistency_fail:23:in `<main>'
        11: from /Users/omitted/.rbenv/versions/2.5.0/gemsets/omitted/bin/consistency_fail:23:in `load'
        10: from /Users/omitted/.rbenv/versions/2.5.0/gemsets/omitted/gems/consistency_fail-0.3.5/bin/consistency_fail:20:in `<top (required)>'
         9: from /Users/omitted/.rbenv/versions/2.5.0/gemsets/omitted/gems/consistency_fail-0.3.5/lib/consistency_fail.rb:18:in `run'
         8: from /Users/omitted/.rbenv/versions/2.5.0/gemsets/omitted/gems/consistency_fail-0.3.5/lib/consistency_fail.rb:38:in `problems'
         7: from /Users/omitted/.rbenv/versions/2.5.0/gemsets/omitted/gems/consistency_fail-0.3.5/lib/consistency_fail.rb:38:in `map'
         6: from /Users/omitted/.rbenv/versions/2.5.0/gemsets/omitted/gems/consistency_fail-0.3.5/lib/consistency_fail.rb:39:in `block in problems'
         5: from /Users/omitted/.rbenv/versions/2.5.0/gemsets/omitted/gems/consistency_fail-0.3.5/lib/consistency_fail/introspectors/validates_uniqueness_of.rb:28:in `missing_indexes'
         4: from /Users/omitted/.rbenv/versions/2.5.0/gemsets/omitted/gems/consistency_fail-0.3.5/lib/consistency_fail/introspectors/validates_uniqueness_of.rb:28:in `reject'
         3: from /Users/omitted/.rbenv/versions/2.5.0/gemsets/omitted/gems/consistency_fail-0.3.5/lib/consistency_fail/introspectors/validates_uniqueness_of.rb:29:in `block in missing_indexes'
         2: from /Users/omitted/.rbenv/versions/2.5.0/gemsets/omitted/gems/consistency_fail-0.3.5/lib/consistency_fail/introspectors/validates_uniqueness_of.rb:29:in `include?'
         1: from /Users/omitted/.rbenv/versions/2.5.0/gemsets/omitted/gems/consistency_fail-0.3.5/lib/consistency_fail/index.rb:13:in `=='
/Users/omitted/.rbenv/versions/2.5.0/gemsets/omitted/gems/consistency_fail-0.3.5/lib/consistency_fail/index.rb:13:in `sort': comparison of Symbol with String failed (ArgumentError)

Not too sure what to do from here.

@caseymct
Copy link

in consistency_fail/lib/consistency_fail/index.rb lines 11 - 14 change to

def ==(other)
  self.table_name == other.table_name &&
    self.columns.map(&:to_s).sort == other.columns.map(&:to_s).sort
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants