Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Removed or begin in favour of ||= do #316

Merged
merged 1 commit into from

2 participants

@parndt
Collaborator

This uses one less block than previously.

I'm unsure of any implications regarding why it was originally written this way so I'm deferring to you to merge this whenever you're available @norman

@parndt parndt Removed or begin in favour of ||= do
This uses one less block than previously.
d4a8089
@norman norman merged commit fae2d2f into master
@norman
Owner

Yup, I think that just kind of grew organically during various editing sessions, sort of like mold. Thanks for refactoring away - pulled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 22, 2012
  1. @parndt

    Removed or begin in favour of ||= do

    parndt authored
    This uses one less block than previously.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 5 deletions.
  1. +3 −5 lib/friendly_id/base.rb
View
8 lib/friendly_id/base.rb
@@ -199,11 +199,9 @@ def friendly_id(base = nil, options = {}, &block)
# on first access. If you're concerned about thread safety, then be sure
# to invoke {#friendly_id} in your class for each model.
def friendly_id_config
- @friendly_id_config or begin
- @friendly_id_config = base_class.friendly_id_config.dup.tap do |config|
- config.model_class = self
- @relation_class = base_class.send(:relation_class)
- end
+ @friendly_id_config ||= base_class.friendly_id_config.dup.tap do |config|
+ config.model_class = self
+ @relation_class = base_class.send(:relation_class)
end
end
Something went wrong with that request. Please try again.