Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

rewrites a couple of alternations in regexps as character classes

Character classes are the specific regexp construct
to express alternation of individual characters.
  • Loading branch information...
commit 7619bcf2d4a348cb48b765e1980e935abbcc694f 1 parent 211174a
@fxn fxn authored
View
2  activerecord/lib/active_record/relation/calculations.rb
@@ -333,7 +333,7 @@ def type_cast_using_column(value, column)
def select_for_count
if @select_values.present?
select = @select_values.join(", ")
- select if select !~ /(,|\*)/
+ select if select !~ /[,*]/
end
end
View
2  railties/lib/rails/generators/generated_attribute.rb
@@ -32,7 +32,7 @@ def parse_type_and_options(type)
case type
when /(string|text|binary|integer)\{(\d+)\}/
return $1, :limit => $2.to_i
- when /decimal\{(\d+)(,|\.|\-)(\d+)\}/
+ when /decimal\{(\d+)[,.-](\d+)\}/
return :decimal, :precision => $1.to_i, :scale => $3.to_i
else
return type, {}
Please sign in to comment.
Something went wrong with that request. Please try again.