dbee-active_record 1.0.0.pre.alpha.2 → 1.0.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: cab1f2d6c2a6d667b383c44478b3252720abd3b15ce6a2592e74de9c9ac4154a
4
- data.tar.gz: 241dd04790275b714766f1132b6266a05027f972a073de71f0cc9839451b29ad
3
+ metadata.gz: 8f8eb6678bbafccb2a6ce4e2da8d1d4e20758d48b024cfc2d674d18f1a2d34af
4
+ data.tar.gz: '08695bc7492ff8f47295847b21d460c92b7e6c6e31a2fe182007b8ab17e96805'
5
5
  SHA512:
6
- metadata.gz: 393dbacbcb27172556d5957777e72b0d3a5428a7f833a9c24c80e7a733f56b794fba8beb372f6661152806042df0c1b13bcd7e9d12eef936bd1ab7236a94d49b
7
- data.tar.gz: c65fdeb21d29c3af66d8dfb353fecae9fb01991314914c5113d85c2912c4e1f775b89237077c935f217f0f8c69f24fd3d7cc7455904528da4ecd1da2fd7f9af9
6
+ metadata.gz: 827ee13a0fde7265e59a5266af403c48f42e6968e8378489a345b7e296f250437d1ef48f1beeae6ce28df64a8034b1edeb8edc362e84483f9f89a2c2caa2e75f
7
+ data.tar.gz: 9b6276c489a11863cdbe669cc7d8510ab330382a3ec0796495d16c908f159d7921ba60b46c57710c5e581cd66858d22354a598fa9245507aa568d80a9b577f8f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.0.0 (August 23rd, 2019)
2
+
3
+ Initial release, stable public API.
4
+
1
5
  # 1.0.0-alpha (August 20th, 2019)
2
6
 
3
7
  Added initial implementation.
@@ -17,7 +17,7 @@ module Dbee
17
17
  on ? on.and(arel_column.eq(value)) : arel_column.eq(value)
18
18
  end
19
19
 
20
- METHODS = {
20
+ CONSTRAINT_RESOLVERS = {
21
21
  Model::Constraints::Reference => lambda do |constraint, on, table, previous_table|
22
22
  name = constraint.name
23
23
  parent = constraint.parent
@@ -32,11 +32,11 @@ module Dbee
32
32
  end
33
33
  }.freeze
34
34
 
35
- private_constant :METHODS
35
+ private_constant :CONSTRAINT_RESOLVERS
36
36
 
37
37
  def make(constraints, table, previous_table)
38
38
  constraints.inject(nil) do |memo, constraint|
39
- method = METHODS[constraint.class]
39
+ method = CONSTRAINT_RESOLVERS[constraint.class]
40
40
 
41
41
  raise ArgumentError, "constraint unhandled: #{constraint.class.name}" unless method
42
42
 
@@ -13,7 +13,7 @@ module Dbee
13
13
  class ExpressionBuilder
14
14
  # Derives Arel#where predicates.
15
15
  class WhereMaker
16
- METHODS = {
16
+ FILTER_EVALUATORS = {
17
17
  Query::Filters::Contains => ->(column, val) { column.matches("%#{val}%") },
18
18
  Query::Filters::Equals => ->(column, val) { column.eq(val) },
19
19
  Query::Filters::GreaterThan => ->(column, val) { column.gt(val) },
@@ -26,11 +26,11 @@ module Dbee
26
26
  Query::Filters::StartsWith => ->(column, val) { column.matches("#{val}%") }
27
27
  }.freeze
28
28
 
29
- private_constant :METHODS
29
+ private_constant :FILTER_EVALUATORS
30
30
 
31
31
  def make(filter, arel_column)
32
32
  predicates = normalize(filter.value).map do |coerced_value|
33
- method = METHODS[filter.class]
33
+ method = FILTER_EVALUATORS[filter.class]
34
34
 
35
35
  raise ArgumentError, "cannot compile filter: #{filter}" unless method
36
36
 
@@ -10,7 +10,7 @@
10
10
  module Dbee
11
11
  module Providers
12
12
  class ActiveRecordProvider
13
- VERSION = '1.0.0-alpha.2'
13
+ VERSION = '1.0.0'
14
14
  end
15
15
  end
16
16
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dbee-active_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.alpha.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Ruggio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-22 00:00:00.000000000 Z
11
+ date: 2019-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -231,9 +231,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
231
231
  version: 2.4.6
232
232
  required_rubygems_version: !ruby/object:Gem::Requirement
233
233
  requirements:
234
- - - ">"
234
+ - - ">="
235
235
  - !ruby/object:Gem::Version
236
- version: 1.3.1
236
+ version: '0'
237
237
  requirements: []
238
238
  rubygems_version: 3.0.3
239
239
  signing_key: