dolar-bna 0.1.2 → 0.1.3

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: 7cd5fcfd3735d0434d801c8c4346b54055756c881503ffc325cd0cfaa44c22d4
4
- data.tar.gz: a4bc45551ce8dfb4c3c92633f681fd6b67a62d5ee4f404a0d142d0d9c6b2f4dd
3
+ metadata.gz: 89b4bdcf78f473a47eac56b9e4672e6ce1847137e0b298d13a7a016b26e6a4f8
4
+ data.tar.gz: f2a744bb2ab4f605ac8ead9d0cb6b77f3aa27acbbde8c1e00ad5b13af5cce1d3
5
5
  SHA512:
6
- metadata.gz: 7e2805f705450455a2354cf9ea055491bd37e8ab893444d17e9a5656b2c1ae68fc1e54523dab80d8467d37fc0d46efab37e85d3df7b1fb03e93bfab87328fb86
7
- data.tar.gz: 115b454f1995c7bdc6d73acf49ab8bdb6eef8fef000a9e93b74bf3c4be3501350f7be31378618ca1953581a38750ce8590426afa5cc70ad30ea58598920d8161
6
+ metadata.gz: 82c5e3588508bfa7197a0e775ce5cf8d000186d37ee7824d833c1d393f8eadefae2db15d413bdeca5fdfe1a56bdd9a3d5e3a862b35c50d81f43d4a24a83a04d4
7
+ data.tar.gz: bdf17042199dfaf5fd409f92d265c3cb543520bbcca46d1a0d355a452aa9ae7f1c319a4a9be30b9c0500476467aaa9a18a1c30bdbbc8c886ff6a55e8da01540d
@@ -0,0 +1,18 @@
1
+ module Dolar
2
+ module Bna
3
+ class DolarCotization < ActiveRecord::Base
4
+ validates_presence_of :date, message: 'Indicar fecha de la cotización'
5
+ validates_presence_of :dolar_type, message: 'Indicar tipo de cotizacion'
6
+ validates_presence_of :dolar_buy, message: 'Indicar cotizacion de compra'
7
+ validates_presence_of :dolar_sell, message: 'Indicar cotizacion de venta'
8
+ validates_uniqueness_of :date, scope: :dolar_type, message: 'Ya existe una cotización de ese tipo para la fecha ingresada'
9
+
10
+ DOLAR_TYPES = ["Divisa", "Billete"]
11
+
12
+ validates_inclusion_of :dolar_type, in: DOLAR_TYPES, message: 'Tipo de cotización inválido'
13
+
14
+
15
+ end
16
+
17
+ end
18
+ end
@@ -12,6 +12,6 @@ module Dolar
12
12
 
13
13
  autoload :Exchanger, "dolar/bna/exchange"
14
14
  autoload :Converter, "dolar/bna/convert"
15
-
15
+
16
16
  end
17
17
  end
@@ -1,5 +1,5 @@
1
1
  module Dolar
2
2
  module Bna
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
@@ -0,0 +1,24 @@
1
+ require 'rails'
2
+ require 'rails/generators'
3
+ require 'rails/generators/migration'
4
+ module Dolar
5
+ module Bna
6
+ module Generators
7
+ class InstallGenerator < ::Rails::Generators::Base
8
+ include Rails::Generators::Migration
9
+ source_root File.expand_path('../templates', __FILE__)
10
+ desc "Add the migrations for DoubleDouble"
11
+
12
+ def self.next_migration_number(path)
13
+ next_migration_number = current_migration_number(path) + 1
14
+ ActiveRecord::Migration.next_migration_number(next_migration_number)
15
+ end
16
+
17
+ def copy_migrations
18
+ migration_template "create_double_double.rb",
19
+ "db/migrate/create_double_double.rb"
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,12 @@
1
+ class CreateDolarCotizations < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :dolar_cotizations do |t|
4
+ t.date :date
5
+ t.string :dolar_type
6
+ t.float :dolar_buy
7
+ t.float :dolar_sell
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ 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.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - LITECODE
@@ -60,10 +60,13 @@ executables: []
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
+ - lib/dolar/app/dolar_cotization.rb
63
64
  - lib/dolar/bna.rb
64
65
  - lib/dolar/bna/convert.rb
65
66
  - lib/dolar/bna/exchange.rb
66
67
  - lib/dolar/bna/version.rb
68
+ - lib/generators/dolar/bna/install/install_generator.rb
69
+ - lib/generators/dolar/bna/install/templates/create_dolar_cotizations.rb
67
70
  homepage: http://litecode.com.ar/
68
71
  licenses:
69
72
  - MIT