ROM::Relation::ClassInterface#view

Parsed documentation:
View on GitHub
Define a relation view with a specific schema

This method should only be used in cases where a given adapter doesn't
support automatic schema projection at run-time.

**It's not needed in rom-sql**

@overload view(name, schema, &block)
  @example View with the canonical schema
    class Users < ROM::Relation[:sql]
      view(:listing, schema) do
        order(:name)
      end
    end

  @example View with a projected schema
    class Users < ROM::Relation[:sql]
      view(:listing, schema.project(:id, :name)) do
        order(:name)
      end
    end

@overload view(name, &block)
  @example View with the canonical schema and arguments
    class Users < ROM::Relation[:sql]
      view(:by_name) do |name|
        where(name: name)
      end
    end

  @example View with projected schema and arguments
    class Users < ROM::Relation[:sql]
      view(:by_name) do
        schema { project(:id, :name) }
        relation { |name| where(name: name) }
      end
    end

  @example View with a schema extended with foreign attributes
    class Users < ROM::Relation[:sql]
      view(:index) do
        schema { append(relations[:tasks][:title]) }
        relation { |name| where(name: name) }
      end
    end

@return [Symbol] view method name

@api public
Suggestions:
Please help! Open an issue on GitHub if this assessment is incorrect.