change `!true` to `unless` #9950

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@vipulnsward
Member

Change condition to use unless instead

@rafaelfranca rafaelfranca and 1 other commented on an outdated diff Mar 27, 2013
...ecord/connection_adapters/abstract/connection_pool.rb
@@ -297,6 +297,7 @@ def release_connection(with_id = current_connection_id)
# exists checkout a connection, yield it to the block, and checkin the
# connection when finished.
def with_connection
+ fresh_connection =nil
connection_id = current_connection_id
fresh_connection = true unless active_connection?
@rafaelfranca
rafaelfranca Mar 27, 2013 Ruby on Rails member

I don't thin we need to ensure the initialization. Ruby will handle this one:

>> foo = 1 unless true
=> nil
>> foo
=> nil
@vipulnsward
vipulnsward Mar 27, 2013 Ruby on Rails member

ah, right, I missed this while testing, will update

@vipulnsward
Member

@rafaelfranca updated

@rafaelfranca
Member

Right now this change is under the cosmetic category so I prefer to not merge.

Changes that are cosmetic in nature and do not add anything substantial to the stability, functionality, or testability of Rails will generally not be accepted.

http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#write-your-code

Thank you so much.

@vipulnsward
Member

👍

@vipulnsward vipulnsward deleted the vipulnsward:change_not_true_to_unless branch Mar 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment