Skip to content

Needed to replace inspect() and find() - neither worked correctly for me #16

@JohnB

Description

@JohnB

I don't know if this is the underlying issue for #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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions