Skip to content

added #empty? to MySql2::Result#1003

Open
walf443 wants to merge 1 commit into
brianmario:masterfrom
walf443:result_empty
Open

added #empty? to MySql2::Result#1003
walf443 wants to merge 1 commit into
brianmario:masterfrom
walf443:result_empty

Conversation

@walf443

@walf443 walf443 commented Sep 17, 2018

Copy link
Copy Markdown
result = client.qeury("SELECT 1 FROM mysql2_test")
unless result.empty? # currently it need to write `if result.count > 0`
   # do something with `result`
end

MySql2::Result include Enumerable. If it added #empty? method, I'm happy to write a code with more rubyish style.

@sodabrew

sodabrew commented Sep 17, 2018 via email

Copy link
Copy Markdown
Collaborator

@sodabrew sodabrew added this to the 0.6.0 milestone Nov 1, 2018
@sodabrew

sodabrew commented Nov 1, 2018

Copy link
Copy Markdown
Collaborator

Accepted for next major.

@walf443

walf443 commented Nov 2, 2018

Copy link
Copy Markdown
Author

oh I see. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants