This can be shortened a little by using `find` (synonymous with `detect`):

```ruby
      def all_mappings
        canonical_paths.map do |path|
          existing_mappings.find { |m| m.path == path } ||
            Mapping.new(site: site, path: path)
          end
        end
      end
```