aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorOscar Del Ben <info@oscardelben.com>2012-04-04 08:45:58 +0200
committerOscar Del Ben <info@oscardelben.com>2012-04-04 08:45:58 +0200
commita3315efde8209a007fec4997bd08615e1523df57 (patch)
tree404d1276bbac28918fc712e79c8738c4238d381b /activemodel
parente25eeed5b873f05f9614ecf6720c0eb636d52b63 (diff)
downloadrails-a3315efde8209a007fec4997bd08615e1523df57.tar.gz
rails-a3315efde8209a007fec4997bd08615e1523df57.tar.bz2
rails-a3315efde8209a007fec4997bd08615e1523df57.zip
Use the more idiomatic tap method
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/attribute_methods.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb
index 97a83e58af..d211122945 100644
--- a/activemodel/lib/active_model/attribute_methods.rb
+++ b/activemodel/lib/active_model/attribute_methods.rb
@@ -243,11 +243,7 @@ module ActiveModel
# 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