Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Performance: minor Column#text? and #number? speedups

  • Loading branch information...
commit c39726057714970f8e39d27bd0cb49fa4d6bc383 1 parent 339491a
@jeremy jeremy authored
View
4 activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
@@ -30,11 +30,11 @@ def initialize(name, default, sql_type = nil, null = true)
end
def text?
- [:string, :text].include? type
+ type == :string || type == :text
end
def number?
- [:float, :integer, :decimal].include? type
+ type == :integer || type == :float || type == :decimal
end
# Returns the Ruby class that corresponds to the abstract data type.
Please sign in to comment.
Something went wrong with that request. Please try again.