HornsAndHooves-moribus 0.4.1 → 0.4.2

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
  SHA1:
3
- metadata.gz: 78f55dc7ce48380cd5e0abab56ff669189a78720
4
- data.tar.gz: e12ffe1c8b66b47b2d7fbebc420273dd4e91c755
3
+ metadata.gz: 663f93b966818f12016683fe8860a7a3d386e32f
4
+ data.tar.gz: accabca452e497ee454302d2a4b28652e2b6dcb5
5
5
  SHA512:
6
- metadata.gz: 38f92e8d95d1509b6f67b2d8e24242e352024746a989563edfc23c6b1e1fd8cbd5010fb408319b00a14d538a6dcac7821356c7e8093635e7239dedc332ffb2fa
7
- data.tar.gz: dde51415193dae5676e4444bb12278871459ea3ef8693a3c87926a6333bd0428ea490681a46da1b0ef18ba83e1ce51e83edaed4426be997da04ddb69d762dfea
6
+ metadata.gz: 867a00838e44330f51ab4e8aa74834d1f64e66437313010d8f96ba208ea90ca0bf3a8afb768c4c7ebaf05fd5c9d75b323fa9c04ebe5e47d710485e467c1cf721
7
+ data.tar.gz: eec8c434ba13395c60a7f904ee166590706d212412aaa566eff4c18ba40e1bce6e3103b2547cfa287c27f0e85488d9cedce5e8e09f49dc9f2734136c8e071363
@@ -142,8 +142,18 @@ module Moribus
142
142
  # update them when new record is created.
143
143
  def reset_persistence_values
144
144
  self.id = nil
145
- self.updated_at = nil if respond_to?(:updated_at=)
146
- self.created_at = nil if respond_to?(:created_at=)
145
+
146
+ if respond_to?(:updated_at=)
147
+ self.updated_at = nil
148
+ @changed_attributes =
149
+ ActiveSupport::HashWithIndifferentAccess.new(changed_attributes.dup.merge(updated_at: nil))
150
+ end
151
+
152
+ if respond_to?(:created_at=)
153
+ self.created_at = nil
154
+ @changed_attributes =
155
+ ActiveSupport::HashWithIndifferentAccess.new(changed_attributes.dup.merge(created_at: nil))
156
+ end
147
157
 
148
158
  # mark all other attributes is changing
149
159
  (attributes.keys - changes.keys).each{ |key| self.send(:"#{key}_will_change!") }
@@ -1,3 +1,3 @@
1
1
  module Moribus # :nodoc:
2
- VERSION = "0.4.1" # :nodoc:
2
+ VERSION = "0.4.2" # :nodoc:
3
3
  end
@@ -130,10 +130,15 @@ describe Moribus do
130
130
  @info.update_attributes :spec_customer_id => nil, :spec_person_name_id => 2
131
131
  }.not_to change(SpecCustomerInfo, :count)
132
132
  end
133
+
133
134
  expect(@info.new_record?).to eq false
134
135
  expect(@info.id ).to eq old_id
135
136
  expect(@info.updated_at ).to eq old_updated_at
136
137
  expect(@info.created_at ).to eq old_created_at
138
+
139
+ expect(@info.changed_attributes[:updated_at]).to eq(nil)
140
+ expect(@info.changed_attributes[:created_at]).to eq(nil)
141
+
137
142
  end
138
143
  end
139
144
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: HornsAndHooves-moribus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - HornsAndHooves
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-05-06 00:00:00.000000000 Z
13
+ date: 2016-07-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -149,7 +149,6 @@ files:
149
149
  - lib/moribus/macros.rb
150
150
  - lib/moribus/tracked_behavior.rb
151
151
  - lib/moribus/version.rb
152
- - merge.patch
153
152
  - spec/dummy/README.rdoc
154
153
  - spec/dummy/Rakefile
155
154
  - spec/dummy/app/assets/javascripts/application.js
@@ -251,4 +250,3 @@ test_files:
251
250
  - spec/moribus_spec.rb
252
251
  - spec/spec_helper.rb
253
252
  - spec/support/moribus_spec_model.rb
254
- has_rdoc:
@@ -1,22 +0,0 @@
1
- diff --git a/.simplecov b/.simplecov
2
- index d428836..a242fb5 100644
3
- --- a/.simplecov
4
- +++ b/.simplecov
5
- @@ -12,7 +12,7 @@ SimpleCov.start do
6
- # Fail the build when coverage is weak:
7
- at_exit do
8
- SimpleCov.result.format!
9
- - threshold, actual = 97.15, SimpleCov.result.covered_percent
10
- + threshold, actual = 97.354, SimpleCov.result.covered_percent
11
- if actual < threshold
12
- msg = "\nLow coverage: "
13
- msg << red("#{actual}%")
14
- diff --git a/lib/moribus/version.rb b/lib/moribus/version.rb
15
- index 20963da..629a05d 100644
16
- --- a/lib/moribus/version.rb
17
- +++ b/lib/moribus/version.rb
18
- @@ -1,3 +1,3 @@
19
- module Moribus # :nodoc:
20
- - VERSION = "0.2.1" # :nodoc:
21
- + VERSION = "0.3.0" # :nodoc:
22
- end