Skip to content

Commit

Permalink
Merge pull request rails#5729 from oscardelben/use_tap
Browse files Browse the repository at this point in the history
Use the more idiomatic tap method
  • Loading branch information
josevalim committed May 13, 2012
2 parents d582fd6 + a3315ef commit 7d67880
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions activemodel/lib/active_model/attribute_methods.rb
Expand Up @@ -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
Expand Down

0 comments on commit 7d67880

Please sign in to comment.