Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #316 from norman/optimisations

Removed or begin in favour of ||= do
  • Loading branch information...
commit fae2d2fab8d1379e10350a3c43e98cfe927220c0 2 parents d5888e6 + d4a8089
@norman authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.