Sha256: ecb70865579be5ecd2deebe1bbb5574ca0a3d19f22eb45c95c3386aa8918ad2d

Contents?: true

Size: 513 Bytes

Versions: 4

Compression:

Stored size: 513 Bytes

Contents

class CreateCurrent<%= @data[:classname_downcase] %> < ActiveRecord::Migration
  def self.up
    execute <<-SQL
      CREATE VIEW current<%= @data[:plural] %> AS SELECT id as org_id,
<%= @data[:ary].map{|x| x.name }.join(" , ") %>    
      FROM <%= @data[:plural] %> where not exists (select * from invalid<%= @data[:plural] %> where invalid<%= @data[:plural] %>.org_id = <%= @data[:plural] %>.id )
    SQL
  end

  def self.down
    execute <<-SQL
      DROP VIEW current<%= @data[:plural] %>
    SQL
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
arxutils-0.1.38 lib/template/current.tmpl
arxutils-0.1.37 lib/template/current.tmpl
arxutils-0.1.36 lib/template/current.tmpl
arxutils-0.1.35 lib/template/current.tmpl