Browse files

Use the more idiomatic tap method

  • Loading branch information...
1 parent e25eeed commit a3315efde8209a007fec4997bd08615e1523df57 @oscardelben oscardelben committed Apr 4, 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
@@ -243,11 +243,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 a3315ef

Please sign in to comment.