This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#No entiendo bien el problema. Lo de los scopes como esta encadenado lo puedes mandar a llamar las veces que sea | |
#Yo veo los scopes como una forma mas de definir métodos | |
#Pero un poco más limpia | |
#Tal vez el método que definiste estaba mal y pore so se tardaba, pero puedes encadenar varios scopes. De hecho en el modelo de #facturas encadeno varias veces los scopes | |
#Esto se usa más que nada cuando haces una busqueda con varios parametros | |
#y los parametros son opcionales, por ejemplo si queremos buscar los ingresos de un año | |
#definimos el scope para sacar ingresos, y otro para sacar el año | |
scope :ingresos, ->(rfc) { where(rfc_em: rfc, is_nomina: false)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Teníamos este código | |
cuentas = Poliza.where(:empresa_id => self.id) | |
.where("extract(year from fecha_documento_original) = ? ", year) | |
.where("extract(month from fecha_documento_original) = ? ", month) | |
#Hasta aquí es fácil leer que estamos buscando las polizas de cierta empresa en un mes y año especificos | |
#pero podemos observar que cada uno de los where los podemos reutilizar multiples veces ya que siempre vamos a buscar | |
#polizas de una empresa en espécifico y lo mismo pasa con un año y un mes especifico |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2015-06-10T22:19:49.935948+00:00 app[web.1]: ENTRO AQUI TAMBIENjava.lang.IllegalArgumentException: The bucket name parameter must be specified when uploading an object | |
2015-06-10T22:19:49.936292+00:00 app[web.1]: at com.amazonaws.services.s3.AmazonS3Client.assertParameterNotNull(AmazonS3Client.java:2928) | |
2015-06-10T22:19:49.936321+00:00 app[web.1]: at com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1346) | |
2015-06-10T22:19:49.936347+00:00 app[web.1]: at com.tegik.cl.contabilidad.request.LlamarRequest.uploadFile(LlamarRequest.java:63) | |
2015-06-10T22:19:49.936373+00:00 app[web.1]: at com.tegik.cl.contabilidad.request.LlamarRequest.getXMLContabilidad(LlamarRequest.java:37) | |
2015-06-10T22:19:49.936400+00:00 app[web.1]: at com.tegik.cl.services.ContabilidadElectronicaService.getBalanzaComprobacion(ContabilidadElectronicaService.java:43) | |
2015-06-10T22:19:49.936532+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
2015-06-10T22:19:49.936565+00:00 ap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rails_helper' | |
RSpec.describe User, type: :model do | |
let(:user) {FactoryGirl.create :user} | |
subject { user } | |
context "attributes" do | |
it { is_expected.to respond_to(:username) } | |
it { is_expected.to respond_to(:full_name) } | |
it { is_expected.to respond_to(:bio) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AdminEmpresas; | |
AdminEmpresas = (function () { | |
'use strict'; | |
var init, bind; | |
init = function () { | |
$('#empresas_admin_table').dataTable({ | |
sPaginationType: "full_numbers", | |
bProcessing: true, | |
bServerSide: true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul class="nav nav-tabs"> | |
<li class="active"><a href="#sections" data-toggle="tab">Secciones</a></li> | |
<!-- <li><a href="#revenues" data-toggle="tab">Ingresos vs Egresos</a></li> --> | |
</ul> | |
<div class="tab-content"> | |
<div id="sections" class="tab-pane active"> | |
<div class="row"> | |
<div class="span2 offset10"> | |
<a class="btn" role="button" href="#setting_modal" | |
data-toggle="modal"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def show | |
#..mandamos a llamar el servicio... | |
json_response = JSON.parse response, symbolize_names: true | |
json_response[:bindaryData] = Base64.encode64(json_response[:bindaryData]) | |
respond_to do |format| | |
format.json {render json: json_response} | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :api, path: '/api' do | |
api_version(:module => "V1", :header => {:name => "Accept", | |
:value => "application/vnd.hsnews.com+json; version=1"}, | |
:defaults => {:format => :json}, :default => true) do | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Jesus Lerma | |
email = [email protected] | |
[alias] | |
h = log --pretty=format:'%Creset%C(red bold)[%ad] %C(blue bold)%h %Creset%C(magenta bold)%d %Creset%s %C(green bold)(%an)%Creset' --graph --abbrev-commit --date=short | |
ha = log --pretty=format:'%Creset%C(red bold)[%ad] %C(blue bold)%h %Creset%C(magenta bold)%d %Creset%s %C(green bold)(%an)%Creset' --graph --all --abbrev-commit --date=short |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Design.create(:image => File.open('/path/to/image.jpg', 'rb'), user_id:1,title:FFaker::HipsterIpsum.word) |
OlderNewer