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

add_null_constraint fails with undefined method `match?' for /^".*"$/:Regexp #45

Open
brightbytes-dude opened this issue Sep 21, 2018 · 1 comment

Comments

@brightbytes-dude
Copy link

With ActiveRecord 4.2.10, when running this line in a migration:

    add_null_constraint :ews_students, :first_name, if: "last_name IS NULL"

... the following occurs:

undefined method `match?' for /^".*"$/:Regexp
Did you mean?  match
/Users/aaron/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rein-3.5.0/lib/rein/util.rb:17:in `wrap_identifier'
/Users/aaron/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rein-3.5.0/lib/rein/constraint/null.rb:27:in `_add_null_constraint'
/Users/aaron/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rein-3.5.0/lib/rein/constraint/null.rb:11:in `block (2 levels) in add_null_constraint'
/Users/aaron/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/migration.rb:511:in `up'
/Users/aaron/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rein-3.5.0/lib/rein/constraint/null.rb:11:in `block in add_null_constraint'
/Users/aaron/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/migration.rb:547:in `block in reversible'
/Users/aaron/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/migration.rb:746:in `execute_block'
/Users/aaron/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/migration.rb:547:in `reversible'
/Users/aaron/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rein-3.5.0/lib/rein/constraint/null.rb:10:in `add_null_constraint'
/Users/aaron/git/clarity_early_warning/db/migrate/20180920222205_nullable_first_name.rb:5:in `up'
@sasinda
Copy link

sasinda commented May 7, 2019

having the same issue with add_inclusion_constraint.
Its, due to ruby being < 2.4.x
https://stackoverflow.com/questions/41792348/nomethoderror-undefined-method-match-for-rubystring

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