Needed to replace inspect() and find() - neither worked correctly for me
I don't know if this is the underlying issue for https://github.com/aamine/activerecord4-redshift-adapter/issues/7 , but I've found that when I fetch an object the display from inspect() does not show the ID field - but direct access via obj.id shows it just fine. Thus I over-wrote inspect() for my redshift models to correctly show the ID:
def inspect
details = attributes.keys.map {|k| "#{k}: #{(k == 'id' ? self.id : self[k]).inspect}" }.join(", ")
return "#<#{self.class.name} #{details}>"
end
Also, the find() method was throwing an exception for me so I patched it to call find_by_id():
def self.find(integer_id)
find_by_id(integer_id)
end
Has anyone else noticed these issues? If so, I'll try to put a better fix into place and do a PR.
regarding the find method, I think that's the expected behavior http://api.rubyonrails.org/classes/ActiveRecord/FinderMethods.html#method-i-find