diff options
author | José Valim <jose.valim@gmail.com> | 2012-05-13 01:00:17 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-05-13 01:00:17 -0700 |
commit | 7d67880a2d680a5edf85157569f7da20c52f15c4 (patch) | |
tree | 1ac487c1b380e30fa2d4b4938bcf936b6cc20c90 /activemodel/lib | |
parent | d582fd6b0bef1fd52ee1c04c27d097c1455ec612 (diff) | |
parent | a3315efde8209a007fec4997bd08615e1523df57 (diff) | |
download | rails-7d67880a2d680a5edf85157569f7da20c52f15c4.tar.gz rails-7d67880a2d680a5edf85157569f7da20c52f15c4.tar.bz2 rails-7d67880a2d680a5edf85157569f7da20c52f15c4.zip |
Merge pull request #5729 from oscardelben/use_tap
Use the more idiomatic tap method
Diffstat (limited to 'activemodel/lib')
-rw-r--r-- | activemodel/lib/active_model/attribute_methods.rb | 6 |
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 25d5d84ce6..24575438c0 100644 --- a/activemodel/lib/active_model/attribute_methods.rb +++ b/activemodel/lib/active_model/attribute_methods.rb @@ -255,11 +255,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 |