Permalink
Browse files

🔨

  • Loading branch information...
alindeman committed Dec 28, 2013
1 parent 70edf96 commit 644fd8de72be4657c09b228a89aba646d8f0e57a
Showing with 1 addition and 3 deletions.
  1. +1 −3 lib/rspec/rails/mocks.rb
View
@@ -62,9 +62,7 @@ def new_record?
# Returns an object representing an association from the mocked
# model's perspective. For use by Rails internally only.
def association(association_name)
- unless defined?(@associations)
- @associations = Hash.new { |h, k| h[k] = Association.new(k) }
- end
+ @associations ||= Hash.new { |h, k| h[k] = Association.new(k) }
@associations[association_name]
end
end

0 comments on commit 644fd8d

Please sign in to comment.