code
stringlengths
1
1.73M
language
stringclasses
1 value
require "rss-testcase" require "rss/1.0" require "rss/dublincore" module RSS class TestParser10 < TestCase def test_RDF assert_ns("", RDF::URI) do Parser.parse(<<-EOR) #{make_xmldecl} <RDF/> EOR end assert_ns("", RDF::URI) do Parser.parse(<<-EOR) #{make_xmldecl} <RDF xmlns="ho...
Ruby
require "rss-testcase" require "rss/maker" module RSS class TestMakerTrackBack < TestCase def setup @uri = "http://madskills.com/public/xml/rss/module/trackback/" @elements = { :ping => "http://bar.com/tb.cgi?tb_id=rssplustrackback", :abouts => [ "http://foo.com/tra...
Ruby
require "cgi" require "rexml/document" require "rss-testcase" require "rss/1.0" require "rss/2.0" require "rss/trackback" module RSS class TestTrackBack < TestCase def setup @prefix = "trackback" @uri = "http://madskills.com/public/xml/rss/module/trackback/" @parents = %w(item) ...
Ruby
require "cgi" require "rexml/document" require "rss-testcase" require "rss/1.0" require "rss/syndication" module RSS class TestSyndication < TestCase def setup @prefix = "sy" @uri = "http://purl.org/rss/1.0/modules/syndication/" @parents = %w(channel) t = Time.iso8601...
Ruby
require "cgi" require "rexml/document" require "rss-testcase" require "rss/content" module RSS class TestContent < TestCase def setup @prefix = "content" @uri = "http://purl.org/rss/1.0/modules/content/" @elems = { :encoded => "<em>ATTENTION</em>", } @content...
Ruby
require 'erb' module RSS module Assertions def assert_parse(rss, assert_method, *args) __send__("assert_#{assert_method}", *args) do ::RSS::Parser.parse(rss) end __send__("assert_#{assert_method}", *args) do ::RSS::Parser.parse(rss, false).validate end end def...
Ruby
require "rexml/document" require "rss-testcase" require "rss/atom" module RSS class TestAtomCore < TestCase def setup @uri = "http://www.w3.org/2005/Atom" @xhtml_uri = "http://www.w3.org/1999/xhtml" end def test_feed version = "1.0" encoding = "UTF-8" standalone = false ...
Ruby
require "rexml/document" require "rss-testcase" module RSS class TestRSS20Core < TestCase def setup @rss_version = "2.0" end def test_Rss version = "1.0" encoding = "UTF-8" standalone = false rss = Rss.new(@rss_version, version, encoding, standalone) setu...
Ruby
require "rss-testcase" require "rss/maker" module RSS class TestMakerImage < TestCase def setup @uri = "http://web.resource.org/rss/1.0/modules/image/" @favicon_infos = { "about" => "http://www.kuro5hin.org/favicon.ico", "image_size" => "small", "dc_title" => "example", ...
Ruby
require "rss-testcase" require "rss/1.0" require "rss/2.0" require "rss/syndication" require "rss/image" module RSS class TestAccessor < TestCase def test_date channel = Rss::Channel.new channel.pubDate = nil assert_nil(channel.pubDate) time = Time.now channel.pubDate = time...
Ruby
require "cgi" require "rss-testcase" require "rss/1.0" require "rss/2.0" require "rss/taxonomy" module RSS class TestTaxonomy < TestCase def setup @prefix = "taxo" @uri = "http://purl.org/rss/1.0/modules/taxonomy/" @dc_prefix = "dc" @dc_uri = "http://purl.org/dc/elements/1.1/" ...
Ruby
require "rss-testcase" require "rss/maker" module RSS class TestMakerContent < TestCase def setup @uri = "http://purl.org/rss/1.0/modules/content/" @elements = { :encoded => "<em>ATTENTION</em>", } end def test_rss10 rss = RSS::Maker.make("1.0") do |maker| ...
Ruby
require "rss-testcase" require "rss/maker" module RSS class TestMakerAtomEntry < TestCase def test_root_element entry = Maker.make("atom:entry") do |maker| setup_dummy_channel_atom(maker) setup_dummy_item_atom(maker) end assert_equal(["atom", "1.0", "entry"], entry.feed_info) ...
Ruby
require 'test/unit' require 'tempfile' require 'fileutils' require 'csv' class CSV class StreamBuf # Let buffer work hard. remove_const("BufSize") BufSize = 2 end end module CSVTestSupport def d(data) data end end class TestCSV < Test::Unit::TestCase file = Tempfile.new("crlf") file <<...
Ruby
require 'test/unit' require 'matrix' class TestMatrix < Test::Unit::TestCase def setup @m1 = Matrix[[1,2,3], [4,5,6]] @m2 = Matrix[[1,2,3], [4,5,6]] @m3 = @m1.clone @m4 = Matrix[[1,0, 2.0, 3.0], [4.0, 5.0, 6.0]] @n1 = Matrix[[2,3,4], [5,6,7]] end def test_identity assert_same @m1, @m1 ...
Ruby
require 'test/unit' require 'matrix' class TestVector < Test::Unit::TestCase def setup @v1 = Vector[1,2,3] @v2 = Vector[1,2,3] @v3 = @v1.clone @v4 = Vector[1,0, 2.0, 3.0] @w1 = Vector[2,3,4] end def test_identity assert_same @v1, @v1 assert_not_same @v1, @v2 assert_not_same @v1, ...
Ruby
require 'test/unit' require 'resolv' require 'socket' class TestResolvAddr < Test::Unit::TestCase def test_invalid_ipv4_address assert(Resolv::IPv4::Regex !~ "1.2.3.256", "[ruby-core:29501]") 1000.times {|i| if i < 256 assert(Resolv::IPv4::Regex =~ "#{i}.#{i}.#{i}.#{i}") else asse...
Ruby
begin require 'iconv' rescue LoadError else require 'test/unit' end class TestIconv < ::Test::Unit::TestCase if defined?(::Encoding) and String.method_defined?(:force_encoding) def self.encode(str, enc) str.force_encoding(enc) end else def self.encode(str, enc) str end end def ...
Ruby
require File.expand_path("../utils.rb", __FILE__) class TestIconv::Partial < TestIconv def test_partial_ascii c = Iconv.open(ASCII, ASCII) ref = '[ruby-core:17092]' rescue return else assert_equal("abc", c.iconv("abc")) assert_equal("c", c.iconv("abc", 2), "#{ref}: with start") asse...
Ruby
require File.expand_path("../utils.rb", __FILE__) class TestIconv::Option < TestIconv def test_ignore_option iconv = Iconv.new('SHIFT_JIS', 'EUC-JP//ignore') str = iconv.iconv(EUCJ_STR) str << iconv.iconv(nil) assert_equal(SJIS_STR, str) iconv.close iconv = Iconv.new('SHIFT_JIS//IGNORE', 'EU...
Ruby
require File.expand_path("../utils.rb", __FILE__) class TestIconv::Basic < TestIconv def test_euc2sjis iconv = Iconv.open('SHIFT_JIS', 'EUC-JP') str = iconv.iconv(EUCJ_STR) str << iconv.iconv(nil) assert_equal(SJIS_STR, str) iconv.close end def test_close iconv = Iconv.new('Shift_JIS', '...
Ruby
require 'test/unit' begin require 'sdbm' rescue LoadError end class TestSDBM < Test::Unit::TestCase def setup @path = "tmptest_sdbm_" assert_instance_of(SDBM, @sdbm = SDBM.new(@path)) end def teardown assert_nil(@sdbm.close) ObjectSpace.each_object(SDBM) do |obj| obj.close unless obj.clo...
Ruby
require 'test/unit' begin require 'gdbm' rescue LoadError end if defined? GDBM require 'tmpdir' require 'fileutils' class TestGDBM < Test::Unit::TestCase def TestGDBM.uname_s require 'rbconfig' case Config::CONFIG['target_os'] when 'cygwin' require 'Win32API' uname = Win...
Ruby
require 'test/unit' begin require 'dbm' rescue LoadError end if defined? DBM require 'tmpdir' require 'fileutils' class TestDBM < Test::Unit::TestCase def TestDBM.uname_s require 'rbconfig' case Config::CONFIG['target_os'] when 'cygwin' require 'Win32API' uname = Win32AP...
Ruby
require 'test/unit' begin require 'io/nonblock' rescue LoadError end class TestIONonblock < Test::Unit::TestCase def test_flush # [ruby-dev:24985] r,w = IO.pipe w.nonblock = true w.sync = false w << "b" w.flush w << "a" * 4096 Thread.new { Thread.pass w.close ...
Ruby
require "rexml/document" require "test/unit" class REXML::TestDocument < Test::Unit::TestCase def test_new doc = REXML::Document.new(<<EOF) <?xml version="1.0" encoding="UTF-8"?> <message>Hello world!</message> EOF assert_equal("Hello world!", doc.root.children.first.value) end XML_WITH_NESTED_ENTITY = ...
Ruby
#!/usr/bin/env ruby require 'json' RESET_PROB = 0.15; class Handler def gather_edges(json) {:edges => :IN_EDGES} end def scatter_edges(json) last_change = json['state'].to_f return {:edges => :OUT_EDGES} if last_change > 1e-2 return {:edges => :NO_EDGES} end def gather(json) edge = j...
Ruby
#!/usr/bin/env ruby require 'json' INFINITY = 1e99 class String alias :old_to_f :to_f def to_f return INFINITY if 0 >= self.length self.old_to_f end end class Handler def gather_edges(json) {:edges => :IN_EDGES} end def scatter_edges(json) {:edges => :OUT_EDGES} end def gather(jso...
Ruby
#!/usr/bin/env ruby def colorize(text, color_code) "\e[0;#{color_code}m#{text}\e[0m" end def red(text) colorize(text, 31) end def green(text) colorize(text, 32) end def cyan(text) colorize(text, 36) end begin # open new terminal fd = IO.sysopen("/dev/tty", "r") term = IO.new(fd,"r") thread = T...
Ruby
class CreateUsers < ActiveRecord::Migration def up create_table :users do |t| t.string :profile_id t.string :email t.string :refresh_token end add_index :users, :profile_id end def down drop_table :users end end
Ruby
# Copyright (C) 2012 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Ruby
source :gemcutter gem 'sinatra', :require => 'sinatra/base' gem 'thin', '~> 1.3' gem 'pg' gem 'sinatra-activerecord' gem 'google-api-client', '>= 0.4.4', :require => 'google/api_client' group :development do gem 'rake' gem 'sqlite3-ruby' end
Ruby
require 'sinatra.rb' # Sinatra defines #set at the top level as a way to set application configuration set :run, false set :env, (ENV['RACK_ENV'] ? ENV['RACK_ENV'].to_sym : :development) require './main' run Sinatra::Application
Ruby
require 'sinatra/activerecord/rake' require './main'
Ruby
class CreateUsers < ActiveRecord::Migration def up create_table :users do |t| t.string :profile_id t.string :email t.string :refresh_token end add_index :users, :profile_id end def down drop_table :users end end
Ruby
# Copyright (C) 2012 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Ruby
source :gemcutter gem 'sinatra', :require => 'sinatra/base' gem 'thin', '~> 1.3' gem 'pg' gem 'sinatra-activerecord' gem 'google-api-client', '>= 0.4.4', :require => 'google/api_client' group :development do gem 'rake' gem 'sqlite3-ruby' end
Ruby
require 'sinatra.rb' # Sinatra defines #set at the top level as a way to set application configuration set :run, false set :env, (ENV['RACK_ENV'] ? ENV['RACK_ENV'].to_sym : :development) require './main' run Sinatra::Application
Ruby
require 'sinatra/activerecord/rake' require './main'
Ruby
class CreateUsers < ActiveRecord::Migration def up create_table :users do |t| t.string :profile_id t.string :email t.string :refresh_token end add_index :users, :profile_id end def down drop_table :users end end
Ruby
# Copyright (C) 2012 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Ruby
source :gemcutter gem 'sinatra', :require => 'sinatra/base' gem 'thin', '~> 1.3' gem 'pg' gem 'sinatra-activerecord' gem 'google-api-client', '>= 0.4.4', :require => 'google/api_client' group :development do gem 'rake' gem 'sqlite3-ruby' end
Ruby
require 'sinatra.rb' # Sinatra defines #set at the top level as a way to set application configuration set :run, false set :env, (ENV['RACK_ENV'] ? ENV['RACK_ENV'].to_sym : :development) require './main' run Sinatra::Application
Ruby
require 'sinatra/activerecord/rake' require './main'
Ruby
class CreateUsers < ActiveRecord::Migration def up create_table :users do |t| t.string :profile_id t.string :email t.string :refresh_token end add_index :users, :profile_id end def down drop_table :users end end
Ruby
# Copyright (C) 2012 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Ruby
source :gemcutter gem 'sinatra', :require => 'sinatra/base' gem 'thin', '~> 1.3' gem 'pg' gem 'sinatra-activerecord' gem 'google-api-client', '>= 0.4.4', :require => 'google/api_client' group :development do gem 'rake' gem 'sqlite3-ruby' end
Ruby
require 'sinatra.rb' # Sinatra defines #set at the top level as a way to set application configuration set :run, false set :env, (ENV['RACK_ENV'] ? ENV['RACK_ENV'].to_sym : :development) require './main' run Sinatra::Application
Ruby
require 'sinatra/activerecord/rake' require './main'
Ruby
require 'sinatra/activerecord/rake' require './main'
Ruby
source :gemcutter gem 'sinatra', :require => 'sinatra/base' gem 'thin', '~> 1.3' gem 'pg' gem 'sinatra-activerecord' gem 'google-api-client', '>= 0.4.4', :require => 'google/api_client' group :development do gem 'rake' gem 'sqlite3-ruby' end
Ruby
class CreateUsers < ActiveRecord::Migration def up create_table :users do |t| t.string :profile_id t.string :email t.string :refresh_token end add_index :users, :profile_id end def down drop_table :users end end
Ruby
# Copyright (C) 2012 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Ruby
require 'sinatra.rb' # Sinatra defines #set at the top level as a way to set application configuration set :run, false set :env, (ENV['RACK_ENV'] ? ENV['RACK_ENV'].to_sym : :development) require './main' run Sinatra::Application
Ruby
# Install hook code here
Ruby
# Include hook code here #ActionController::Base.send(:include, OptionalPartialParameters) #ActiveRecord::Base.send(:include, OptionalPartialParameters) ActionView::Base.send(:include, OptionalPartialParameters) #ActionView::Base.class_eval do # def render_with_optionals(*args) # options = args.first ...
Ruby
# desc "Explaining what the task does" # task :optional_partial_parameters do # # Task goes here # end
Ruby
# Uninstall hook code here
Ruby
require 'rake' require 'rake/testtask' require 'rake/rdoctask' desc 'Default: run unit tests.' task :default => :test desc 'Test the optional_partial_parameters plugin.' Rake::TestTask.new(:test) do |t| t.libs << 'lib' t.pattern = 'test/**/*_test.rb' t.verbose = true end desc 'Generate documentation for the op...
Ruby
# # OptionalPartialParameters module OptionalPartialParameters def self.included(base) #base.extend(ClassMethods) base.class_eval do include ClassMethods alias_method_chain :render, :optionals end end module ClassMethods def render_with_optionals(*args)...
Ruby
# This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). # # Examples: # # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) # Major.create(:name...
Ruby
class CreateCeps < ActiveRecord::Migration def self.up create_table :ceps do |t| t.string :cep t.integer :uf t.string :municipio t.string :bairro t.string :endereco t.timestamps end end def self.down drop_table :ceps end end
Ruby
class CreateMembroConselhos < ActiveRecord::Migration def self.up create_table :membro_conselhos do |t| t.integer :conselho_id, :null => false t.integer :representacao_id, :null => false t.integer :pessoa_id, :null => false t.integer :funcao_id, :null => false t.timestamps end ...
Ruby
class CreateDocumentos < ActiveRecord::Migration def self.up create_table :documentos do |t| t.string :entidade t.integer :codigoEntidade t.integer :documento t.string :tipo t.timestamps end end def self.down drop_table :documentos end end
Ruby
class CreateDizimos < ActiveRecord::Migration def self.up create_table :dizimos do |t| t.integer :paroquia_id, :null => false t.integer :dizimista_id, :null => false t.integer :mes, :limit => 2 t.integer :ano, :limit => 4 t.datetime :dataPagamento, :null => false t.decimal :val...
Ruby
class CreateFuncaoParoquias < ActiveRecord::Migration def self.up create_table :funcao_paroquias do |t| t.integer :funcao_id, :null => false t.integer :paroquia_id, :null => false t.integer :pessoa_id, :null => false t.datetime :dataFim, :null => false t.timestamps end puts...
Ruby
class CreateTitulos < ActiveRecord::Migration def self.up create_table :titulos do |t| t.string :descricao, :null => false t.timestamps end end def self.down drop_table :titulos end end
Ruby
class CreateRemessas < ActiveRecord::Migration def self.up create_table :remessas do |t| t.integer :formasRemessa_id, :null => false t.string :entidadeOrigem, :null => false t.integer :codigoEntidadeOrigem, :null => false t.string :entidadeDestino, :null => false t.integer :codigoEnt...
Ruby
class CreateAuxiliarMovimentos < ActiveRecord::Migration def self.up create_table :auxiliar_movimentos do |t| t.integer :pessoa_id t.string :ensinoFundamental t.datetime :ensinoFundamentalData t.string :ensinoMedio t.datetime :ensinoMedioData t.string :filosofia t.datetim...
Ruby
class CreateTipoEntradas < ActiveRecord::Migration def self.up create_table :tipo_entradas do |t| t.string :entidade, :null => false t.integer :codigoEntidade, :null => false t.integer :gruposFinanceiro_id, :null => false t.string :nome, :null => false t.string :codReceita t.st...
Ruby
class CreateConfiguracaoRemessas < ActiveRecord::Migration def self.up create_table :configuracao_remessas do |t| t.string :entidade, :null => false t.integer :codigoEntidade, :null => false t.integer :conta_id, :null => false t.decimal :percentualRemessa, :precision => 12, :scale => 2, :n...
Ruby
class CreateCasaCongregacoes < ActiveRecord::Migration def self.up create_table :casa_congregacoes do |t| t.integer :congregacao_id, :null => false t.integer :paroquia_id, :null => false t.string :nome, :null => false t.string :endereco, :null => false t.string :numero, :null => fa...
Ruby
class CreateConselhos < ActiveRecord::Migration def self.up create_table :conselhos do |t| t.integer :tipoConselho_id, :null => false t.string :nome, :null => false t.datetime :dataInicio, :null => false t.datetime :dataFim t.integer :status, :null => false, :limit => 1 t.time...
Ruby
class CreateBatismos < ActiveRecord::Migration def self.up create_table :batismos do |t| t.integer :livro_id, :null => false t.integer :paroquia_id, :null => false t.integer :ordem, :null => false t.integer :folha, :null => false t.string :nomeBatismo, :null => false t.integer ...
Ruby
class CreateMatrimonios < ActiveRecord::Migration def self.up create_table :matrimonios do |t| t.integer :livro_id, :null => false t.integer :paroquia_id, :null => false t.integer :ordem, :null => false t.integer :folha, :null => false t.string :nomeHomem, :null => false t.stri...
Ruby
class CreateRepresentacoes < ActiveRecord::Migration def self.up create_table :representacoes do |t| t.string :descricao, :null => false t.timestamps end end def self.down drop_table :representacoes end end
Ruby
class CreateTipoSaidas < ActiveRecord::Migration def self.up create_table :tipo_saidas do |t| t.string :entidade, :null => false t.integer :codigoEntidade, :null => false t.integer :gruposFinanceiro_id, :null => false t.string :nome, :null => false t.string :codReceita t.string...
Ruby
class CreateCongregacoes < ActiveRecord::Migration def self.up create_table :congregacoes do |t| t.string :nome, :null => false t.string :nomePopular, :null => false t.text :sedeGeral, :null => false t.string :sigla, :null => false t.text :fundador t.text :carisma, :null => fal...
Ruby
class CreateUsuarios < ActiveRecord::Migration def self.up create_table :usuarios do |t| t.integer :pessoa_id, :null => false t.integer :gestorCadastrante t.integer :diocese t.integer :regiao t.integer :paroquia t.string :login, :null => false t.string :senha, :null => fa...
Ruby
class CreateTipoPastoralMovimentos < ActiveRecord::Migration def self.up create_table :tipo_pastoral_movimentos do |t| t.string :descricao, :null => false t.timestamps end end def self.down drop_table :tipo_pastoral_movimentos end end
Ruby
class CreateMembroCasas < ActiveRecord::Migration def self.up create_table :membro_casas do |t| t.integer :casaCongregacao_id, :null => false t.integer :pessoa_id, :null => false t.integer :funcao_id, :null => false t.timestamps end puts 'Definindo relacionamento Membro => Ca...
Ruby
class CreateTransferenciaContas < ActiveRecord::Migration def self.up create_table :transferencia_contas do |t| t.string :entidade, :null => false t.integer :codigoEntidade, :null => false t.datetime :data, :null => false t.decimal :valor, :null => false t.string :contaOrigem, :null ...
Ruby
class CreateFormasRemessas < ActiveRecord::Migration def self.up create_table :formas_remessas do |t| t.string :descricao, :null => false t.timestamps end end def self.down drop_table :formas_remessas end end
Ruby
class CreateEspecieMovimentos < ActiveRecord::Migration def self.up create_table :especie_movimentos do |t| t.integer :tipoPastoralMovimento_id, :null => false t.string :descricao, :null => false t.timestamps end puts 'Definindo relacionamento Especie Movimento => Tipo movimento pastor...
Ruby
class CreatePaises < ActiveRecord::Migration def self.up create_table :paises do |t| t.string :nome, :null => false t.timestamps end puts 'Cadastrando paises...' Pais.cadastrar_paises puts 'Ok...' end def self.down drop_table :paises end end
Ruby
class CreateFuncoes < ActiveRecord::Migration def self.up create_table :funcoes do |t| t.string :nome, :null => false, :limit => 80 t.timestamps end end def self.down drop_table :funcoes end end
Ruby
class CreateCrismas < ActiveRecord::Migration def self.up create_table :crismas do |t| t.string :crismando, :null => false t.integer :sexo, :limit => 1, :null => false t.datetime :dataNascimento, :null => false t.datetime :dataCrisma, :null => false t.string :nomeMae t.string :...
Ruby
class CreateTipoConselhos < ActiveRecord::Migration def self.up create_table :tipo_conselhos do |t| t.string :descricao, :null => false t.timestamps end end def self.down drop_table :tipo_conselhos end end
Ruby
class CreateTipoEntidades < ActiveRecord::Migration def self.up create_table :tipo_entidades do |t| t.string :descricao, :null => false t.timestamps end end def self.down drop_table :tipo_entidades end end
Ruby
class CreateEntidades < ActiveRecord::Migration def self.up create_table :entidades do |t| t.integer :tipoEntidade_id, :null => false t.string :nome, :null => false t.string :endereco, :null => false t.string :numero, :null => false t.string :bairro, :null => false t.integer :u...
Ruby
class CreateTituloPessoas < ActiveRecord::Migration def self.up create_table :titulo_pessoas do |t| t.datetime :dataTitulo, :null => false t.integer :titulo_id, :null => false t.integer :pessoa_id, :null => false t.timestamps end puts 'Definindo relacionamento Titulo pessoas => t...
Ruby
class CreateRegiaoFuncoes < ActiveRecord::Migration def self.up create_table :regiao_funcoes do |t| t.integer :pessoa_id, :null => false t.integer :funcao_id, :null => false t.integer :regiao_id, :null => false t.datetime :dataInicial, :null => false t.datetime :dataFim t.time...
Ruby
class CreateSaidas < ActiveRecord::Migration def self.up create_table :saidas do |t| t.string :entidade, :null => false t.integer :codigoEntidade, :null => false t.integer :documento, :null => false t.integer :sequencial, :null => false t.integer :tipoSaida_id, :null => false t...
Ruby
class CreateExtratoContas < ActiveRecord::Migration def self.up create_table :extrato_contas do |t| t.string :entidade, :null => false t.integer :codigoEntidade, :null => false t.string :numeroConta, :null => false t.datetime :data, :null => false t.decimal :valor, :precision => 12, ...
Ruby
class CreateGruposFinanceiros < ActiveRecord::Migration def self.up create_table :grupos_financeiros do |t| t.string :entidade, :null => false t.integer :codigoEntidade, :null => false t.string :descricao t.integer :ordem t.integer :tributavelRemessa t.timestamps end end...
Ruby
class CreateMissas < ActiveRecord::Migration def self.up create_table :missas do |t| t.integer :paroquia_id, :null => false t.string :nome, :null => false t.datetime :data, :null => false t.string :hora, :null => false t.timestamps end puts 'Definindo relacionamento Missas ...
Ruby
class CreateLogomarcas < ActiveRecord::Migration def self.up create_table :logomarcas do |t| t.string :entidade t.integer :codigoEntidade t.text :logo t.timestamps end end def self.down drop_table :logomarcas end end
Ruby
class CreatePessoas < ActiveRecord::Migration def self.up create_table :pessoas do |t| t.integer :idUsuarioCad t.integer :idUsuarioAlt t.string :tratamento t.string :nome, :null => false t.string :apelido t.datetime :dataNascimento, :null => false t.integer :pais_id, :nul...
Ruby
class CreateSetorParoquias < ActiveRecord::Migration def self.up create_table :setor_paroquias do |t| t.integer :paroquia_id, :null => false t.string :nome, :null => false t.timestamps end puts 'Definindo relacionamento Setor Paroquia => Paroquias...' execute "alter table setor_...
Ruby
class CreateParoquias < ActiveRecord::Migration def self.up create_table :paroquias do |t| t.integer :diocese_id, :null => false t.string :nome, :null => false t.string :nomePopular, :null => false t.string :cnpj, :null => false t.string :nomePadroeiro, :null => false t.integer...
Ruby