rom-changeset 1.0.0.beta3 → 1.0.0.rc1
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 +4 -4
- data/lib/rom/changeset/associated.rb +6 -0
- data/lib/rom/changeset/update.rb +4 -4
- data/lib/rom/changeset/version.rb +1 -1
- data/lib/rom/changeset.rb +1 -1
- data/lib/rom/plugins/relation/changeset.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac26fa822218a9b349d6f09543deb6a61a4590f1
|
4
|
+
data.tar.gz: d49f5d26caf046d2ac23c28b2fee9656cd036bc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cbe5db0a4d56fd23d08183c30f689be74d656c24d63d1d837e680e7ed07d50f5cf5fda3cf562f4969cd1b0be8a42b9f2641562a7f5e7ed6a60b812d6f87292f
|
7
|
+
data.tar.gz: 4e080b8c7c5e452794323e7423ca1533674c714bf0cb85baf2e3004c5644df7145fa1a7fba36bb53a4d85994e144703727840f3010c547810818c51efafd572a
|
@@ -53,6 +53,12 @@ module ROM
|
|
53
53
|
command.call
|
54
54
|
end
|
55
55
|
|
56
|
+
# Associate with other changesets
|
57
|
+
#
|
58
|
+
# @see Changeset#associate
|
59
|
+
#
|
60
|
+
# @return [Associated]
|
61
|
+
#
|
56
62
|
# @api public
|
57
63
|
def associate(other, name = Associated.infer_assoc_name(other))
|
58
64
|
self.class.new(left, associations: associations.merge(name => other))
|
data/lib/rom/changeset/update.rb
CHANGED
@@ -4,10 +4,10 @@ module ROM
|
|
4
4
|
#
|
5
5
|
# Update changesets will only execute their commands when
|
6
6
|
# the data is different from the original tuple. Original tuple
|
7
|
-
# is fetched from changeset's relation using `
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
7
|
+
# is fetched from changeset's relation using `one` method.
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# users.by_pk(1).changeset(:update, name: "Jane Doe").commit
|
11
11
|
#
|
12
12
|
# @see Changeset::Stateful
|
13
13
|
#
|
data/lib/rom/changeset.rb
CHANGED
@@ -7,6 +7,9 @@ require 'rom/changeset/delete'
|
|
7
7
|
module ROM
|
8
8
|
module Plugins
|
9
9
|
module Relation
|
10
|
+
# Relation plugin which adds `Relation#changeset` method
|
11
|
+
#
|
12
|
+
# @api public
|
10
13
|
module Changeset
|
11
14
|
TYPES = {
|
12
15
|
create: ROM::Changeset::Create,
|
@@ -20,8 +23,10 @@ module ROM
|
|
20
23
|
event[:relation].include(InstanceMethods)
|
21
24
|
end
|
22
25
|
|
26
|
+
# Relation instance methods provided by the Changeset plugin
|
27
|
+
#
|
28
|
+
# @api public
|
23
29
|
module InstanceMethods
|
24
|
-
|
25
30
|
# Create a changeset for a relation
|
26
31
|
#
|
27
32
|
# @overload changeset(type, data)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rom-changeset
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Solnica
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-core
|