Skip to content

Commit 7d67880

Browse files
committed
Merge pull request rails#5729 from oscardelben/use_tap
Use the more idiomatic tap method
2 parents d582fd6 + a3315ef commit 7d67880

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

activemodel/lib/active_model/attribute_methods.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,7 @@ def undefine_attribute_methods
255255

256256
# Returns true if the attribute methods defined have been generated.
257257
def generated_attribute_methods #:nodoc:
258-
@generated_attribute_methods ||= begin
259-
mod = Module.new
260-
include mod
261-
mod
262-
end
258+
@generated_attribute_methods ||= Module.new.tap { |mod| include mod }
263259
end
264260

265261
protected

0 commit comments

Comments
 (0)