relaxo-model 0.13.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaxo/model/base.rb +1 -1
- data/lib/relaxo/model/document.rb +4 -3
- data/lib/relaxo/model/version.rb +1 -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: 0ffd8121a4211d7a2a7784a2bac1b9e41c5e097d
|
4
|
+
data.tar.gz: 5ff99d733bef43e782787ad2c26b4c7a1fe33078
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03d7a1767e7e18bbe664d1688b40a232b08519cb0447beaf8897d30ebe7c2ad573a27b83585fea00c5ed268d640b5ef86f3c53e7f0cff5814641eb8c137cfbb0
|
7
|
+
data.tar.gz: 5948aa957ad6b4e3ee4a9c437d03de63722b51865da23a1b26cc5b7765e6d9f8049184678bee0a572825d8f275d698176b92e9aa9e21fe2618c89c98ac3520ba
|
data/lib/relaxo/model/base.rb
CHANGED
@@ -78,7 +78,7 @@ module Relaxo
|
|
78
78
|
|
79
79
|
def view(name, *path, klass: self, index: nil)
|
80
80
|
# Support array as 2nd argument, e.g.
|
81
|
-
# view :by_owner, [:type, 'by_owner', ]
|
81
|
+
# view :by_owner, [:type, 'by_owner', ...]
|
82
82
|
if path.empty?
|
83
83
|
path = [:type, name.to_s, name.to_s.split('_', 2).last.to_sym]
|
84
84
|
elsif path.count == 1 and path.first.is_a? Array
|
@@ -132,11 +132,12 @@ module Relaxo
|
|
132
132
|
"\#<#{self.class}:#{self.id} #{self.attributes.inspect}>"
|
133
133
|
end
|
134
134
|
|
135
|
-
#
|
135
|
+
# Make a copy of the record, as if calling create.
|
136
136
|
def dup
|
137
|
-
|
137
|
+
# Splat already calls dup internally I guess.
|
138
|
+
clone = self.class.new(@dataset, nil, @changed.dup, **@attributes)
|
138
139
|
|
139
|
-
clone.
|
140
|
+
clone.after_create
|
140
141
|
|
141
142
|
return clone
|
142
143
|
end
|
data/lib/relaxo/model/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaxo-model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: relaxo
|