Skip to content

Commit

Permalink
Use the more idiomatic tap method
Browse files Browse the repository at this point in the history
  • Loading branch information
oscardelben committed Apr 4, 2012
1 parent e25eeed commit a3315ef
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 @@ -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
Expand Down

0 comments on commit a3315ef

Please sign in to comment.