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

Recover perf for pluck by reverting 9c9c950d02af83742a5f76302d0faa9… #36172

Merged
merged 1 commit into from May 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions activemodel/lib/active_model/type/integer.rb
Expand Up @@ -18,6 +18,11 @@ def type
:integer
end

def deserialize(value)
return if value.blank?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, I see, if value.nil? changed to if value.blank?.

value.to_i
end

def serialize(value)
return if value.is_a?(::String) && non_numeric_string?(value)
ensure_in_range(super)
Expand Down