Skip to content
This repository has been archived by the owner on Sep 18, 2019. It is now read-only.

Commit

Permalink
Merge 8f7e279 into 64572e7
Browse files Browse the repository at this point in the history
  • Loading branch information
belov committed Aug 27, 2013
2 parents 64572e7 + 8f7e279 commit 23fe84d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/attrio/types/integer.rb
Expand Up @@ -4,10 +4,10 @@ module Attrio
module Types
class Integer < Base
def self.typecast(value, options = {})
options[:base] ||= 10
base = options.is_a?(Hash) && options[:base] ? options[:base] : 10

begin
return value.to_i(options[:base]) if value.is_a?(String)
return value.to_i(base) if value.is_a?(String)
return value.to_i
rescue NoMethodError => e
nil
Expand Down

0 comments on commit 23fe84d

Please sign in to comment.