snapshotable 0.1.2 → 0.1.3

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: 6de38e7ae9020d6c1bd962cf5251f86cd393ea92
4
- data.tar.gz: 48d422d6c78f0e6b02bd32905a399be113fd069d
3
+ metadata.gz: 97edd33c2a2d4eb2935bd9549d402d18e8a7e0b5
4
+ data.tar.gz: 9f2422fd653a7bda5836f1048f7e0816bfd142c9
5
5
  SHA512:
6
- metadata.gz: adc30af44dc2f5abc99dc6526d822a429c66242b558499deae0810cee78b2d46acf25d0dddbdcb1885d62eb6426fa9e788055933b5695c69a6a49c5f054ad007
7
- data.tar.gz: b1010103a1afcfba25b677894d42a079b57528685d6e878468abfd44ad4a8291ecc463cea593d379fdd59a53f336a617adbb13a26b4e44cc1e79ace5df39d3ae
6
+ metadata.gz: 81abb9b0399c32faa5396afc2a7bf7438cac10a731b607d226fe595b3c13ddf2b5d43c56ffd5e3680e2d200567cddb56c2854e6f3142a0ace26b8b11a913b1ec
7
+ data.tar.gz: 88443b76a5c4916ed257bc65f1397d9a0c8f2161fd5305e024ada7056896baf9a8953f995adcec1ddf9ce6ebb60d49efebea8aae24d6a779f09ffac3d4769974
@@ -30,10 +30,7 @@ module Snapshotable
30
30
 
31
31
  module InstanceMethods
32
32
  def take_snapshot!(force = false)
33
- record = dup
34
- record.id = id
35
-
36
- snapshot = SnapshotCreator.new(record).call
33
+ snapshot = SnapshotCreator.new(self).call
37
34
  snapshot_class.create!(snapshot) if force || should_create_new_snapshot?(snapshot)
38
35
  end
39
36
 
@@ -14,7 +14,6 @@ module Snapshotable
14
14
  setup_snapshot_names
15
15
  setup_variables
16
16
  setup_association(@model)
17
- setup_callback(@model)
18
17
 
19
18
  @model.send :include, ::Snapshotable::Model::InstanceMethods
20
19
  end
@@ -85,12 +84,6 @@ module Snapshotable
85
84
  )
86
85
  end
87
86
 
88
- def setup_callback(klass)
89
- klass.after_create(
90
- :take_snapshot!
91
- )
92
- end
93
-
94
87
  def snapshot_class_name
95
88
  "#{@model.name}Snapshot"
96
89
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Snapshotable
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snapshotable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - João Batista Marinho