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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/sequel/extensions/currency_rates.rb +3 -1
- data/umbrellio-sequel-plugins.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d2032dbe06235348640ac901ffa84aefed7b5763711bb401fabb54d01756a99
|
4
|
+
data.tar.gz: bc147a2f330046c0d3c42f597017049198461199fd7d325522aa397bfc2a6555
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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[
|
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.
|
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.
|
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-
|
11
|
+
date: 2019-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sequel
|