umbrellio-sequel-plugins 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf3b1166dd9d29321aadcca70c8fc6b9d0b5fc2ffb470fe07d7878a8dbd71295
4
- data.tar.gz: 4a5fa36a6f4331a4d8c65a81a921541aa37e47b7bfa4739a74311d6b920924ce
3
+ metadata.gz: 6d2032dbe06235348640ac901ffa84aefed7b5763711bb401fabb54d01756a99
4
+ data.tar.gz: bc147a2f330046c0d3c42f597017049198461199fd7d325522aa397bfc2a6555
5
5
  SHA512:
6
- metadata.gz: 8baa855e0de9fe3efe2aee03950da764959a7ef2458981802b9386548450656aabfd6b3363892884914295e62ab1fca6c745a07b16eba9d3c740f277ccb88a19
7
- data.tar.gz: 7630f90fe06cdfd4f5bc53e30694fc808a9e004c774c5d58f5a6b97c5d92c45c4a88a17c76f0de1e51e1a61307bebae94ce741f4f65e76dfefecf05f898c1eb6
6
+ metadata.gz: 42860b8ac022bde1afa186013fe4444ca852a3bb9bb969b84d0a147fe646cb0f9241620028043ce7c8b992a68f14f380499249dbb52ac63faa6ca056c467ed71
7
+ data.tar.gz: 4dd79a1b108425bd2dc1c9d66a0d5c4138593e18eed8101ea6bde43375d3e7f0a1fe37abb114ba14f43c13163d8f6a157ce9e3bba3fbfbe1cf8f0144d716a584
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Changelog
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [0.3.0] 2018-04-24
5
+ ### Added
6
+ - `currency_column` param for `CurrencyRates.with_rates`;
7
+
4
8
  ## [0.2.0] 2018-03-28
5
9
  ### Added
6
10
  - `Sequel.extension(:methods_in_migrations)` - support for method definitions in `Sequel.migration` instructions;
@@ -7,6 +7,7 @@ module Sequel
7
7
  #
8
8
  # @param aliaz [Symbol] alias to be used for joined table
9
9
  # @param table [Symbol] table name to join to
10
+ # @param currency_column [Symbol] currency column by which table is joined
10
11
  # @param time_column [Symbol] time column by which table is joined
11
12
  #
12
13
  # @example
@@ -16,11 +17,12 @@ module Sequel
16
17
  aliaz = :currency_rates,
17
18
  table: table_name,
18
19
  rates_table: Sequel[:currency_rates],
20
+ currency_column: :currency,
19
21
  time_column: :created_at
20
22
  )
21
23
  table = Sequel[table]
22
24
  rates = Sequel[aliaz]
23
- join_expr = table[:currency] =~ rates[:currency]
25
+ join_expr = table[currency_column] =~ rates[:currency]
24
26
  join_expr &= rates[:period].pg_range.contains(table[time_column])
25
27
  left_join(rates_table.as(aliaz), join_expr)
26
28
  end
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "umbrellio-sequel-plugins"
8
- spec.version = "0.2.0"
8
+ spec.version = "0.3.0"
9
9
  spec.authors = ["nulldef"]
10
10
  spec.email = ["nulldefiner@gmail.com"]
11
11
  spec.required_ruby_version = ">= 2.4"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: umbrellio-sequel-plugins
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - nulldef
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-29 00:00:00.000000000 Z
11
+ date: 2019-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel