code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
class AddMissingColumns < ActiveRecord::Migration
def self.up
add_column :centros, :created_at, :datetime
add_column :centros, :updated_at, :datetime
add_column :facturas, :ejecutivo_id, :integer
end
def self.down
remove_column :facturas, :ejecutivo_id
remove_column :centros, :... | Ruby |
class CreateSolicitudMaterialDetalles < ActiveRecord::Migration
def self.up
create_table :solicitud_material_detalles do |t|
t.column :solicitud_material_id, :integer
t.column :material_id, :integer
t.column :cantidad, :integer
t.column :costo_unitario, :decimal
t.column :descripcion... | Ruby |
class AddPuntajeMeserosFechas < ActiveRecord::Migration
def self.up
add_column :puntaje_meseros, :created_at, :datetime
add_column :puntaje_meseros, :updated_at, :datetime
end
def self.down
remove_column :puntaje_meseros, :upated_at
remove_column :puntaje_meseros, :created_at
end
end
| Ruby |
class AddOrdenSalidaTipoPresupuesto < ActiveRecord::Migration
def self.up
add_column :orden_salidas, :tipo_presupuesto_id, :integer
end
def self.down
remove_column :orden_salidas, :tipo_presupuesto_id
end
end
| Ruby |
class CreateCategorias < ActiveRecord::Migration
def self.up
create_table :categorias do |t|
t.column :nombre, :string
t.column :status_id, :string
t.column :created_at, :datetime
t.column :updated_at, :datetime
end
end
def self.down
drop_table :categorias
end
end
| Ruby |
class EmpleadoRemoveColumns < ActiveRecord::Migration
def self.up
remove_column(:empleados, :fecha_nacimiento)
remove_column(:empleados, :estado_civil_id)
end
def self.down
add_column :empleados, :fecha_nacimiento, :date
add_column :empleados, :estado_civil_id, :integer
end
end
| Ruby |
class CreateEntradasCatalogos < ActiveRecord::Migration
def self.up
create_table :entradas_catalogos do |t|
t.column :valor, :string, :null => false, :limit => 40
t.column :esta_activo, :boolean, :default => true
t.column :catalogo_id, :integer
end
end
def self.down
drop_table :entr... | Ruby |
class CreatePresupuestoDetalles < ActiveRecord::Migration
def self.up
create_table :presupuesto_detalles do |t|
t.column :presupuesto_id, :integer
t.column :operacion, :integer
t.column :importe, :decimal, :precision => 12, :scale => 2, :default => 0.0
t.column :referencia, :string
t... | Ruby |
class CreateConvenios < ActiveRecord::Migration
def self.up
create_table :convenios do |t|
t.column :fecha_inicio, :date, :null => false
t.column :duracion, :integer, :null => false
t.column :tipo_participante, :integer, :null => false
t.column :participante_id, :integer, :nu... | Ruby |
class CreateOrdenSalidaDetalles < ActiveRecord::Migration
def self.up
create_table :orden_salida_detalles do |t|
t.column :orden_salida_id, :integer
t.column :producto_id, :integer
t.column :cantidad, :integer
t.column :costo_unitario, :decimal, :precision => 10, :scale => 2
t.column... | Ruby |
class CreatePresupuestoReservas < ActiveRecord::Migration
def self.up
create_table :presupuesto_reservas do |t|
t.column :origen_id, :integer, :default => 0
t.column :destino_id, :integer, :default => 0
t.column :importe, :decimal, :precision => 12, :scale => 2
t.column :created_at, :datet... | Ruby |
class AddSoporteMaterialesRechazo < ActiveRecord::Migration
def self.up
add_column :solicitud_materiales, :motivo_rechazo, :text
end
def self.down
remove_column :solicitud_materiales, :motivo_rechazo
end
end
| Ruby |
class CreateBusquedaCorporativos < ActiveRecord::Migration
def self.up
sql = "CREATE VIEW busqueda_corporativos AS SELECT centros.corporativos.id, centros.corporativos.nombre_comercial, centros.corporativos.razon_social, centros.corporativos.status_id, "+
" centros.corporativos.ejec... | Ruby |
class AddPresenciasTipoPatrocinioId < ActiveRecord::Migration
def self.up
add_column :presencias, :tipo_patrocinio_id, :integer
end
def self.down
remove_column :presencias, :tipo_patrocinio_id
end
end
| Ruby |
class ChangeEvaluacionVentas < ActiveRecord::Migration
def self.up
remove_column :evaluacion_ventas, :venta_copas
remove_column :evaluacion_ventas, :venta_botellas
# indicar si la venta es de copas (1) o botellas (2)
add_column :evaluacion_ventas, :tipo_venta, :integer
# la cantidad de c... | Ruby |
class AddProductosMarcaId < ActiveRecord::Migration
def self.up
add_column :productos, :marca_id, :integer
add_column :productos, :familia_id, :integer
end
def self.down
remove_column :productos, :marca_id
remove_column :productos, :familia_id
end
end
| Ruby |
class AddConcursosCentroId < ActiveRecord::Migration
def self.up
add_column :concursos, :centro_id, :integer
end
def self.down
remove_column :concursos, :centro_id
end
end
| Ruby |
class AddPresenciasTipoPresupuesto < ActiveRecord::Migration
def self.up
# especificar el origen de presupuesto
add_column :concursos, :tipo_presupuesto_id, :integer
add_column :presencias, :tipo_presupuesto_id, :integer
add_column :promociones , :tipo_presupuesto_id, :integer
add_column :salida_m... | Ruby |
class CreatePuntajeCentroConsumos < ActiveRecord::Migration
def self.up
create_table :puntaje_centro_consumos do |t|
t.column :centro_id, :integer
t.column :evaluacion_id, :integer
t.column :operacion, :integer
t.column :puntos, :integer
t.column :created_at, :datetime
t.column... | Ruby |
class CreateFamilias < ActiveRecord::Migration
def self.up
create_table :familias do |t|
t.column :categoria_id, :integer
t.column :empresa_id, :integer
t.column :nombre, :string
t.column :status_id, :integer
t.column :created_at, :datetime
t.column :updated_at, :datetime
e... | Ruby |
class CreatePuntajeMeseros < ActiveRecord::Migration
def self.up
create_table :puntaje_meseros do |t|
t.column :operacion, :integer
t.column :puntos, :integer
t.column :evaluacion_id, :integer
t.column :empleado_id, :integer
end
add_index :puntaje_meseros, :evaluacion_id
a... | Ruby |
class CreateConcursos < ActiveRecord::Migration
def self.up
create_table :concursos do |t|
t.column :fecha_inicio, :date, :null => false
t.column :fecha_termino, :date, :null => false
t.column :status, :integer
t.column :nombre, :string, :null => false
t... | Ruby |
class CreateSalidaMaterialDetalles < ActiveRecord::Migration
def self.up
create_table :salida_material_detalles do |t|
t.column :salida_material_id, :integer
t.column :clave, :string
t.column :descripcion, :string
t.column :cantidad, :integer
t.column :precio, :decimal, :precision =>... | Ruby |
class AddBonificacionesAplicableA < ActiveRecord::Migration
def self.up
add_column :bonificaciones, :aplicable_a, :integer, :default => 1
end
def self.down
remove_column :bonificaciones, :aplicable_a
end
end
| Ruby |
class AddExistenciasUnidadMedida < ActiveRecord::Migration
def self.up
add_column :existencias, :unidad_medida_id, :integer
end
def self.down
remove_column :existencias, :unidad_medida_id
end
end
| Ruby |
class CreateRequisicionProductos < ActiveRecord::Migration
def self.up
create_table :requisicion_productos do |t|
t.column :fecha_autorizacion, :datetime
t.column :fecha_entrega, :datetime
t.column :descripcion, :string
t.column :solicitante_id, :integer
t.column :autorizador_id, :in... | Ruby |
class CreateFacturas < ActiveRecord::Migration
def self.up
create_table :facturas do |t|
t.column :mayorista_id, :integer
t.column :fecha_factura, :date
t.column :referencia, :string
t.column :created_at, :datetime
t.column :updated_at, :datetime
end
end
def... | Ruby |
class CreateBusquedaConcursos < ActiveRecord::Migration
def self.up
sql="CREATE VIEW busqueda_concursos AS SELECT centros.concursos.[id], centros.concursos.tipo, centros.concursos.fecha_inicio, "+
"centros.concursos.fecha_termino, centros.concursos.ejecutivo_id,centros.concursos.nombre, centros.concurso... | Ruby |
class AddBonificacionFamilia < ActiveRecord::Migration
def self.up
add_column :bonificaciones, :familia_id, :integer
end
def self.down
remove_column :bonificaciones, :familia_id
end
end
| Ruby |
class CreateCompromisos < ActiveRecord::Migration
def self.up
create_table :compromisos do |t|
t.column :descripcion, :text
t.column :responsable, :integer, :null => false
t.column :importe, :decimal, :null => true
end
end
def self.down
drop_table :compromisos
end
end
| Ruby |
class AddPresupuestoReservaEjecutivoId < ActiveRecord::Migration
def self.up
add_column :presupuesto_reservas, :ejecutivo_id, :integer, :default => 0
end
def self.down
remove_column :presupuesto_reservas, :ejecutivo_id
end
end
| Ruby |
class CreateMayoristas < ActiveRecord::Migration
def self.up
create_table :mayoristas do |t|
t.column :nombre, :string
end
end
def self.down
drop_table :mayoristas
end
end
| Ruby |
class AddSolicitudMaterialesNombre < ActiveRecord::Migration
def self.up
add_column :solicitud_materiales, :nombre, :string
remove_column :solicitud_materiales, :tipo_presupuesto_id
end
def self.down
remove_column :solicitud_materiales, :nombre
add_column :solicitud_materiales, :tipo_presupuesto_... | Ruby |
class CreateBonificaciones < ActiveRecord::Migration
def self.up
create_table :bonificaciones do |t|
t.column :convenio_id, :integer, :null => false
t.column :marca_id, :integer, :null => false
t.column :porcentaje, :integer, :null => false
t.column :destino, :integer, ... | Ruby |
#!/opt/local/bin/ruby
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impai... | Ruby |
#!/opt/local/bin/ruby
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impai... | Ruby |
#!/opt/local/bin/ruby
#
# You may specify the path to the FastCGI crash log (a log of unhandled
# exceptions which forced the FastCGI instance to exit, great for debugging)
# and the number of requests to process before running garbage collection.
#
# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.lo... | Ruby |
#!/opt/local/bin/ruby
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impai... | Ruby |
#!/opt/local/bin/ruby
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impai... | Ruby |
#!/opt/local/bin/ruby
#
# You may specify the path to the FastCGI crash log (a log of unhandled
# exceptions which forced the FastCGI instance to exit, great for debugging)
# and the number of requests to process before running garbage collection.
#
# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.lo... | Ruby |
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'test_help'
class Test::Unit::TestCase
# Transactional fixtures accelerate your tests by wrapping each test method
# in a transaction that's rolled back on completion. This ensures that the
# test datab... | Ruby |
# Settings specified here will take precedence over those in config/environment.rb
# The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
config.cache_classes = true
# Use a different logger for distributed setups
# config.logger = SyslogLogger.new
# Full error repor... | Ruby |
# Settings specified here will take precedence over those in config/environment.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the webserver when you make code changes.
config.ca... | Ruby |
# Settings specified here will take precedence over those in config/environment.rb
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between... | Ruby |
# Be sure to restart your web server when you modify this file.
# Uncomment below to force Rails into production mode when
# you don't control web/app server and can't set it the proper way
# ENV['RAILS_ENV'] ||= 'production'
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION ... | Ruby |
# Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb
unless defined?(RAILS_ROOT)
root_path = File.join(File.dirname(__FILE__), '..')
unless RUBY_PLATFORM =~ /mswin32/
require 'pathname'
root_path = Pathname.new(root_path).cleanpath(true).to_s
end
RAILS... | Ruby |
ActionController::Routing::Routes.draw do |map|
# The priority is based upon order of creation: first created -> highest priority.
# Sample of regular route:
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
# Keep in mind you can assign values other than :controller and :action
# ... | Ruby |
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
end
| Ruby |
module PacienteHelper
end
| Ruby |
module Catalogo::ParentescoHelper
end
| Ruby |
module Catalogo::EntidadFederativaHelper
end
| Ruby |
module Catalogo::EstadoSaludPacienteHelper
end
| Ruby |
# == Schema Information
# Schema version: 4
#
# Table name: estado_salud_pacientes
#
# id :integer not null, primary key
# descripcion :string(40) not null
#
class EstadoSaludPaciente < ActiveRecord::Base
validates_presence_of :descripcion
validates_length_of :descripcion, :maximum => 40, :on =... | Ruby |
# == Schema Information
# Schema version: 4
#
# Table name: parentescos
#
# id :integer not null, primary key
# descripcion :string(20) not null
#
class Parentesco < ActiveRecord::Base
validates_presence_of :descripcion
validates_length_of :descripcion, :maximum => 20, :on => :save
end
| Ruby |
# == Schema Information
# Schema version: 4
#
# Table name: pacientes
#
# id :integer not null, primary key
# nombre_s :string(40) not null
# apellido_s :string(40) not null
# edad :string(3) not null
# sexo ... | Ruby |
# == Schema Information
# Schema version: 4
#
# Table name: entidad_federativas
#
# id :integer not null, primary key
# codigo :string(2) not null
# nombre :string(20) not null
#
class EntidadFederativa < ActiveRecord::Base
validates_presence_of :codigo, :nombre, :on => :create
validates_length... | Ruby |
class PacienteController < ApplicationController
def index
list
render :action => 'list'
end
# GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
verify :method => :post, :only => [ :destroy, :create, :update ],
:redirect_to => { :action => :list }
def list
@paci... | Ruby |
class Catalogo::EntidadFederativaController < ApplicationController
def index
list
render :action => 'list'
end
# GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
verify :method => :post, :only => [ :destroy, :create, :update ],
:redirect_to => { :action => :list }
... | Ruby |
class Catalogo::ParentescoController < ApplicationController
def index
list
render :action => 'list'
end
# GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
verify :method => :post, :only => [ :destroy, :create, :update ],
:redirect_to => { :action => :list }
def li... | Ruby |
class Catalogo::EstadoSaludPacienteController < ApplicationController
def index
list
render :action => 'list'
end
# GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
verify :method => :post, :only => [ :destroy, :create, :update ],
:redirect_to => { :action => :list }
... | Ruby |
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
# Pick a unique cookie name to distinguish our session data from others'
session :session_key => '_burrito_se... | Ruby |
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'tasks/rails'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/breakpointer' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/console' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/runner' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/performance/benchmarker'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/performance/benchmarker'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/performance/profiler'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/performance/profiler'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/plugin' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/destroy' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/about' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/runner' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/breakpointer' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/server' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/generate' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/console' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/process/reaper'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/process/inspector'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/process/inspector'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/process/spawner'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/process/reaper'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/process/spawner'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/destroy' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/generate' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/server' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/about' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/plugin' | Ruby |
class CreatePacientes < ActiveRecord::Migration
def self.up
create_table :pacientes do |t|
t.column :nombre_s, :string, :limit => 40, :null => false
t.column :apellido_s, :string, :limit => 40, :null => false
t.column :edad, :string, :limit => 3, :null => false
t.column :... | Ruby |
class CreateEstadoSaludPacientes < ActiveRecord::Migration
def self.up
create_table :estado_salud_pacientes do |t|
t.column :descripcion, :string, :limit => 40, :null => false
end
end
def self.down
drop_table :estado_salud_pacientes
end
end
| Ruby |
class CreateEntidadFederativas < ActiveRecord::Migration
def self.up
create_table :entidad_federativas do |t|
t.column :codigo, :string, :limit => 2, :null => false
t.column :nombre, :string, :limit => 20, :null => false
end
end
def self.down
drop_table :entidad_federativas
end
e... | Ruby |
class CreateParentescos < ActiveRecord::Migration
def self.up
create_table :parentescos do |t|
t.column :descripcion, :string, :limit => 20, :null => false
end
end
def self.down
drop_table :parentescos
end
end
| Ruby |
#!/usr/bin/ruby
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
re... | Ruby |
#!/usr/bin/ruby
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
re... | Ruby |
#!/usr/bin/ruby
#
# You may specify the path to the FastCGI crash log (a log of unhandled
# exceptions which forced the FastCGI instance to exit, great for debugging)
# and the number of requests to process before running garbage collection.
#
# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
# an... | Ruby |
#!/usr/bin/ruby
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
re... | Ruby |
#!/usr/bin/ruby
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
re... | Ruby |
#!/usr/bin/ruby
#
# You may specify the path to the FastCGI crash log (a log of unhandled
# exceptions which forced the FastCGI instance to exit, great for debugging)
# and the number of requests to process before running garbage collection.
#
# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
# an... | Ruby |
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'test_help'
class Test::Unit::TestCase
# Transactional fixtures accelerate your tests by wrapping each test method
# in a transaction that's rolled back on completion. This ensures that the
# test datab... | Ruby |
#
# To change this template, choose Tools | Templates
# and open the template in the editor.
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
| Ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.