permanent_records 4.0.0 → 4.1.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: 00dfe5b900619ccf63e002edffdddf61bbc68f17
4
- data.tar.gz: 652d7bb27018d1d20ad8ab180a675576d2f3ee91
3
+ metadata.gz: b06f61ce3509014ff0b75f3d8cc1377a96c46ba3
4
+ data.tar.gz: de86eadce595b382db87f524ecadf2555b6b2f77
5
5
  SHA512:
6
- metadata.gz: ab92380c3dad28c96cc3eb169014dde29cb3e704856546bc8a1bf4b0f3d748be5260f060ba443ebebacbc132ba30c3983b400e3bad0f2b3bed8e9f49a63ae456
7
- data.tar.gz: 0738352d25e8da93be2a76f95ddfa245ec4432e3ff5608eecc1d2a5c071dc94dc5ae56851325388af653b71574c6f146b36e57cd48f5889f94687767e88f069b
6
+ metadata.gz: a57f2492aa6117680c5b018e7887a840daf17ebd2b11b857ab7f6ef77858e223ab078ee0eb1b075873fef321135c097a8870349b2c1dcaa9ac23a35cc657ea71
7
+ data.tar.gz: f188ea9d53635618d4baa67daedf8afe5be7b6f7021952482e41d483f91343b063b07bfd8d976b0da30cc5af9c10054b0426487537cc8945ebc4051b7a676c4b
data/.travis.yml CHANGED
@@ -1,9 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 2.0.0
4
- - 1.9.3
4
+ - 2.2.2
5
5
  env:
6
- - AR_TEST_VERSION: 3.1.0
7
- - AR_TEST_VERSION: 3.2.12
8
- - AR_TEST_VERSION: 4.0.0
9
6
  - AR_TEST_VERSION: 4.2.0
7
+ - AR_TEST_VERSION: 4.2.5
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.0.0
1
+ 4.1.0
data/ci ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ for version in `grep AR_TEST_VERSION .travis.yml | awk '{print $3}'`; do
3
+ export AR_TEST_VERSION=$version
4
+ echo "Testing against ActiveRecord $version"
5
+ bundle
6
+ bundle exec rspec
7
+ done
@@ -64,22 +64,7 @@ module PermanentRecords
64
64
  else
65
65
  record.save!
66
66
  end
67
- if ::Gem::Version.new(::ActiveRecord::VERSION::STRING) < ::Gem::Version.new('4.2.0')
68
- @attributes = record.attributes
69
- @attributes_cache = record.attributes.except(record.class.serialized_attributes.keys)
70
- # workaround for active_record >= 3.2.0: re-wrap values of serialized attributes
71
- # (record.attributes returns the plain values but in the instance variables they are expected to be wrapped)
72
- if defined?(::ActiveRecord::AttributeMethods::Serialization::Attribute)
73
- serialized_attribute_class = ::ActiveRecord::AttributeMethods::Serialization::Attribute
74
- self.class.serialized_attributes.each do |key, coder|
75
- if @attributes.key?(key)
76
- @attributes[key] = serialized_attribute_class.new(coder, @attributes[key], :unserialized)
77
- end
78
- end
79
- end
80
- else # AR >= 4.2.0
81
- @attributes = record.instance_variable_get('@attributes')
82
- end
67
+ @attributes = record.instance_variable_get('@attributes')
83
68
  rescue Exception => e
84
69
  # trigger dependent record destruction (they were revived before this record,
85
70
  # which cannot be revived due to validations)
@@ -91,6 +76,7 @@ module PermanentRecords
91
76
  def destroy_with_permanent_records(force = nil)
92
77
  run_callbacks(:destroy) do
93
78
  deleted? || new_record? ? save : set_deleted_at(Time.now, force)
79
+ true
94
80
  end
95
81
  deleted? ? self : false
96
82
  end
@@ -20,11 +20,12 @@ Gem::Specification.new do |s|
20
20
  ver = ENV['AR_TEST_VERSION']
21
21
  ver = ver.dup.chomp if ver
22
22
 
23
- s.add_runtime_dependency('activerecord', ver || '>= 3.0.0')
24
- s.add_runtime_dependency('activesupport', ver || '>= 3.0.0')
23
+ s.add_runtime_dependency('activerecord', ver || '>= 4.2.0')
24
+ s.add_runtime_dependency('activesupport', ver || '>= 4.2.0')
25
+ s.add_development_dependency('rake') # For Travis-ci
25
26
  s.add_development_dependency('sqlite3')
26
- s.add_development_dependency('pry')
27
- s.add_development_dependency('database_cleaner')
27
+ s.add_development_dependency('pry-byebug')
28
+ s.add_development_dependency('database_cleaner', '>= 1.5.1')
28
29
  s.add_development_dependency('rspec', '~> 2.14.1')
29
30
  end
30
31
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: permanent_records
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Danger Canty
@@ -14,90 +14,104 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2015-08-12 00:00:00.000000000 Z
17
+ date: 2015-12-14 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: activerecord
21
21
  requirement: !ruby/object:Gem::Requirement
22
22
  requirements:
23
- - - '='
23
+ - - ">="
24
24
  - !ruby/object:Gem::Version
25
25
  version: 4.2.0
26
26
  type: :runtime
27
27
  prerelease: false
28
28
  version_requirements: !ruby/object:Gem::Requirement
29
29
  requirements:
30
- - - '='
30
+ - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: 4.2.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: activesupport
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - '='
37
+ - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: 4.2.0
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - '='
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: 4.2.0
47
47
  - !ruby/object:Gem::Dependency
48
- name: sqlite3
48
+ name: rake
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - '>='
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: '0'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - '>='
58
+ - - ">="
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0'
61
61
  - !ruby/object:Gem::Dependency
62
- name: pry
62
+ name: sqlite3
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - '>='
65
+ - - ">="
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - '>='
72
+ - - ">="
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  - !ruby/object:Gem::Dependency
76
- name: database_cleaner
76
+ name: pry-byebug
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - '>='
79
+ - - ">="
80
80
  - !ruby/object:Gem::Version
81
81
  version: '0'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - '>='
86
+ - - ">="
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
+ - !ruby/object:Gem::Dependency
90
+ name: database_cleaner
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: 1.5.1
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: 1.5.1
89
103
  - !ruby/object:Gem::Dependency
90
104
  name: rspec
91
105
  requirement: !ruby/object:Gem::Requirement
92
106
  requirements:
93
- - - ~>
107
+ - - "~>"
94
108
  - !ruby/object:Gem::Version
95
109
  version: 2.14.1
96
110
  type: :development
97
111
  prerelease: false
98
112
  version_requirements: !ruby/object:Gem::Requirement
99
113
  requirements:
100
- - - ~>
114
+ - - "~>"
101
115
  - !ruby/object:Gem::Version
102
116
  version: 2.14.1
103
117
  description: Never Lose Data. Rather than deleting rows this sets Record#deleted_at
@@ -109,15 +123,16 @@ extra_rdoc_files:
109
123
  - LICENSE
110
124
  - README.md
111
125
  files:
112
- - .document
113
- - .gitignore
114
- - .travis.yml
126
+ - ".document"
127
+ - ".gitignore"
128
+ - ".travis.yml"
115
129
  - CONTRIBUTORS.md
116
130
  - Gemfile
117
131
  - LICENSE
118
132
  - README.md
119
133
  - Rakefile
120
134
  - VERSION
135
+ - ci
121
136
  - lib/permanent_records.rb
122
137
  - permanent_records.gemspec
123
138
  homepage: https://github.com/JackDanger/permanent_records
@@ -130,17 +145,17 @@ require_paths:
130
145
  - lib
131
146
  required_ruby_version: !ruby/object:Gem::Requirement
132
147
  requirements:
133
- - - '>='
148
+ - - ">="
134
149
  - !ruby/object:Gem::Version
135
150
  version: '0'
136
151
  required_rubygems_version: !ruby/object:Gem::Requirement
137
152
  requirements:
138
- - - '>='
153
+ - - ">="
139
154
  - !ruby/object:Gem::Version
140
155
  version: '0'
141
156
  requirements: []
142
157
  rubyforge_project:
143
- rubygems_version: 2.0.14
158
+ rubygems_version: 2.4.5
144
159
  signing_key:
145
160
  specification_version: 4
146
161
  summary: Soft-delete your ActiveRecord records