1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot.git synced 2022-11-09 11:43:51 -05:00

Replace map.flatten with flat_map

This commit is contained in:
Bob Umerkulov 2014-11-13 22:06:55 -05:00 committed by Joshua Clayton
parent 2ef9a5fb0c
commit 23c0dc67b5

View file

@ -89,9 +89,9 @@ module FactoryGirl
end end
def alias_names_to_ignore def alias_names_to_ignore
@attribute_list.non_ignored.map do |attribute| @attribute_list.non_ignored.flat_map do |attribute|
override_names.map { |override| attribute.name if attribute.alias_for?(override) && attribute.name != override && !ignored_attribute_names.include?(override) } override_names.map { |override| attribute.name if attribute.alias_for?(override) && attribute.name != override && !ignored_attribute_names.include?(override) }
end.flatten.compact end.compact
end end
end end
end end