code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
class ConcursoPremio < ActiveRecord::Base
belongs_to :concurso
validates_presence_of :lugar, :premio_id
end
| Ruby |
#
# To change this template, choose Tools | Templates
# and open the template in the editor.
require 'pdf/writer'
require 'pdf/simpletable'
class ConvenioPdf
def initialize(convenio_id)
@pdf = PDF::Writer.new(:paper => 'LETTER')
@convenio = Convenio.find(convenio_id)
@pdf.select_font("Times-Roman",... | Ruby |
class DetalleFactura < ActiveRecord::Base
attr_accessor :should_destroy
belongs_to :factura
has_one :bonificacion_detalle
validates_presence_of :producto_id, :unidades
validates_numericality_of :unidades, :only_integer => true
def should_destroy?
should_destroy.to_i == 1
end
end
| Ruby |
class Presupuesto < ActiveRecord::Base
has_many :presupuesto_detalles, :order => 'created_at'
has_many :cargos, :class_name => 'PresupuestoDetalle', :conditions => 'operacion = #{PresupuestoDetalle::CARGO}'
has_many :abonos, :class_name => 'PresupuestoDetalle', :conditions => 'operacion = #{PresupuestoDetalle::AB... | Ruby |
class Presencia < ActiveRecord::Base
belongs_to :centro
belongs_to :ejecutivo
has_many :presencia_exhibiciones
has_many :presencia_materiales
has_one :solicitud_material
validates_presence_of :centro_id, :marca_id, :ejecutivo_id, :descripcion
validates_presence_of :nombre
def consecutivo
"%... | Ruby |
class BusquedaOrdenSalida < ActiveRecord::Base
def consecutivo
"%06d" % id + '/' + created_at.strftime("%Y")
end
end
| Ruby |
class PresenciaMaterial < ActiveRecord::Base
belongs_to :presencia
validates_presence_of :material_id, :cantidad, :costo_unitario
validates_numericality_of :cantidad, :costo_unitario
def importe
unless cantidad.blank? && costo_unitario.blank?
cantidad * costo_unitario
else
0
end
... | Ruby |
class Catalogo < ActiveRecord::Base
validates_presence_of :nombre, :on => :create
validates_uniqueness_of :nombre, :on => :create
has_many :entradas_catalogo, :order => 'valor'
def self.name_value(nombre)
Catalogo.find_by_nombre(nombre).entradas_catalogo.each { |e| [e.id, e.valor]}
end
# encuentra el... | Ruby |
class OrdenSalidaDetalle < ActiveRecord::Base
belongs_to :orden_salida
validates_presence_of :producto_id, :cantidad, :costo_unitario, :precio_ieps
validates_presence_of :precio_publico
validates_numericality_of :costo_unitario, :precio_ieps, :precio_publico, :cantidad
before_save :actualizar_importes
... | Ruby |
class Empleado < ActiveRecord::Base
belongs_to :centro
has_many :puntaje_meseros
validates_presence_of :nombre, :primer_apellido, :puesto_id, :on => :create
validates_length_of :nombre, :primer_apellido, :maximum => 40, :on => :create
def nombre_completo
"#{nombre} #{primer_apellido} #{segundo_apellid... | Ruby |
class CanjeDetalle < ActiveRecord::Base
belongs_to :canje
end
| Ruby |
class SalidaMaterial < ActiveRecord::Base
belongs_to :ejecutivo
belongs_to :centro
has_many :salida_material_detalles
validates_presence_of :ejecutivo_id, :centro_id
def consecutivo
"%06d" % id + '/' + created_at.strftime("%Y")
end
def detalles_attributes=(detalles_attributes)
det... | Ruby |
class ApoyoProducto < ActiveRecord::Base
belongs_to :promocion
validates_presence_of :producto_id, :cantidad
validates_numericality_of :cantidad
end
| Ruby |
#
# To change this template, choose Tools | Templates
# and open the template in the editor.
class CalculaBonificacion
def initialize
end
def calcular
convenios = convenios_vigentes(Time.now, Convenio::CENTRO_CONSUMO)
convenios.each do |convenio|
puts "Obteniendo facturas sin procesar para ... | Ruby |
class Empresa < ActiveRecord::Base
has_many :familias
has_many :marcas
has_many :productos
validates_presence_of :nombre
end
| Ruby |
class Bonificacion < ActiveRecord::Base
belongs_to :convenio
BOLSA=1
ESPECIE=2
DESTINO = {
"Bolsa" => BOLSA,
"Especie" => ESPECIE
}
validates_presence_of :familia_id, :porcentaje, :destino
validates_numericality_of :porcentaje
end
| Ruby |
class SalidaMaterialDetalle < ActiveRecord::Base
belongs_to :salida_material
validates_presence_of :descripcion, :cantidad
validates_numericality_of :cantidad, :precio
end
| Ruby |
class Ejecutivo < ActiveRecord::Base
has_many :centros, :conditions => {:status_id => 1}, :order => 'nombre_comercial'
has_many :corporativos, :conditions => {:status_id => 1}
has_many :convenios, :conditions => {:status_id => 1}
has_many :presupuestos, :conditions => {:status_id => 1}
has_many :concursos, :c... | Ruby |
class ConcursoVenta < ActiveRecord::Base
belongs_to :concurso
before_save :calcula_puntos_botella
validates_presence_of :marca_id
validates_numericality_of :puntos_copa, :puntos_botella, :allow_nil => true
def calcula_puntos_botella
self.puntos_botella = self.puntos_copa * DEFAULT_COPAS_BOTELLA
... | Ruby |
class Mayorista < ActiveRecord::Base
has_one :factura
validates_presence_of :nombre
end
| Ruby |
class Convenio < ActiveRecord::Base
has_many_with_attributes :bonificaciones
has_many_with_attributes :compromisos
belongs_to :ejecutivo
validates_presence_of :fecha_inicio, :fecha_termino, :participante_id
CENTRO_CONSUMO = 1
CORPORATIVO = 2
# estados
NUEVO = 1
AUTORIZADO = 2
VIGENTE = 3
... | Ruby |
#
# To change this template, choose Tools | Templates
# and open the template in the editor.
class UnidadMedida
CAJA = 0
BOTELLA = 1
UNIDADES_MEDIDA = {
'Caja' => CAJA,
'Botella' => BOTELLA
}
end
| Ruby |
class EvaluacionPremio < ActiveRecord::Base
belongs_to :evaluacion
validates_presence_of :participante_id, :marca_id, :venta_copas
validates_numericality_of :venta_copas
end
| Ruby |
class BusquedaConvenio < ActiveRecord::Base
def consecutivo
"%06d" % id + '/' + fecha_inicio.strftime("%Y")
end
end
| Ruby |
class ConcursoObjetivo < ActiveRecord::Base
belongs_to :concurso
DESCRIPCIONES = [
'Stock de Tradicional congelado',
'Batallas y/o cocteleria con JCE, App, W. y V. Smir.',
'Hoja pegada del Concurso',
'Exhibicion especial en Barra o Contrabarra',
'Dobel y Agavero en carro de Licores',
'Congelador de Tradicional',
'B... | Ruby |
class BonificacionDetalle < ActiveRecord::Base
belongs_to :centro
belongs_to :detalle_factura, :foreign_key => 'partida_id'
INICIAL = 1
ABONO = 2
CARGO = 3
TIPO_REFERENCIA = {
:bonificacion_especie => 1,
:orden_salida => 2,
:bonificacion_bolsa => 3
}
REFERENCIA = {
1 => 'Bonific... | Ruby |
class SolicitudMaterialDetalle < ActiveRecord::Base
belongs_to :solicitud_material
validates_presence_of :material_id, :cantidad, :costo_unitario
validates_numericality_of :cantidad, :costo_unitario
def importe
unless cantidad.blank? && costo_unitario.blank?
cantidad * costo_unitario
else
... | Ruby |
class PuntajeCentroConsumo < ActiveRecord::Base
belongs_to :evaluacion
belongs_to :centro
CARGO = 2
ABONO = 1
validates_presence_of :evaluacion_id, :centro_id, :puntos, :operacion
validates_numericality_of :puntos, :operacion
end
| Ruby |
class RequisicionProducto < ActiveRecord::Base
SOLICITADA = 0
AUTORIZADA = 1
ENTREGADA = 2
RECHAZADA = 3
STATUS_REQUISICION = {
"Solicitada" => SOLICITADA,
"Autorizada" => AUTORIZADA,
"Entregada" => ENTREGADA,
"Rechazada" => RECHAZADA
}
has_many_with_attributes :item_requisiciones... | Ruby |
class EntradasCatalogo < ActiveRecord::Base
validates_presence_of :valor, :on => :create
validates_uniqueness_of :valor, :on => :create, :scope => [ :valor, :parent_value_id ]
belongs_to :catalogo
end
| Ruby |
class BusquedaCentro < ActiveRecord::Base
end
| Ruby |
class OrdenSalidaPresupuesto < ActiveRecord::Base
belongs_to :orden_salida
belongs_to :presupuesto
validates_presence_of :presupuesto_id, :disponible
validates_numericality_of :disponible
end
| Ruby |
class Evaluacion < ActiveRecord::Base
belongs_to :concurso
has_many :evaluacion_ventas, :order => 'participante_id, marca_id'
has_many :evaluacion_premios, :order => 'participante_id, marca_id'
has_many :evaluacion_objetivos
has_many :puntaje_meseros
has_many :puntaje_centro_consumos
has_many :canjes
... | Ruby |
class Centro < ActiveRecord::Base
has_many :empleados, :conditions => {:status_id => 1}
has_many :facturas, :conditions => {:status_id => 1}
has_many :concursos, :conditions => {:status_id => 1}
has_many :promociones, :conditions => {:status_id => 1}
has_many :presencias, :conditions => {:status_id => 1}
ha... | Ruby |
class OrdenSalida < ActiveRecord::Base
belongs_to :ejecutivo
belongs_to :centro
has_many :orden_salida_detalles
has_many :orden_salida_presupuestos
TIPO_REFERENCIA = {
:bonificacion_especie => 1,
:evaluacion => 2,
:presencia => 3,
:promocion => 4
}
REFERENCIA = {
1 => 'Bonificaci... | Ruby |
class Promocion < ActiveRecord::Base
belongs_to :centro
has_many :apoyo_productos
has_many :apoyo_materiales
validates_presence_of :fecha_evento, :tipo_evento_id, :nombre, :marca_id
validates_presence_of :contacto_cdc_nombre
validates_presence_of :descripcion
def consecutivo
"%06d" % id + '/' ... | Ruby |
class Categoria < ActiveRecord::Base
has_many :familias
has_many :marcas
has_many :productos
validates_presence_of :nombre
end
| Ruby |
class ItemMovimiento < ActiveRecord::Base
belongs_to :movimiento_almacen
validates_numericality_of :cantidad, :only_integer => true, :greater_than => 0
validates_presence_of :producto_id, :unidad_medida_id
after_save :item_guardado
def unidad_medida
UnidadMedida::UNIDADES_MEDIDA.invert[unidad_med... | Ruby |
class BusquedaPromocion < ActiveRecord::Base
def consecutivo
"%06d" % id + '/' + fecha_evento.strftime("%Y")
end
end
| Ruby |
class PresupuestoReserva < ActiveRecord::Base
validates_presence_of :origen_id, :destino_id, :importe
validates_numericality_of :importe
end
| Ruby |
class MovimientoAlmacen < ActiveRecord::Base
belongs_to :almacen
has_many_with_attributes :item_movimientos
ENTRADA = 0
SALIDA = 1
TIPO_MOVIMIENTO = {
'Entrada' => ENTRADA,
'Salida' => SALIDA
}
def consecutivo
"%06d" % id + '/' + created_at.strftime("%Y")
end
def tipo_movimiento... | Ruby |
class Corporativo < ActiveRecord::Base
belongs_to :ejecutivo
has_many :centros, :conditions => {:status_id => 1}
validates_presence_of :nombre_comercial, :razon_social, :rfc, :calle, :num_exterior, :codigo_postal, :colonia, :ciudad, :on => :create
validates_presence_of :estado_id, :on => :create
validat... | Ruby |
class Marca < ActiveRecord::Base
belongs_to :familia
belongs_to :categoria
belongs_to :empresa
has_many :productos, :conditions => {:status_id => 1}
validates_presence_of :familia_id, :categoria_id, :nombre,
:empresa_id
validates_numericality_of :familia_id, :categoria_id, :empresa_id
def sel... | Ruby |
class Factura < ActiveRecord::Base
has_many :detalle_facturas
belongs_to :mayorista
belongs_to :centro
before_save :actualiza_info_detalle
after_update :guardar_detalles
validates_presence_of :mayorista_id, :centro_id, :fecha_factura,
:referencia, :user_id
validates_uniqueness_of :referencia,... | Ruby |
class BusquedaCorporativo < ActiveRecord::Base
end
| Ruby |
class Existencia < ActiveRecord::Base
belongs_to :almacen
validates_presence_of :producto_id, :cantidad, :unidad_medida_id
validates_numericality_of :cantidad
def aumentar(cantidad = 1)
self.cantidad += cantidad
save(false)
end
def disminuir(cantidad = 1)
self.cantidad -= cantidad
... | Ruby |
class PresenciaExhibicion < ActiveRecord::Base
belongs_to :presencia
validates_presence_of :producto_id, :cantidad
validates_numericality_of :cantidad
end
| Ruby |
class ListaPrecio < ActiveRecord::Base
validates_presence_of :producto_id, :litraje_mls, :precio_maximo, :precio_minimo, :precio_normal
end
| Ruby |
class BusquedaPresencia < ActiveRecord::Base
def consecutivo
"%06d" % id + '/' + created_at.strftime("%Y")
end
end
| Ruby |
class Concurso < ActiveRecord::Base
belongs_to :centro
belongs_to :ejecutivo
has_many_with_attributes :concurso_ventas
has_many :concurso_premios
has_many :concurso_premio_marcas
has_many :concurso_objetivos
has_many :evaluaciones
validates_presence_of :nombre, :fecha_inicio, :fecha_te... | Ruby |
class GrupoArticulo < ActiveRecord::Base
has_many :productos
validates_presence_of :descripcion, :sector_id, :categoria_id
end
| Ruby |
class Almacen < ActiveRecord::Base
has_many :movimiento_almacenes
has_many :existencias
validates_presence_of :nombre, :ubicacion
def lista_productos
raise
end
def existencias_producto(producto_id)
existencias.find_by_producto_id(producto_id).cantidad
end
end
| Ruby |
class SolicitudMaterial < ActiveRecord::Base
belongs_to :presencia
has_many :solicitud_material_detalles
validates_presence_of :centro_id, :marca_id, :ejecutivo_id, :descripcion
validates_presence_of :nombre, :reporta_a_id, :status_id
validates_numericality_of :status_id
def consecutivo
"%06d" ... | Ruby |
class EvaluacionObjetivo < ActiveRecord::Base
belongs_to :evaluacion
validates_presence_of :objetivo, :puntos_otorgados
validates_numericality_of :puntos_otorgados
end
| Ruby |
class ItemRequisicion < ActiveRecord::Base
belongs_to :requisicion_producto
validates_presence_of :producto_id, :cantidad, :unidad_medida_id
validates_numericality_of :cantidad, :greater_than => 0, :only_integer => true
def unidad_medida
UnidadMedida::UNIDADES_MEDIDA.invert[unidad_medida_id]
end
end... | Ruby |
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
if mando_medio?
conditions = {}
conditions[:sta... | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.