Permalink
Browse files

Removed or begin in favour of ||= do

This uses one less block than previously.
  • Loading branch information...
1 parent 4052027 commit d4a80895490d2cb1a46a8f45cbde7093f671628d @parndt parndt committed Jul 22, 2012
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

0 comments on commit d4a8089

Please sign in to comment.