Closed xtagon closed 8 years ago
I've just come across this same issue, should the problem be addressed here or in sequel?
Since standard to_hash
in Ruby has no arguments I would expect Sequel to make their version compatible with Ruby's.
Ok I'll open an issue on sequel
Sequel::Dataset#to_hash
might be more intrusive than you want. #to_hash
will actually perform the SQL query against the database, unlike #inspect
or #sql
. It seems that the arity checking that was added in https://github.com/michaeldv/awesome_print/commit/4ee2ade5f72677e2afd92033e6f0d4c244a8e43d (not yet released) will prevent this error from appearing; after that change, AwesomePrint will use #inspect
rather than #to_hash
for datasets. If you do want to see the result of the query you could try ap db["select version()"].all
.
Thanks for using awesome_print.
I'm marking this, #202 and #204 as resolved. Tested with 1.7.0 and it works properly.
Sorry for the late response.
As always, if anybody is still running into this issue on the latest build, then please tag me or @gerrywastaken and we will take care of it.
Hi,
I found an issue in a Rails project with Sequel-Rails, Pry-Rails, and AwesomePrint. I had more Pry plugins loaded, but took them all away to narrow down AwesomePrint's involvement.
When I run the following in the REPL without AwesomePrint, the expected output is returned:
However, if I use AwesomePrint, I get the following:
It looks like the issue is that
Sequel::Postgres::Dataset
implements its own#to_hash
method, but it takes 1..2 arguments and AwesomePrint doesn't know, tries to send it zero args.Is this something you guys would like to look into? Should it be Sequel's responsibility instead? Doesn't make a difference to me, I can live with it personally, but figured I should report to someone.
Regards, Justin