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

undefined method `to_f' for ActiveRecord::VERSION:Module #10

Closed
eiked opened this issue May 10, 2018 · 2 comments
Closed

undefined method `to_f' for ActiveRecord::VERSION:Module #10

eiked opened this issue May 10, 2018 · 2 comments

Comments

@eiked
Copy link

eiked commented May 10, 2018

Hi everyone at protected_attributes_continued

in protected_attributes_continued/lib/active_record/mass_assignment_security/associations.rb:8:in `block in build_record'

the_scope = (ActiveRecord::VERSION.to_f >= 5.2 ? scope_for_create : create_scope)

fails with:
undefined method to_f' for ActiveRecord::VERSION:Module`
at least with older version of rails. I tried:

  • Rails.version => "5.0.6"
  • Rails.version => "5.1.6"

You might want to use instead:
Rails.version.to_f

@eiked
Copy link
Author

eiked commented May 10, 2018

  • Rails.version => "5.2.0"
ActiveRecord::VERSION.to_f
NoMethodError: undefined method `to_f' for ActiveRecord::VERSION:Module

Maybe this is because I take it from the trunk:
Gemfile:
gem 'protected_attributes_continued', git:'https://github.com/westonganger/protected_attributes_continued.git'

@westonganger
Copy link
Owner

Sorry its supposed to be ActiveRecord::VERSION::STRING.to_f. I already looked into this awhile ago... not sure why it wasn't pushed.

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