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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: baa54b93545e3c7e489fcdb605dbd7aeb216ad69
4
- data.tar.gz: f175fdcf840161c8af177715f6e0fc712e14b3ab
3
+ metadata.gz: 0ffd8121a4211d7a2a7784a2bac1b9e41c5e097d
4
+ data.tar.gz: 5ff99d733bef43e782787ad2c26b4c7a1fe33078
5
5
  SHA512:
6
- metadata.gz: a3b93c725265744543dbd0bdce343ec5ffa0f9bd02fa70ad25abce0a7d01bdb3e92c5b73c1fd149463d7403c0ba30b755508dee4d8229b4e00ba5c7908254b41
7
- data.tar.gz: 3b859844d5a4128604a0c55b8c8cd5d60a14af3bc47733d6bde81bae397c14f93684013fe09649bcd8446eb1eadd98c926a002ad2074c4be97b72de4e57b6540
6
+ metadata.gz: 03d7a1767e7e18bbe664d1688b40a232b08519cb0447beaf8897d30ebe7c2ad573a27b83585fea00c5ed268d640b5ef86f3c53e7f0cff5814641eb8c137cfbb0
7
+ data.tar.gz: 5948aa957ad6b4e3ee4a9c437d03de63722b51865da23a1b26cc5b7765e6d9f8049184678bee0a572825d8f275d698176b92e9aa9e21fe2618c89c98ac3520ba
@@ -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
- # Duplicate the model object, and possibly change the dataset it is connected to. You will potentially have two objects referring to the same record.
135
+ # Make a copy of the record, as if calling create.
136
136
  def dup
137
- clone = self.class.new(@dataset, @object, @changed, **@attributes.dup)
137
+ # Splat already calls dup internally I guess.
138
+ clone = self.class.new(@dataset, nil, @changed.dup, **@attributes)
138
139
 
139
- clone.after_fetch
140
+ clone.after_create
140
141
 
141
142
  return clone
142
143
  end
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Relaxo
22
22
  module Model
23
- VERSION = "0.13.0"
23
+ VERSION = "0.14.0"
24
24
  end
25
25
  end
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.13.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 00:00:00.000000000 Z
11
+ date: 2018-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: relaxo