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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89b4bdcf78f473a47eac56b9e4672e6ce1847137e0b298d13a7a016b26e6a4f8
|
4
|
+
data.tar.gz: f2a744bb2ab4f605ac8ead9d0cb6b77f3aa27acbbde8c1e00ad5b13af5cce1d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/dolar/bna.rb
CHANGED
data/lib/dolar/bna/version.rb
CHANGED
@@ -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
|
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.
|
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
|