Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed or begin in favour of ||= do

This uses one less block than previously.
  • Loading branch information...
commit d4a80895490d2cb1a46a8f45cbde7093f671628d 1 parent 4052027
Philip Arndt parndt authored
Showing with 3 additions and 5 deletions.
  1. +3 −5 lib/friendly_id/base.rb
8 lib/friendly_id/base.rb
View
@@ -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.