dolar-bna 0.1.3.1 → 0.1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ced91abfeb7d62d48db5f15f52d3ac28a33374638743130d3a8a8ef77042115
4
- data.tar.gz: 561b5d24e27a486d32c998d6c7174c6c896e4a8b59a2e171ea2e27fb27139f19
3
+ metadata.gz: 8c65d9c379b27606842f6d4e8239b14dfed6a169edaf68997661cd4c6e7fbdca
4
+ data.tar.gz: 37f98ddd3d1d1451bf606019ed25b0dc37af4e1cfc13401aff813a8d9f2b118a
5
5
  SHA512:
6
- metadata.gz: f0d8a1923790bb1d7926ca3e7dd0be45ddb8d20d591ceaee998ac036b703f7d6c51efe081c7f5a0965d711f15b56925b9394a073f6bbf4f8f48ae3626d54eb95
7
- data.tar.gz: b06b3ef39ccbbe1310bd121d1312656d1a416ceddea13243dcd8562d4ef2e51065d9f526de5224d87a26951ea45ceb02e23f3423be921820a2b048d33c4f36d9
6
+ metadata.gz: 3354bb2b7b90fd122f5c8fc736dbd31d4fd2d66d0803a21e12d639e62122c6552d0f9e80a12855e58e500dee501bbb6b073b9d1c8059605e1cff68ffe7a51fe5
7
+ data.tar.gz: 1dc20d89baa108e6c6e7732f94e7ee42c3b2b2dfb9ef5246c18dbcaba00d99c9dab12bdfdf3f210cb0dc52ca4e23c0ae675989ac899a07bba307f95ebfbd935c
@@ -1,12 +1,14 @@
1
1
  module Dolar
2
2
  module Bna
3
3
  class DolarCotization < ActiveRecord::Base
4
+
5
+ self.table_name = "dolar_cotizations"
6
+
4
7
  validates_presence_of :date, message: 'Indicar fecha de la cotización'
5
8
  validates_presence_of :dolar_type, message: 'Indicar tipo de cotizacion'
6
9
  validates_presence_of :dolar_buy, message: 'Indicar cotizacion de compra'
7
10
  validates_presence_of :dolar_sell, message: 'Indicar cotizacion de venta'
8
11
  validates_uniqueness_of :date, scope: :dolar_type, message: 'Ya existe una cotización de ese tipo para la fecha ingresada'
9
-
10
12
  DOLAR_TYPES = ["Divisa", "Billete"]
11
13
 
12
14
  validates_inclusion_of :dolar_type, in: DOLAR_TYPES, message: 'Tipo de cotización inválido'
@@ -8,7 +8,7 @@ module Dolar
8
8
  end
9
9
 
10
10
  def perform
11
- dolar_query = DolarCotization.where(date: Date.today, dolar_type: @dolar_type).first
11
+ dolar_query = Dolar::Bna::DolarCotization.where(date: Date.today, dolar_type: @dolar_type).first
12
12
  dolar_buy = dolar_query.nil? ? nil : dolar_query.dolar_buy
13
13
  if @conversion == "ars_to_dolar"
14
14
  ars_to_dolar(dolar_buy)
@@ -75,7 +75,7 @@ module Dolar
75
75
 
76
76
 
77
77
  def save_in_db data, dolar_type
78
- DolarCotization.create(date: @fecha, dolar_type: dolar_type, dolar_buy: data[:compra], dolar_sell: data[:venta])
78
+ Dolar::Bna::DolarCotization.create(date: @fecha, dolar_type: dolar_type, dolar_buy: data[:compra], dolar_sell: data[:venta])
79
79
  end
80
80
 
81
81
  end
@@ -1,5 +1,5 @@
1
1
  module Dolar
2
2
  module Bna
3
- VERSION = "0.1.3.1"
3
+ VERSION = "0.1.3.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dolar-bna
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3.1
4
+ version: 0.1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - LITECODE