code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
class EvaluacionVenta < ActiveRecord::Base
belongs_to :evaluacion
COPAS = 1
BOTELLAS = 2
DESCRIPCION = {
COPAS => 'Copas', BOTELLAS => 'Botellas'
}
validates_presence_of :participante_id, :marca_id
validates_numericality_of :cantidad, :tipo_venta
end
| Ruby |
class AutorizarController < ApplicationController
def list
ejecutivo = Ejecutivo.find(session[:user])
children = find_children_ids(ejecutivo)
# requisiciones de producto
conditions = {}
conditions[:solicitante_id] = children
conditions[:status_requisicion_id] = RequisicionProducto::SOLIC... | Ruby |
class ProductoController < ApplicationController
# 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 index
list
render :action => 'list'
end
def list
@pro... | Ruby |
class MayoristaController < ApplicationController
# 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 index
list
render :action => 'list'
end
def list
@ma... | Ruby |
class Concurso::PremioController < ApplicationController
def list
conditions = {}
conditions[:tipo] = Concurso::PREMIOS
conditions[:status_id] = 1
if !perfil_nacional?
conditions[:ejecutivo_id] = session[:user]
end
@concursos = Concurso.paginate :page => params[:page], ... | Ruby |
class Concurso::VentaController < ApplicationController
def new
@concurso = Concurso.new
@concurso.concurso_ventas << ConcursoVenta.new
@marcas = Familia.cuervo
ejecutivo = Ejecutivo.find(session[:user])
@centros = ejecutivo.centros
end
def create
@concurso = Concurso.new(param... | Ruby |
class Concurso::ObjetivoController < ApplicationController
def index
list
render :action => "list"
end
def new
@concurso = Concurso.new
ConcursoObjetivo::DESCRIPCIONES.each do |d|
@concurso.concurso_objetivos << ConcursoObjetivo.new(:objetivo => d)
end
ejecutivo = Ejecutivo.find(... | Ruby |
class PresenciaController < ApplicationController
def list
conditions = {}
conditions[:ejecutivo_id] = session[:user]
@presencias = Presencia.paginate :page => params[:page], :per_page => DEFAULT_PER_PAGE, :conditions => conditions, :order => 'id'
if mando_medio?
conditions = {}
... | Ruby |
class Centro::PersonalController < ApplicationController
# 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
conditions = {}
conditions[:centro_id] = params[:id]
... | Ruby |
class EmpresaController < ApplicationController
def index
list
redirect_to :action => "list"
end
def list
@empresas = Empresa.paginate :page => params[:page], :per_page => DEFAULT_PER_PAGE, :order => 'nombre'
end
def edit
@empresa = Empresa.find(params[:id])
end
def new
@emp... | Ruby |
class PresupuestoController < ApplicationController
def list
conditions = {}
conditions[:ejecutivo_id] = session[:user]
@presupuestos = Presupuesto.paginate :page => params[:page], :per_page => DEFAULT_PER_PAGE, :conditions => conditions, :order => 'marca_id, rubro_id'
end
def new
@pre... | Ruby |
class PromocionController < ApplicationController
def list
conditions = {}
conditions[:ejecutivo_id] = session[:user]
@promociones = Promocion.paginate :page => params[:page], :per_page => DEFAULT_PER_PAGE, :conditions => conditions
end
def new
@promocion = Promocion.new
@promocion... | Ruby |
class MaterialController < ApplicationController
def index
list
render :action => "list"
end
def list
ejecutivo_id = session[:user]
conditions = {}
conditions[:ejecutivo_id] = ejecutivo_id
@salidas_material = SalidaMaterial.paginate :page => params[:page], :per_page => DEFAUL... | Ruby |
class MarcaController < ApplicationController
def index
list
render :action => 'list'
end
def edit
@marca = Marca.find(params[:id])
populate_collections
end
def list
@marcas = Marca.paginate :page => params[:page], :per_page => DEFAULT_PER_PAGE, :order => 'nombre'
end
def sh... | Ruby |
class Personal::EjecutivoController < ApplicationController
require 'csv'
def index
if perfil_nacional?
nacional
render :action => 'list'
elsif perfil_asistente?
asistente
render :action => 'list'
else
list
render :action => 'list'
end
end
# GETs shou... | Ruby |
class CorporativosController < 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
ejecut... | Ruby |
class ConvenioController < ApplicationController
# 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 index
if perfil_asistente?
asistente
render :action ... | Ruby |
class CatalogoController < 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
@cata... | Ruby |
class AlmacenController < ApplicationController
def index
@almacenes = Almacen.paginate :page => params[:page], :per_page => DEFAULT_PER_PAGE, :order => 'nombre'
end
def new
@almacen = Almacen.new
@status = Catalogo.find_by_nombre('Status Items').entradas_catalogo
end
def create
@almac... | Ruby |
class FamiliaController < ApplicationController
def index
list
render :action => "list"
end
def list
@familias = Familia.paginate :page => params[:page], :per_page => DEFAULT_PER_PAGE, :order => 'nombre'
end
def edit
@familia = Familia.find(params[:id])
populate_collections
end... | Ruby |
class Salida::PresenciaController < ApplicationController
def producto
@presencia = Presencia.find(params[:id])
@orden = OrdenSalida.new
@orden.centro = Centro.find(@presencia.centro_id)
@orden.centro_id = @presencia.centro_id
@orden.ejecutivo = Ejecutivo.find(session[:user])
@orden.referen... | Ruby |
class Salida::PromocionController < ApplicationController
def producto
@promocion = Promocion.find(params[:id])
@orden = OrdenSalida.new
@orden.centro_id = @promocion.centro_id
@orden.ejecutivo_id = session[:user]
@orden.referencia_id = params[:id]
@orden.tipo_referencia = OrdenSalida::TIPO_R... | Ruby |
class Salida::ConcursoController < ApplicationController
def new
@concurso = Concurso.find(params[:id])
@orden = OrdenSalida.new
centro = Centro.find(@concurso.centro_id)
@empleados = centro.empleados
@orden.centro_id = @concurso.centro_id
@orden.referencia_id = params[:id]
@orden.tipo_re... | Ruby |
class Salida::BonificacionController < ApplicationController
def list
end
def index
list
render :action => "list"
end
def new
@orden = OrdenSalida.new
ejecutivo = Ejecutivo.find(session[:user])
@centros = ejecutivo.centros
@presupuestos = Catalogo.find_by_nombre('Origen Pre... | Ruby |
class Catalogo::EntradasController < 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 lis... | Ruby |
class CategoriaController < ApplicationController
def index
list
render :action => "list"
end
def list
@categorias = Categoria.paginate :page => params[:page], :per_page => DEFAULT_PER_PAGE, :order => 'nombre'
end
def edit
@categoria = Categoria.find(params[:id])
end
def update
... | Ruby |
class CentroController < ApplicationController
require 'csv'
auto_complete_for :centro, :nombre_comercial
def index
if perfil_director?
logger.debug "Vista como Director"
ordered
render :action => 'ordered'
elsif gerente_op?
logger.debug "Vista como Gerente OP"
nac... | Ruby |
class MovimientoController < ApplicationController
def index
conditions = {}
conditions[:user_id] = session[:user]
@movimientos = MovimientoAlmacen.paginate :page => params[:page],
:per_page => DEFAULT_PER_PAGE, :order => 'id', :conditions => conditions
end
def entrada
@movimient... | Ruby |
class RequisicionController < ApplicationController
def index
# ejecutivo
if perfil_ejecutivo?
ejecutivo
elsif mando_medio?
mando_medio
elsif perfil_asistente?
asistente
render :action => 'asistente'
elsif perfil_captura?
else
@re... | Ruby |
class ListaPrecioController < ApplicationController
# 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 index
list
render :action => 'list'
end
def li... | Ruby |
class LoginController < ApplicationController
def authenticate
ejecutivo = Ejecutivo.authenticate(params[:usuario].to_s, params[:clave].to_s)
# ejecutivo = Ejecutivo.authenticate('rpadilla', 'dummy')
# ejecutivo = Ejecutivo.authenticate('darnauda', 'dummy')
unless ejecutivo.blank?
session... | 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 => '_catalogos_... | Ruby |
class Evaluacion::PremioController < ApplicationController
def list
@concurso = Concurso.find(params[:id])
opciones = {}
opciones[:concurso_id] = params[:id]
if !perfil_nacional?
opciones[:ejecutivo_id] = session[:user]
end
@evaluaciones = Evaluacion.paginate :page => p... | Ruby |
class Evaluacion::VentaController < ApplicationController
def list
@concurso = Concurso.find(params[:id])
opciones = {}
opciones[:concurso_id] = params[:id]
if !perfil_nacional?
opciones[:ejecutivo_id] = session[:user]
end
@evaluaciones = Evaluacion.paginate :page => pa... | Ruby |
class Evaluacion::ObjetivoController < ApplicationController
def list
@concurso = Concurso.find(params[:id])
conditions = {}
conditions[:concurso_id] = params[:id]
if !perfil_nacional?
conditions[:ejecutivo_id] = session[:user]
end
@evaluaciones = Evaluacion.paginate :page => ... | Ruby |
class FacturaController < ApplicationController
def index
list
render :action => 'list'
end
def list
@facturas = Factura.paginate :page => params[:page], :per_page => DEFAULT_PER_PAGE, :order => 'fecha_factura DESC'
end
def new
@factura = Factura.new(:referencia => nil,
:ejecutivo_id... | Ruby |
class SalidaController < ApplicationController
def list
if perfil_nacional?
@ordenes = OrdenSalida.paginate :page => params[:page], :per_page => DEFAULT_PER_PAGE, :order => 'created_at DESC'
else
ejecutivos = find_children_ids(Ejecutivo.find(session[:user]))
conditions = [
"eje... | 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 AddBonificacionDetalleReferencias < ActiveRecord::Migration
def self.up
add_column :bonificacion_detalles, :partida_id, :integer
add_column :bonificacion_detalles, :fecha_bonificacion, :datetime
end
def self.down
remove_column :bonificacion_detalles, :partida_id
remove_column :bonificacion_... | Ruby |
class CreateApoyoProductos < ActiveRecord::Migration
def self.up
create_table :apoyo_productos do |t|
t.column :promocion_id, :integer
t.column :producto_id, :integer
t.column :cantidad, :integer
end
end
def self.down
drop_table :apoyo_productos
end
end
| Ruby |
class CreateBusquedaConvenios < ActiveRecord::Migration
def self.up
sql = "CREATE VIEW busqueda_convenios AS SELECT centros.convenios.id, centros.convenios.fecha_inicio, centros.convenios.fecha_termino, centros.convenios.tipo_participante, "+
"centros.convenios.participante_id, centros.convenios.ejecuti... | Ruby |
class AddPdfsStoredProcedures < ActiveRecord::Migration
def self.up
execute "CREATE PROCEDURE [centros].[DetalleBonificacionesConvenio] \n" +
"@ConvenioId int = -1 \n" +
"AS BEGIN \n" +
"SET NOCOUNT ON \n" +
" SELECT centros.entradas_catalogos.valor AS Marca, centros.bonificaciones.porcent... | Ruby |
class AddCentroMarcaBanderaId < ActiveRecord::Migration
def self.up
add_column :centros, :marca_bandera_id, :integer
end
def self.down
remove_column :centros, :marca_bandera_id
end
end
| Ruby |
class AddDiversasColumnas < ActiveRecord::Migration
def self.up
add_column :productos, :empresa, :integer
add_column :detalle_facturas, :cajas_9lt, :decimal, :scale => 2, :precision => 10
end
def self.down
remove_column :detalle_facturas, :cajas_9lt
remove_column :productos, :empresa
end
end
| Ruby |
class AddConveniosFechas < ActiveRecord::Migration
def self.up
add_column :convenios, :created_at, :datetime
add_column :convenios, :updated_at, :datetime
end
def self.down
remove_column :convenios, :updated_at
remove_column :convenios, :created_at
end
end
| Ruby |
class AddConcursoPremiosConcursoId < ActiveRecord::Migration
def self.up
add_column :concurso_premios, :concurso_id, :integer
end
def self.down
remove_column :concurso_premios, :concurso_id
end
end
| Ruby |
class CreateItemMovimientos < ActiveRecord::Migration
def self.up
create_table :item_movimientos do |t|
t.column :movimiento_almacen_id, :integer
t.column :cantidad, :integer
t.column :unidad_medida_id, :integer
t.column :producto_id, :integer
t.column :created_at, :datetime
t.... | Ruby |
class CreateListaPrecios < ActiveRecord::Migration
def self.up
create_table :lista_precios do |t|
t.column :producto_id, :integer
t.column :litraje_mls, :integer
t.column :precio_normal, :decimal
t.column :precio_minimo, :decimal
t.column :precio_maximo, :decimal
end
... | Ruby |
class CreatePromociones < ActiveRecord::Migration
def self.up
create_table :promociones do |t|
t.column :centro_id, :integer
t.column :ejecutivo_id, :integer
t.column :fecha_evento, :datetime
t.column :tipo_evento_id, :integer
t.column :nombre, :string
t.column :marca_id, :inte... | Ruby |
class RemoveCentroEspecialidadId < ActiveRecord::Migration
def self.up
remove_column :centros, :especialidad_id
end
def self.down
add_column :centros, :especialidad_id, :integer
end
end
| Ruby |
class AddConvenioFechaTermino < ActiveRecord::Migration
def self.up
add_column :convenios, :fecha_termino, :datetime
end
def self.down
remove_column :convenios, :fecha_termino
end
end
| Ruby |
class UpdateFacturasFechaProceso < ActiveRecord::Migration
def self.up
add_column :facturas, :fecha_proceso, :datetime
add_column :detalle_facturas, :fecha_proceso, :datetime
end
def self.down
remove_column :facturas, :fecha_proceso
remove_column :detalle_facturas, :fecha_proceso
end
end
| Ruby |
class CreateSolicitudMateriales < ActiveRecord::Migration
def self.up
create_table :solicitud_materiales do |t|
t.column :presencia_id, :integer
t.column :centro_id, :integer
t.column :marca_id, :integer
t.column :tipo_presupuesto_id, :integer
t.column :descripcion, :text
... | Ruby |
class AddEvaluacionObjetivosPuntosAsignados < ActiveRecord::Migration
def self.up
add_column :evaluacion_objetivos, :puntos_asignados, :integer
end
def self.down
remove_column :evaluacion_objetivos, :puntos_asignados
end
end
| Ruby |
class AddConveniosEjecutivo < ActiveRecord::Migration
def self.up
add_column :convenios, :ejecutivo_id, :integer
end
def self.down
remove_column :convenios, :ejecutivo_id
end
end
| Ruby |
class CreateCanjeDetalles < ActiveRecord::Migration
def self.up
create_table :canje_detalles do |t|
t.column :canje_id, :integer
t.column :producto_id, :integer
t.column :puntos_canje, :integer
t.column :precio, :decimal, :precision => 10, :scale => 2
t.column :costo, :decimal, :prec... | Ruby |
class CreatePresencias < ActiveRecord::Migration
def self.up
create_table :presencias do |t|
t.column :centro_id, :integer
t.column :marca_id, :integer
t.column :tipo_presupuesto_id, :integer
t.column :descripcion, :text
t.column :ejecutivo_id, :integer
t.column :importe_... | Ruby |
class AddOrdenSalidaPresupuestosOrdenId < ActiveRecord::Migration
def self.up
add_column :orden_salida_presupuestos, :orden_salida_id, :integer
end
def self.down
remove_column :orden_salida_presupuestos, :orden_salida_id
end
end
| Ruby |
class CreateBusquedaFacturas < ActiveRecord::Migration
def self.up
sql = "CREATE VIEW busqueda_facturas AS SELECT centros.facturas.id, centros.facturas.fecha_factura, centros.facturas.referencia, centros.centros.nombre_comercial AS centro_consumo, " +
"centros.mayoristas.nombre AS mayorista, ISNULL(centros.facturas.r... | Ruby |
class AddEntradasCatalogosAlternateId < ActiveRecord::Migration
def self.up
add_column :entradas_catalogos, :alternate_id, :integer, :null => true, :default => nil
end
def self.down
remove_column :entradas_catalogos, :alternate_id
end
end
| Ruby |
class CreateApoyoMateriales < ActiveRecord::Migration
def self.up
create_table :apoyo_materiales do |t|
t.column :material_id, :integer
t.column :costo_unitario, :decimal
t.column :cantidad, :integer
t.column :promocion_id, :integer
end
end
def self.down
drop_table :apoyo_mate... | Ruby |
class AddEmpleadosNumeroEmpleado < ActiveRecord::Migration
def self.up
add_column :ejecutivos, :numero_empleado, :string
end
def self.down
remove_column :ejecutivos, :numero_empleado
end
end
| Ruby |
class AddCentroEmpleados < ActiveRecord::Migration
def self.up
add_column :empleados, :centro_id, :integer, :default => nil
end
def self.down
remove_column :empleados, :centro_id
end
end
| Ruby |
class CreateBusquedaCentros < ActiveRecord::Migration
def self.up
sql = "CREATE VIEW busqueda_centros AS SELECT centros.centros.id, centros.centros.ejecutivo_id, centros.centros.nombre_comercial, centros.centros.razon_social, centros.centros.nombre_contacto, " +
"ISNULL(centros.centros.nombre_comercial... | Ruby |
class CreateProductos < ActiveRecord::Migration
def self.up
create_table :productos do |t|
t.column :descripcion, :string
t.column :sociedad_id, :integer
t.column :grupo_articulo_id, :integer
end
end
def self.down
drop_table :productos
end
end
| Ruby |
class CreateEvaluacionObjetivos < ActiveRecord::Migration
def self.up
create_table :evaluacion_objetivos do |t|
t.column :evaluacion_id, :integer
t.column :objetivo, :string
t.column :puntos_otorgados, :integer
end
end
def self.down
drop_table :evaluacion_objetivos
end
end
| Ruby |
class CreatePresupuestos < ActiveRecord::Migration
def self.up
create_table :presupuestos do |t|
t.column :centro_id, :integer
t.column :ejecutivo_id, :integer
t.column :marca_id, :integer
t.column :rubro_id, :integer
t.column :saldo_inicial, :decimal, :precision => 12, :scale => 2, ... | Ruby |
class UpdateDetalleFacturasColumns < ActiveRecord::Migration
def self.up
# quitar columnas obsoletas
remove_column :detalle_facturas, :precio_unitario
remove_column :detalle_facturas, :litraje_mls
#agregar nuevas columnas requeridas
add_column :detalle_facturas, :precio_venta, :decimal, :prec... | Ruby |
class CreateCorporativos < ActiveRecord::Migration
def self.up
create_table :corporativos do |t|
t.column :nombre_comercial, :string, :limit => 40, :null => false
t.column :razon_social, :string, :limit => 40, :null => false
t.column :rfc, :string, :limit => 15, :null => false
t.column :fe... | Ruby |
class RemoveListaPrecios < ActiveRecord::Migration
def self.up
drop_table :lista_precios
end
def self.down
create_table :lista_precios do |t|
t.column :producto_id, :integer
t.column :litraje_mls, :integer
t.column :precio_normal, :decimal
t.column :precio_minimo, :decimal... | Ruby |
class CreateBusquedaOrdenSalidas < ActiveRecord::Migration
def self.up
sql="CREATE VIEW busqueda_orden_salidas AS SELECT centros.orden_salidas.id, centros.orden_salidas.centro_id, centros.centros.nombre_comercial, "+
"centros.orden_salidas.tipo_referencia,centros.orden_salidas.referencia_id, centros.orden_s... | Ruby |
class AddProductosClaveIndex < ActiveRecord::Migration
def self.up
add_index :productos, :clave
end
def self.down
remove_index :productos, :clave
end
end
| Ruby |
class AddPresenciaExhibicionesCosto < ActiveRecord::Migration
def self.up
add_column :presencia_exhibiciones, :costo, :decimal, :precision => 10, :scale => 2
add_column :presencia_exhibiciones, :precio, :decimal, :precision => 10, :scale => 2
end
def self.down
remove_column :presencia_exhibicio... | Ruby |
class AddProductosPresentacionId < ActiveRecord::Migration
def self.up
add_column :productos, :presentacion_id, :integer
end
def self.down
remove_column :productos, :presentacion_id
end
end
| Ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.