Permalink
Browse files

Refactor to use flat_map

  • Loading branch information...
1 parent ee75164 commit 3a4d0b1e2975122defe86de31fc35ab2dcd9b984 @carlosantoniodasilva carlosantoniodasilva committed Jul 24, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 activerecord/lib/active_record/associations/builder/association.rb
@@ -2,7 +2,7 @@
# used by all associations.
#
# The hierarchy is defined as follows:
-# Association
+# Association
# - SingularAssociation
# - BelongsToAssociation
# - HasOneAssociation
@@ -66,7 +66,7 @@ def macro
end
def valid_options
- Association.valid_options + Association.extensions.map(&:valid_options).flatten
+ Association.valid_options + Association.extensions.flat_map(&:valid_options)
end
def validate_options
@@ -77,7 +77,7 @@ def validate_options
# class Post < ActiveRecord::Base
# has_many :comments
# end
- #
+ #
# Post.first.comments and Post.first.comments= methods are defined by this method...
def define_accessors

0 comments on commit 3a4d0b1

Please sign in to comment.