Sha256: 6151beeed926724db69eed2e0e6aa05091b6293bbdbcde75eaf933ab18de81ab

Contents?: true

Size: 540 Bytes

Versions: 15

Compression:

Stored size: 540 Bytes

Contents

class CreateCurrent<%= @data[:classname_downcase] %> < ActiveRecord::Migration[<%= @data[:ar_version] %>]
  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

15 entries across 15 versions & 1 rubygems

Version Path
arxutils_sqlite3-0.1.54 lib/template/acrecord/current.tmpl
arxutils_sqlite3-0.1.53 lib/template/acrecord/current.tmpl
arxutils_sqlite3-0.1.52 lib/template/acrecord/current.tmpl
arxutils_sqlite3-0.1.51 lib/template/acrecord/current.tmpl
arxutils_sqlite3-0.1.50 lib/template/acrecord/current.tmpl
arxutils_sqlite3-0.1.49 lib/template/acrecord/current.tmpl
arxutils_sqlite3-0.1.48 lib/template/relation/current.tmpl
arxutils_sqlite3-0.1.47 lib/template/relation/current.tmpl
arxutils_sqlite3-0.1.45 lib/template/relation/current.tmpl
arxutils_sqlite3-0.1.44 lib/template/relation/current.tmpl
arxutils_sqlite3-0.1.43 lib/template/relation/current.tmpl
arxutils_sqlite3-0.1.40 lib/template/relation/current.tmpl
arxutils_sqlite3-0.1.39 lib/template/relation/current.tmpl
arxutils_sqlite3-0.1.38 lib/template/relation/current.tmpl
arxutils_sqlite3-0.1.37 lib/template/relation/current.tmpl