Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove dependency on Object#try so we're Rails 2.2.x compatible.

  • Loading branch information...
commit 3a44e485dd3c4c0e9158cb027448480f8adff561 1 parent f9b7133
@vandrijevik vandrijevik authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/enum/enum.rb
View
2  lib/enum/enum.rb
@@ -43,7 +43,7 @@ def set_constant(record)
private :set_constant
def constant_for(field_value)
- if constant = field_value.try(:dup)
+ if constant = !field_value.nil? && field_value.dup
constant.gsub!(/\W+/, "_")
constant.gsub!(/^_|_$/, '')
constant.upcase!
Please sign in to comment.
Something went wrong with that request. Please try again.