lib/hashid/rails.rb in hashid-rails-0.1.1 vs lib/hashid/rails.rb in hashid-rails-0.1.2
- old
+ new
@@ -25,18 +25,14 @@
def encode_id(id)
hashids.encode(id)
end
def decode_id(id)
- hashids.decode(id).first
+ hashids.decode(id.to_s).first
end
def find(hashid)
- if hashid.is_a? String
- super decode_id(hashid)
- else
- super hashid
- end
+ super decode_id(hashid) || hashid
end
end
end
end