require 'rom/mapper_compiler'

module ROM
  module SQL
    class MapperCompiler < ROM::MapperCompiler
      def visit_attribute(node)
        name, _, meta = node

        if meta[:wrapped]
          [name, from: self.alias]
        else
          [name]
        end
      end
    end
  end
end

require 'rom/mapper_compiler'

module ROM
  module SQL
    class MapperCompiler < ROM::MapperCompiler
      def visit_attribute(node)
        name, _, meta_options = node

        if meta_options[:wrapped]
          [name, from: meta_options[:alias]]
        else
          [name]
        end
      end
    end
  end
end

Fix mapper compiler reading attribute alias
Fix mapper compiler reading attribute alias

After merging #324 to master, `rom` test suite (once `rom-sql`
dependency was updated to the new master ref) was failing due to a change
introduced by error on reading the attribute alias from the mapper
compiler.
