Sha256: 1070bf7d763c16f1368e4275df8876ac02a28d07144da352b5cf37c7833f4ed5

Contents?: true

Size: 673 Bytes

Versions: 6

Compression:

Stored size: 673 Bytes

Contents

module ROM
  module Plugins
    module Relation
      module SQL
        module BaseView
          # @api private
          def self.included(klass)
            super
            klass.extend(ClassInterface)
          end

          module ClassInterface
            def inherited(klass)
              super
              klass.view(:base) do
                header { dataset.columns }
                relation { select(*attributes(:base)).order(primary_key) }
              end
            end
          end
        end
      end
    end
  end
end

ROM.plugins do
  adapter :sql do
    register :base_view, ROM::Plugins::Relation::SQL::BaseView, type: :relation
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rom-sql-0.9.1 lib/rom/plugins/relation/sql/base_view.rb
rom-sql-0.9.0 lib/rom/plugins/relation/sql/base_view.rb
rom-sql-0.8.0 lib/rom/plugins/relation/sql/base_view.rb
rom-sql-0.7.0 lib/rom/plugins/relation/sql/base_view.rb
rom-sql-0.7.0.rc1 lib/rom/plugins/relation/sql/base_view.rb
rom-sql-0.7.0.beta1 lib/rom/plugins/relation/sql/base_view.rb