Simple_form: ActiveRecord::ConnectionAdapters::PostgreSQLColumn#number? has been removed in rails 5

Created on 8 Jan 2016  路  13Comments  路  Source: heartcombo/simple_form

Trying to migrate to rails 5, but having some problems with this gem.

I'm getting undefined method 'number?' for #<ActiveRecord::ConnectionAdapters::PostgreSQLColumn:0x007fd89fda3d40> which is called here https://github.com/plataformatec/simple_form/blob/65a64ff80de256171e40e516027814d116ce5751/lib/simple_form/inputs/base.rb#L118

The number? method was removed here https://github.com/rails/rails/commit/b93b39eff6829ee05ffec1cc8c505f69cbb53fdc according to git bisect

I'm using these gems

  • rails 5.0.0.beta1
  • simple_form master
  • pg 0.18.4

pg 0.17.x worked in 4.x but isn't supported in rails 5.

Most helpful comment

@oleander
Hey! I've got a PR https://github.com/plataformatec/simple_form/pull/1342

For now you can use my fork in your Gemfile:
gem 'simple_form', github: 'kesha-antonov/simple_form', branch: 'rails-5-0'

All 13 comments

Same

@oleander
Hey! I've got a PR https://github.com/plataformatec/simple_form/pull/1342

For now you can use my fork in your Gemfile:
gem 'simple_form', github: 'kesha-antonov/simple_form', branch: 'rails-5-0'

+1

@kesha-antonov PR worked for me. Tks!

@jp7jp Does it work as in "not crash" or "it does what its suppose to do"?

Same problem here...

Any plans for this PR to get merged?

:+1:

Thanks, @kesha-antonov!

Those who are interested can see Kesha's commit here (and yes, it appears to "do what it's supposed to do").

Those who want to use this exact commit in their Gemfile can add this:
gem 'simple_form', github: 'kesha-antonov/simple_form', ref: 'a1561c930f3be279f3580c2510f2555f2e67a4f4'

There is a ticket #1395 to collect all rails5 issues

Confirmed that this bug still exists in the final 5.0.0 release.

Confirmed that @kesha-antonov鈥檚 patch above fixes it.

I had this problem as well

I was looking through the code for how to fix this, including the mocks in the test suite.
Kesha's PR doesn't do the tests but @lucasmazza has a PR that @olivierlacan referenced that does the trick, for those who are interested:
https://github.com/plataformatec/simple_form/pull/1417/files

Closed by #1417

gem 'simple_form', github: 'kesha-antonov/simple_form', branch: 'rails-5-0'

fixed my error

Was this page helpful?
0 / 5 - 0 ratings