Browse files

Merge pull request #5729 from oscardelben/use_tap

Use the more idiomatic tap method
  • Loading branch information...
2 parents d582fd6 + a3315ef commit 7d67880a2d680a5edf85157569f7da20c52f15c4 @josevalim josevalim committed May 13, 2012
Showing with 1 addition and 5 deletions.
  1. +1 −5 activemodel/lib/active_model/attribute_methods.rb
View
6 activemodel/lib/active_model/attribute_methods.rb
@@ -255,11 +255,7 @@ def undefine_attribute_methods
# Returns true if the attribute methods defined have been generated.
def generated_attribute_methods #:nodoc:
- @generated_attribute_methods ||= begin
- mod = Module.new
- include mod
- mod
- end
+ @generated_attribute_methods ||= Module.new.tap { |mod| include mod }
end
protected

0 comments on commit 7d67880

Please sign in to comment.