factbase 0.0.55 → 0.0.56

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: f23a2ee8985f8912a626f1c74153b90f6a6c6f19f60c271c582e7227a7c3cde2
4
- data.tar.gz: 5142b0ebef7e0475e7a4c1f7344decf6e3cdb421d47f7174dea4dcb19aeecd44
3
+ metadata.gz: d26f7abaafccccb51ef4077d66fed7a4a8ef846df2a7d46191d7113b27a2a689
4
+ data.tar.gz: 8d0a64e42a4a695edc7ef5a7958ceb69aa6a965e53778782bd865c49a8752a4f
5
5
  SHA512:
6
- metadata.gz: 618aeddaa9b2a25c10f11cc9a4eb070bf5469b8e3d79d94135401166f5e42c0b7161365e4bc8b6eb6b2853a7f8cb57a873d77de3f3b83b0913d9c6e10d4cc07e
7
- data.tar.gz: f6666996b7b015706fda6aea48ab15dcf8bcbb130259f80983890551be9c58253a4c8cd499850d4b79700a52c2e524fde9a66d2f053a65b962987e9e77fd0e40
6
+ metadata.gz: 65c7a43401b8933e212dea979319cc75a0e42349123f0cd98871ee4d1493002b2f280a229820101ef481168c64a2e97333a549036dd3c88dfa3d05b4230d9085
7
+ data.tar.gz: 9106f2c57b7840e95de6a6dba53859f0d0c4e0bea5770b22d558c35894e847145fe0b9d5640d017441baa91be48bcbc4a09cf38ae8390ab9d0efe379b5add37b
@@ -142,12 +142,16 @@ class Factbase::Rules
142
142
  end
143
143
 
144
144
  def it(fact)
145
- @facts << fact.send(@uid) unless @uid.nil?
145
+ a = fact[@uid]
146
+ return if a.nil?
147
+ @facts << a[0] unless @uid.nil?
146
148
  end
147
149
 
148
150
  def include?(fact)
149
151
  return true if @uid.nil?
150
- @facts.include?(fact.send(@uid))
152
+ a = fact[@uid]
153
+ return true if a.nil?
154
+ @facts.include?(a[0])
151
155
  end
152
156
  end
153
157
  end
data/lib/factbase.rb CHANGED
@@ -81,7 +81,7 @@ require 'yaml'
81
81
  # License:: MIT
82
82
  class Factbase
83
83
  # Current version of the gem (changed by .rultor.yml on every release)
84
- VERSION = '0.0.55'
84
+ VERSION = '0.0.56'
85
85
 
86
86
  # An exception that may be thrown in a transaction, to roll it back.
87
87
  class Rollback < StandardError; end
@@ -44,6 +44,14 @@ class TestRules < Minitest::Test
44
44
  end
45
45
  end
46
46
 
47
+ def test_check_with_id
48
+ fb = Factbase::Rules.new(Factbase.new, '(exists foo)', uid: 'id')
49
+ fb.txn do |fbt|
50
+ f = fbt.insert
51
+ f.foo = 42
52
+ end
53
+ end
54
+
47
55
  def test_to_string
48
56
  fb = Factbase::Rules.new(
49
57
  Factbase.new,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factbase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.55
4
+ version: 0.0.56
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko