Sha256: ffcbddd956f7c573c7a8a8d61d93b41aebbea050778131f8abb2da35137d31d6
Contents?: true
Size: 615 Bytes
Versions: 2
Compression:
Stored size: 615 Bytes
Contents
module Scenic module Adapters module Postgres def self.views execute(<<-SQL).map { |result| Scenic::View.new(result) } SELECT viewname, definition FROM pg_views WHERE schemaname = ANY (current_schemas(false)) SQL end def self.create_view(name, sql_definition) execute "CREATE VIEW #{name} AS #{sql_definition};" end def self.drop_view(name) execute "DROP VIEW #{name};" end private def self.execute(sql, base = ActiveRecord::Base) base.connection.execute sql end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
scenic-0.2.1 | lib/scenic/adapters/postgres.rb |
scenic-0.2.0 | lib/scenic/adapters/postgres.rb |