ree_lib 1.0.117 → 1.0.119

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: 36281ca342f1bff8e10b7eb8b9ae700364801866eac0b49490ed9aa7ee8aca65
4
- data.tar.gz: 2832c943eebfb05c20854f095f546a9547e58c1b4cefa375267190a064c82abd
3
+ metadata.gz: f74fddaac7132110d9917614ea455fff6eb718eaf8ed969fc897995346d915b3
4
+ data.tar.gz: 52d6b3e4461d320f8fd3affdb37b46cfe1ebb56d9fbc4879020021bbb3515746
5
5
  SHA512:
6
- metadata.gz: a058b0e162b9127c8e73ecf20c52734e2dd8fa4e0e6954ef6b90df9a6ea687c12033a5f7d7b02cd979c796f5dfe67691c6ac066b07f4b15810be10d6a0672066
7
- data.tar.gz: 21545385d0ad010d493c15edb6da7a6af9df8f92ff1cf2059d2c99160e5d0f735773004cf16294bcaf67996f025a542d2590e1dc0afedfd841c0aec8333a43bb
6
+ metadata.gz: 9c66a59c59055abdd1bfa11358f0e9b0d645b45e2fa2d7b0d3bbdbed8e545763bb650de824baf7e7a484999cff28106e0be102a0f7c2543579c6b6f404eb9766
7
+ data.tar.gz: 43bb3573292d9c2392aa8964d4a0640c0eee93be1aac867fcfa029e594b9096df78d77736c0b9b43900e3828f99b353b58051e2e942165f572429c54f6263468
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ree_lib (1.0.117)
4
+ ree_lib (1.0.119)
5
5
  bigdecimal (~> 3.1.6)
6
6
  binding_of_caller (~> 1.0.0)
7
7
  i18n (~> 1.14.1)
@@ -8,7 +8,7 @@ class ReeDao::OneToMany
8
8
  end
9
9
 
10
10
  contract(
11
- ArrayOf[ -> (v) { v.class.ancestors.include?(ReeDto::EntityDSL) } ],
11
+ ArrayOf[ -> (v) { v.class.ancestors.include?(ReeDto::EntityDSL) || v.class.ancestors.include?(ReeDto::DSL) } ],
12
12
  Sequel::Dataset,
13
13
  Ksplat[
14
14
  foreign_key?: Symbol,
@@ -8,7 +8,7 @@ class ReeDao::OneToOne
8
8
  end
9
9
 
10
10
  contract(
11
- ArrayOf[ -> (v) { v.class.ancestors.include?(ReeDto::EntityDSL) } ],
11
+ ArrayOf[ -> (v) { v.class.ancestors.include?(ReeDto::EntityDSL) || v.class.ancestors.include?(ReeDto::DSL) } ],
12
12
  Sequel::Dataset,
13
13
  Ksplat[
14
14
  reverse?: Bool,
@@ -83,6 +83,13 @@ module ReeDto::DtoInstanceMethods
83
83
  @changed_fields.to_a
84
84
  end
85
85
 
86
+ def set_as_changed(name)
87
+ if has_value?(name)
88
+ @changed_fields ||= Set.new
89
+ @changed_fields << name
90
+ end
91
+ end
92
+
86
93
  contract Block => Any
87
94
  def each_field(&proc)
88
95
  self.class.fields.select { has_value?(_1.name) }.each do |field|
@@ -30,6 +30,13 @@ RSpec.describe ReeDto::DSL do
30
30
  end
31
31
 
32
32
  context "fields" do
33
+ it {
34
+ dto = ReeDto::DtoClass.new(string: "str")
35
+ expect(dto.changed_fields).to eq([])
36
+ dto.set_as_changed(:string)
37
+ expect(dto.changed_fields).to eq([:string])
38
+ }
39
+
33
40
  it {
34
41
  dto = ReeDto::DtoClass.new
35
42
  expect(dto.with_default).to eq(1)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReeLib
4
- VERSION = "1.0.117"
4
+ VERSION = "1.0.119"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ree_lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.117
4
+ version: 1.0.119
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruslan Gatiyatov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-13 00:00:00.000000000 Z
11
+ date: 2024-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ree