Use duck type instead of class check

Rails 4 returns a CollectionProxy object when you call the association
method, so we need to check if the object we have respond to some
methods instead of checking if it is an Array

Fixed #61