permanent_records 2.1.2 → 2.3.0

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.
data/Gemfile CHANGED
@@ -2,6 +2,8 @@ source 'http://rubygems.org'
2
2
 
3
3
  gem 'activerecord'
4
4
 
5
- group :test do
5
+ group :development do
6
+ gem 'jeweler' # Because Bundler doesn't fucking have version:bump tasks
7
+ gem 'rake'
6
8
  gem 'sqlite3'
7
9
  end
data/README.markdown CHANGED
@@ -5,27 +5,31 @@
5
5
  This gem prevents any of your ActiveRecord data from being destroyed.
6
6
  Any model that you've given a "deleted_at" datetime column will have that column set rather than let the record be deleted.
7
7
 
8
- ## Compatability: This gem works with Rails versions 1, 2, and 3
8
+ ## Compatibility: This gem works with Rails versions 1, 2, and 3
9
9
 
10
10
  ## Does it make a lot of sense?
11
11
 
12
12
  Yes.
13
13
 
14
+ ```ruby
14
15
  User.find(3).destroy # sets the 'deleted_at' attribute to Time.now and returns a frozen record
15
16
  User.find(3).destroy(:force) # executes the real destroy method, the record will be removed from the database
16
17
  User.destroy_all # soft-deletes all User records
17
18
  User.delete_all # bye bye everything (no soft-deleting here)
18
-
19
+ ```
19
20
  There are also two scopes provided for easily searching deleted and not deleted records:
20
21
 
22
+ ```ruby
21
23
  User.deleted.find(...) # only returns deleted records.
22
24
  User.not_deleted.find(...) # only returns non-deleted records.
23
-
25
+ ```
24
26
 
25
27
  Note: Your normal finds will, by default, _include_ deleted records. You'll have to manually use the 'not_deleted' scope to avoid this:
26
28
 
29
+ ```ruby
27
30
  User.find(1) # will find record number 1, even if it's deleted
28
31
  User.not_deleted.find(1) # This is probably what you want, it doesn't find deleted records
32
+ ```
29
33
 
30
34
  ## Is Everything Automated?
31
35
 
@@ -39,38 +43,45 @@ all have a deleted_at timestamp set on them.
39
43
 
40
44
  Yes. All you need to do is call the 'revive' method.
41
45
 
42
-
46
+ ```ruby
43
47
  User.find(3).destroy
44
48
  # the user is now deleted
45
49
  User.find(3).revive
46
50
  # the user is back to it's original state
51
+ ```
47
52
 
48
53
  And if you had dependent records that were set to be destroyed along with the parent record:
49
54
 
55
+ ```ruby
50
56
  class User < ActiveRecord::Base
51
57
  has_many :comments, :dependent => :destroy
52
58
  end
53
- User.find(3).destory
59
+ User.find(3).destroy
54
60
  # all the comments are destroyed as well
55
61
  User.find(3).revive
56
62
  # all the comments that were just destroyed are now back in pristine condition
57
63
 
58
64
  # forcing deletion works the same way: fi you hard delete a record, its dependent records will also be hard deleted
65
+ ```
59
66
 
60
67
  ## Can I use default scopes?
61
68
 
62
69
  In Rails 3, yes.
63
70
 
71
+ ```ruby
64
72
  default_scope where(:deleted_at => nil)
73
+ ```
65
74
 
66
75
  If you use such a default scope, you will need to simulate the `deleted` scope with a method
67
76
 
77
+ ```ruby
68
78
  def self.deleted
69
79
  self.unscoped.where('deleted_at IS NOT NULL')
70
80
  end
81
+ ```
71
82
 
72
83
  Rails 2 provides no practical means of overriding default scopes (aside from using something like `Model.with_exclusive_scope { find(id) }`), so you'll need to implement those yourself if you need them.
73
84
 
74
85
  Patches welcome, forks celebrated.
75
86
 
76
- Copyright (c) 2010 Jack Danger Canty @ [http://jåck.com](http://jåck.com) of Cloops Inc., released under the MIT license
87
+ Copyright (c) 2010 Jack Danger Canty @ [http://jåck.com](http://jåck.com) released under the MIT license
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.2
1
+ 2.3.0
@@ -5,8 +5,7 @@ module PermanentRecords
5
5
 
6
6
  # Rails 3
7
7
  if ActiveRecord::VERSION::MAJOR >= 3
8
- base.scope :deleted, :conditions => 'deleted_at IS NOT NULL'
9
- base.scope :not_deleted, :conditions => { :deleted_at => nil }
8
+ base.extend Scopes
10
9
  base.instance_eval { define_model_callbacks :revive }
11
10
  # Rails 2.x.x
12
11
  elsif base.respond_to?(:named_scope)
@@ -27,6 +26,15 @@ module PermanentRecords
27
26
  end
28
27
  end
29
28
 
29
+ module Scopes
30
+ def deleted
31
+ where("#{table_name}.deleted_at IS NOT NULL")
32
+ end
33
+ def not_deleted
34
+ where("#{table_name}.deleted_at IS NULL")
35
+ end
36
+ end
37
+
30
38
  module EarlyRails
31
39
  def with_deleted
32
40
  with_scope :find => {:conditions => "#{quoted_table_name}.deleted_at IS NOT NULL"} do
@@ -121,16 +129,13 @@ module PermanentRecords
121
129
  return permanently_delete_records_after{ destroy_without_permanent_records }
122
130
  end
123
131
  end
124
- unless deleted? || new_record?
125
- set_deleted_at Time.now
126
- end
127
132
  if active_record_3?
128
133
  _run_destroy_callbacks do
129
- save
134
+ deleted? || new_record? ? save : set_deleted_at(Time.now)
130
135
  end
131
136
  else
132
137
  run_callbacks :before_destroy
133
- save
138
+ deleted? || new_record? ? save : set_deleted_at(Time.now)
134
139
  run_callbacks :after_destroy
135
140
  end
136
141
  self
@@ -153,7 +158,7 @@ module PermanentRecords
153
158
  deleted_at + 3.seconds
154
159
  ]
155
160
  )
156
- elsif cardinality == 'one'
161
+ elsif cardinality == 'one' or cardinality == 'belongs_to'
157
162
  if active_record_3?
158
163
  self.class.unscoped do
159
164
  records = [] << send(name)
@@ -162,7 +167,7 @@ module PermanentRecords
162
167
  records = [] << send(name)
163
168
  end
164
169
  end
165
- records.compact.each do |dependent|
170
+ [records].flatten.compact.each do |dependent|
166
171
  dependent.revive
167
172
  end
168
173
 
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{permanent_records}
8
- s.version = "2.1.0"
7
+ s.name = "permanent_records"
8
+ s.version = "2.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jack Danger Canty", "David Sulc"]
12
- s.date = %q{2011-06-06}
13
- s.description = %q{Never Lose Data. Rather than deleting rows this sets Record#deleted_at and gives you all the scopes you need to work with your data.}
14
- s.email = %q{gems@6brand.com}
12
+ s.date = "2012-02-28"
13
+ s.description = "Never Lose Data. Rather than deleting rows this sets Record#deleted_at and gives you all the scopes you need to work with your data."
14
+ s.email = "gems@6brand.com"
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
17
17
  "README.markdown"
@@ -24,13 +24,13 @@ Gem::Specification.new do |s|
24
24
  "README.markdown",
25
25
  "Rakefile",
26
26
  "VERSION",
27
- "init.rb",
28
- "install.rb",
29
27
  "lib/permanent_records.rb",
30
28
  "permanent_records.gemspec",
31
29
  "test/comment.rb",
32
30
  "test/database.yml",
33
31
  "test/difficulty.rb",
32
+ "test/dirt.rb",
33
+ "test/earthworm.rb",
34
34
  "test/hole.rb",
35
35
  "test/kitty.rb",
36
36
  "test/location.rb",
@@ -39,24 +39,32 @@ Gem::Specification.new do |s|
39
39
  "test/permanent_records_test.rb",
40
40
  "test/schema.rb",
41
41
  "test/test_helper.rb",
42
- "test/unused_model.rb",
43
- "uninstall.rb"
42
+ "test/unused_model.rb"
44
43
  ]
45
- s.homepage = %q{http://github.com/JackDanger/permanent_records}
44
+ s.homepage = "http://github.com/JackDanger/permanent_records"
46
45
  s.require_paths = ["lib"]
47
- s.rubygems_version = %q{1.4.2}
48
- s.summary = %q{Soft-delete your ActiveRecord records}
46
+ s.rubygems_version = "1.8.17"
47
+ s.summary = "Soft-delete your ActiveRecord records"
49
48
 
50
49
  if s.respond_to? :specification_version then
51
50
  s.specification_version = 3
52
51
 
53
52
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
54
53
  s.add_runtime_dependency(%q<activerecord>, [">= 0"])
54
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
55
+ s.add_development_dependency(%q<rake>, [">= 0"])
56
+ s.add_development_dependency(%q<sqlite3>, [">= 0"])
55
57
  else
56
58
  s.add_dependency(%q<activerecord>, [">= 0"])
59
+ s.add_dependency(%q<jeweler>, [">= 0"])
60
+ s.add_dependency(%q<rake>, [">= 0"])
61
+ s.add_dependency(%q<sqlite3>, [">= 0"])
57
62
  end
58
63
  else
59
64
  s.add_dependency(%q<activerecord>, [">= 0"])
65
+ s.add_dependency(%q<jeweler>, [">= 0"])
66
+ s.add_dependency(%q<rake>, [">= 0"])
67
+ s.add_dependency(%q<sqlite3>, [">= 0"])
60
68
  end
61
69
  end
62
70
 
data/test/dirt.rb ADDED
@@ -0,0 +1,4 @@
1
+ class Dirt < ActiveRecord::Base
2
+ has_one :hole
3
+ has_one :earthworm, :dependent => :destroy
4
+ end
data/test/earthworm.rb ADDED
@@ -0,0 +1,11 @@
1
+ class Earthworm < ActiveRecord::Base
2
+ belongs_to :dirt
3
+
4
+ # Earthworms have been known to complain if they're left on their deathbeds without any dirt
5
+ before_destroy :complain!
6
+
7
+ def complain!
8
+ raise "Where's my dirt?!" if Dirt.not_deleted.find(self.dirt_id).nil?
9
+ end
10
+
11
+ end
data/test/hole.rb CHANGED
@@ -1,4 +1,7 @@
1
1
  class Hole < ActiveRecord::Base
2
+ # Because when we're destroying a mole hole we're obviously using high explosives.
3
+ belongs_to :dirt, :dependent => :destroy
4
+
2
5
  # muskrats are permanent
3
6
  has_many :muskrats, :dependent => :destroy
4
7
  # moles are not permanent
@@ -5,12 +5,12 @@
5
5
 
6
6
  require File.expand_path(File.dirname(__FILE__) + "/test_helper")
7
7
 
8
- %w(hole mole muskrat kitty location comment difficulty unused_model).each do |a|
8
+ %w(earthworm dirt hole mole muskrat kitty location comment difficulty unused_model).each do |a|
9
9
  require File.expand_path(File.dirname(__FILE__) + "/" + a)
10
10
  end
11
11
 
12
12
  class PermanentRecordsTest < ActiveSupport::TestCase
13
-
13
+
14
14
  def setup
15
15
  super
16
16
  Muskrat.delete_all
@@ -19,7 +19,8 @@ class PermanentRecordsTest < ActiveSupport::TestCase
19
19
  @the_girl = Muskrat.create!(:name => 'Dot')
20
20
  Kitty.delete_all
21
21
  @kitty = Kitty.create!(:name => 'Meow Meow')
22
- @hole = Hole.create(:number => 14)
22
+ @dirt = Dirt.create!(:color => 'Brown')
23
+ @hole = Hole.create(:number => 14, :dirt => @dirt)
23
24
  @hole.muskrats.create(:name => "Active Muskrat")
24
25
  @hole.muskrats.create(:name => "Deleted Muskrat", :deleted_at => 5.days.ago)
25
26
  Location.delete_all
@@ -27,7 +28,7 @@ class PermanentRecordsTest < ActiveSupport::TestCase
27
28
  @hole.location = @location
28
29
  @hole.save!
29
30
  @mole = @hole.moles.create(:name => "Grabowski")
30
-
31
+
31
32
  if ActiveRecord::VERSION::MAJOR >= 3
32
33
  Difficulty.unscoped.delete_all
33
34
  Comment.unscoped.delete_all
@@ -39,22 +40,22 @@ class PermanentRecordsTest < ActiveSupport::TestCase
39
40
  @hole_with_difficulty = Hole.create(:number => 16)
40
41
  @hole_with_difficulty.difficulty = Difficulty.create!(:name => 'Hard')
41
42
  @hole_with_difficulty.save!
42
-
43
+
43
44
  # test has_many cardinality with model having a default scope
44
45
  @hole_with_comments = Hole.create(:number => 16)
45
46
  @hole_with_comments.comments << Comment.create!(:text => "Beware of the pond.")
46
47
  @hole_with_comments.comments << Comment.create!(:text => "Muskrats live here.")
47
48
  end
48
-
49
+
49
50
  def teardown
50
51
  setup
51
52
  end
52
-
53
+
53
54
  def test_destroy_should_return_the_record
54
55
  muskrat = @active
55
56
  assert_equal muskrat, muskrat.destroy
56
57
  end
57
-
58
+
58
59
  def test_revive_should_return_the_record
59
60
  muskrat = @deleted
60
61
  assert_equal muskrat, muskrat.revive
@@ -63,48 +64,48 @@ class PermanentRecordsTest < ActiveSupport::TestCase
63
64
  def test_destroy_should_set_deleted_at_attribute
64
65
  assert @active.destroy.deleted_at
65
66
  end
66
-
67
+
67
68
  def test_destroy_should_save_deleted_at_attribute
68
69
  assert Muskrat.find(@active.destroy.id).deleted_at
69
70
  end
70
-
71
+
71
72
  def test_destroy_should_not_really_remove_the_record
72
73
  assert Muskrat.find(@active.destroy.id)
73
74
  end
74
-
75
+
75
76
  def test_destroy_should_recognize_a_force_parameter
76
77
  assert_raises(ActiveRecord::RecordNotFound) { @active.destroy(:force).reload }
77
78
  end
78
-
79
+
79
80
  def test_destroy_should_ignore_other_parameters
80
81
  assert Muskrat.find(@active.destroy(:hula_dancer).id)
81
82
  end
82
-
83
+
83
84
  def test_revive_should_unfreeze_record
84
85
  assert !@deleted.revive.frozen?
85
86
  end
86
-
87
+
87
88
  def test_revive_should_unset_deleted_at
88
89
  assert !@deleted.revive.deleted_at
89
90
  end
90
-
91
+
91
92
  def test_revive_should_make_deleted_return_false
92
93
  assert !@deleted.revive.deleted?
93
94
  end
94
-
95
+
95
96
  def test_deleted_returns_true_for_deleted_records
96
97
  assert @deleted.deleted?
97
98
  end
98
-
99
+
99
100
  def test_destroy_returns_record_with_modified_attributes
100
101
  assert @active.destroy.deleted?
101
102
  end
102
-
103
+
103
104
  def test_revive_and_destroy_should_be_chainable
104
105
  assert @active.destroy.revive.destroy.destroy.revive.revive.destroy.deleted?
105
106
  assert !@deleted.destroy.revive.revive.destroy.destroy.revive.deleted?
106
107
  end
107
-
108
+
108
109
  def test_with_counting_on_deleted_limits_scope_to_count_deleted_records
109
110
  assert_equal Muskrat.deleted.length,
110
111
  Muskrat.deleted.count
@@ -118,15 +119,15 @@ class PermanentRecordsTest < ActiveSupport::TestCase
118
119
  def test_with_deleted_limits_scope_to_deleted_records
119
120
  assert Muskrat.deleted.all?(&:deleted?)
120
121
  end
121
-
122
+
122
123
  def test_with_not_deleted_limits_scope_to_not_deleted_records
123
124
  assert !Muskrat.not_deleted.any?(&:deleted?)
124
125
  end
125
-
126
+
126
127
  def test_models_without_a_deleted_at_column_should_destroy_as_normal
127
128
  assert_raises(ActiveRecord::RecordNotFound) {@kitty.destroy.reload}
128
129
  end
129
-
130
+
130
131
  def test_dependent_non_permanent_records_should_be_destroyed
131
132
  assert @hole.is_permanent?
132
133
  assert !@hole.moles.first.is_permanent?
@@ -134,16 +135,18 @@ class PermanentRecordsTest < ActiveSupport::TestCase
134
135
  @hole.destroy
135
136
  end
136
137
  end
137
-
138
+
138
139
  def test_dependent_permanent_records_with_has_many_cardinality_should_be_marked_as_deleted
139
140
  assert @hole.is_permanent?
140
141
  assert @hole.muskrats.first.is_permanent?
141
142
  assert_no_difference "Muskrat.count" do
142
143
  @hole.destroy
143
144
  end
145
+
146
+ @hole.reload
144
147
  assert @hole.muskrats.first.deleted?
145
148
  end
146
-
149
+
147
150
  def test_dependent_permanent_records_with_has_one_cardinality_should_be_marked_as_deleted
148
151
  assert @hole.is_permanent?
149
152
  assert @hole.location.is_permanent?
@@ -153,15 +156,17 @@ class PermanentRecordsTest < ActiveSupport::TestCase
153
156
  assert @hole.location.deleted?
154
157
  assert Location.find_by_name("South wall").deleted?
155
158
  end
156
-
159
+
157
160
  def test_dependent_permanent_records_with_has_many_cardinality_should_be_revived_when_parent_is_revived
158
161
  assert @hole.is_permanent?
159
162
  @hole.destroy
163
+ assert @dirt.deleted?
160
164
  assert @hole.muskrats.find_by_name("Active Muskrat").deleted?
161
165
  @hole.revive
162
166
  assert !@hole.muskrats.find_by_name("Active Muskrat").deleted?
167
+ assert !@dirt.deleted?
163
168
  end
164
-
169
+
165
170
  def test_dependent_permanent_records_with_has_one_cardinality_should_be_revived_when_parent_is_revived
166
171
  assert @hole.is_permanent?
167
172
  @hole.destroy
@@ -169,7 +174,15 @@ class PermanentRecordsTest < ActiveSupport::TestCase
169
174
  @hole.revive
170
175
  assert !Location.find_by_name("South wall").deleted?
171
176
  end
172
-
177
+
178
+ def test_before_callbacks_for_dependent_records_fire_before_destroy_occurs
179
+ @earthworm = Earthworm.create(:dirt => @dirt)
180
+
181
+ assert_nothing_raised do
182
+ @hole.destroy
183
+ end
184
+ end
185
+
173
186
  # see comment at top of file for reasoning behind conditional testing of default scope
174
187
  if ActiveRecord::VERSION::MAJOR >= 3
175
188
  def test_dependent_permanent_records_with_has_one_cardinality_and_default_scope_should_be_revived_when_parent_is_revived
@@ -183,7 +196,7 @@ class PermanentRecordsTest < ActiveSupport::TestCase
183
196
  assert_not_nil Difficulty.find_by_name("Hard")
184
197
  assert !Difficulty.unscoped.find_by_name("Hard").deleted?
185
198
  end
186
-
199
+
187
200
  def test_dependent_permanent_records_with_has_many_cardinality_and_default_scope_should_be_revived_when_parent_is_revived
188
201
  assert @hole_with_comments.is_permanent?
189
202
  assert_difference("Comment.count", -2) do
@@ -196,7 +209,7 @@ class PermanentRecordsTest < ActiveSupport::TestCase
196
209
  assert !Comment.unscoped.find_by_text("Beware of the pond.").deleted?
197
210
  end
198
211
  end
199
-
212
+
200
213
  def test_inexistent_dependent_models_should_not_cause_errors
201
214
  hole_with_unused_model = Hole.create!(:number => 1)
202
215
  hole_with_unused_model.destroy
@@ -204,7 +217,7 @@ class PermanentRecordsTest < ActiveSupport::TestCase
204
217
  hole_with_unused_model.revive
205
218
  end
206
219
  end
207
-
220
+
208
221
  def test_old_dependent_permanent_records_should_not_be_revived
209
222
  assert @hole.is_permanent?
210
223
  @hole.destroy
@@ -212,7 +225,7 @@ class PermanentRecordsTest < ActiveSupport::TestCase
212
225
  @hole.revive
213
226
  assert @hole.muskrats.find_by_name("Deleted Muskrat").deleted?
214
227
  end
215
-
228
+
216
229
  def test_validate_records_before_revival
217
230
  duplicate_location = Location.new(@location.attributes)
218
231
  @location.destroy
@@ -225,20 +238,20 @@ class PermanentRecordsTest < ActiveSupport::TestCase
225
238
  end
226
239
  end
227
240
  end
228
-
241
+
229
242
  def test_force_deleting_a_record_with_has_one_force_deletes_dependent_records
230
243
  hole = Hole.create(:number => 1)
231
244
  location = Location.create(:name => "Near the clubhouse")
232
245
  hole.location = location
233
246
  hole.save!
234
-
247
+
235
248
  assert_difference(monitor_for('Hole'), -1) do
236
249
  assert_difference(monitor_for('Location'), -1) do
237
250
  hole.destroy(:force)
238
251
  end
239
252
  end
240
253
  end
241
-
254
+
242
255
  def test_force_deleting_a_record_with_has_many_force_deletes_dependent_records
243
256
  assert_difference(monitor_for('Hole'), -1) do
244
257
  assert_difference(monitor_for('Comment'), -2) do
@@ -246,7 +259,7 @@ class PermanentRecordsTest < ActiveSupport::TestCase
246
259
  end
247
260
  end
248
261
  end
249
-
262
+
250
263
  def test_force_deletign_with_multiple_associations
251
264
  assert_difference(monitor_for('Muskrat'), -2) do
252
265
  assert_difference(monitor_for('Mole'), -1) do
data/test/schema.rb CHANGED
@@ -1,47 +1,57 @@
1
1
  ActiveRecord::Schema.define(:version => 1) do
2
-
2
+
3
3
  create_table :muskrats, :force => true do |t|
4
4
  t.column :name, :string
5
5
  t.column :deleted_at, :datetime
6
6
  t.references :hole
7
7
  end
8
-
8
+
9
9
  create_table :kitties, :force => true do |t|
10
10
  t.column :name, :string
11
11
  end
12
12
 
13
13
  create_table :holes, :force => true do |t|
14
14
  t.integer :number
15
+ t.references :dirt
15
16
  t.datetime :deleted_at
16
17
  end
17
-
18
+
18
19
  create_table :moles, :force => true do |t|
19
20
  t.string :name
20
21
  t.references :hole
21
22
  end
22
-
23
+
23
24
  create_table :locations, :force => true do |t|
24
25
  t.string :name
25
26
  t.references :hole
26
27
  t.datetime :deleted_at
27
28
  end
28
-
29
+
29
30
  create_table :comments, :force => true do |t|
30
31
  t.string :text
31
32
  t.references :hole
32
33
  t.datetime :deleted_at
33
34
  end
34
-
35
+
35
36
  create_table :difficulties, :force => true do |t|
36
37
  t.string :name
37
38
  t.references :hole
38
39
  t.datetime :deleted_at
39
40
  end
40
-
41
+
41
42
  create_table :unused_models, :force => true do |t|
42
43
  t.string :name
43
44
  t.references :hole
44
45
  t.datetime :deleted_at
45
46
  end
46
47
 
48
+ create_table :dirts, :force => true do |t|
49
+ t.string :color
50
+ t.datetime :deleted_at
51
+ end
52
+
53
+ create_table :earthworms, :force => true do |t|
54
+ t.references :dirt
55
+ end
56
+
47
57
  end
data/test/test_helper.rb CHANGED
@@ -4,10 +4,11 @@
4
4
  $:.unshift(File.dirname(__FILE__) + '/../lib')
5
5
  RAILS_ROOT = File.dirname(__FILE__)
6
6
 
7
+ require 'rubygems'
7
8
  require 'test/unit'
8
9
  require 'active_record'
9
10
  require 'active_record/fixtures'
10
- require "#{File.dirname(__FILE__)}/../init"
11
+ require File.expand_path(File.dirname(__FILE__) + '/../lib/permanent_records')
11
12
 
12
13
  require File.expand_path(File.dirname(__FILE__) + "/muskrat")
13
14
 
@@ -26,13 +27,13 @@ class ActiveSupport::TestCase #:nodoc:
26
27
  # Fixtures.create_fixtures(Test::Unit::TestCase.fixture_path, table_names)
27
28
  # end
28
29
  # end
29
-
30
+
30
31
  self.fixture_path = File.dirname(__FILE__) + "/fixtures/"
31
32
  $LOAD_PATH.unshift(fixture_path)
32
-
33
+
33
34
  # Turn off transactional fixtures if you're working with MyISAM tables in MySQL
34
35
  self.use_transactional_fixtures = true
35
-
36
+
36
37
  # Instantiated fixtures are slow, but give you @david where you otherwise would need people(:david)
37
38
  self.use_instantiated_fixtures = false
38
39
 
metadata CHANGED
@@ -1,40 +1,90 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: permanent_records
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.3.0
4
5
  prerelease:
5
- version: 2.1.2
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Jack Danger Canty
9
9
  - David Sulc
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
-
14
- date: 2011-06-06 00:00:00 -07:00
15
- default_executable:
16
- dependencies:
17
- - !ruby/object:Gem::Dependency
13
+ date: 2012-10-07 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
18
16
  name: activerecord
19
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: !ruby/object:Gem::Requirement
20
18
  none: false
21
- requirements:
22
- - - ">="
23
- - !ruby/object:Gem::Version
24
- version: "0"
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
25
23
  type: :runtime
26
24
  prerelease: false
27
- version_requirements: *id001
28
- description: Never Lose Data. Rather than deleting rows this sets Record#deleted_at and gives you all the scopes you need to work with your data.
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ! '>='
29
+ - !ruby/object:Gem::Version
30
+ version: '0'
31
+ - !ruby/object:Gem::Dependency
32
+ name: jeweler
33
+ requirement: !ruby/object:Gem::Requirement
34
+ none: false
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ type: :development
40
+ prerelease: false
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: rake
49
+ requirement: !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ - !ruby/object:Gem::Dependency
64
+ name: sqlite3
65
+ requirement: !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ! '>='
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ type: :development
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ description: Never Lose Data. Rather than deleting rows this sets Record#deleted_at
80
+ and gives you all the scopes you need to work with your data.
29
81
  email: gems@6brand.com
30
82
  executables: []
31
-
32
83
  extensions: []
33
-
34
- extra_rdoc_files:
84
+ extra_rdoc_files:
35
85
  - LICENSE
36
86
  - README.markdown
37
- files:
87
+ files:
38
88
  - .document
39
89
  - Gemfile
40
90
  - LICENSE
@@ -42,13 +92,13 @@ files:
42
92
  - README.markdown
43
93
  - Rakefile
44
94
  - VERSION
45
- - init.rb
46
- - install.rb
47
95
  - lib/permanent_records.rb
48
96
  - permanent_records.gemspec
49
97
  - test/comment.rb
50
98
  - test/database.yml
51
99
  - test/difficulty.rb
100
+ - test/dirt.rb
101
+ - test/earthworm.rb
52
102
  - test/hole.rb
53
103
  - test/kitty.rb
54
104
  - test/location.rb
@@ -58,34 +108,31 @@ files:
58
108
  - test/schema.rb
59
109
  - test/test_helper.rb
60
110
  - test/unused_model.rb
61
- - uninstall.rb
62
- has_rdoc: true
63
111
  homepage: http://github.com/JackDanger/permanent_records
64
112
  licenses: []
65
-
66
113
  post_install_message:
67
114
  rdoc_options: []
68
-
69
- require_paths:
115
+ require_paths:
70
116
  - lib
71
- required_ruby_version: !ruby/object:Gem::Requirement
117
+ required_ruby_version: !ruby/object:Gem::Requirement
72
118
  none: false
73
- requirements:
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- version: "0"
77
- required_rubygems_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ! '>='
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ segments:
124
+ - 0
125
+ hash: -2829435595636432217
126
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
127
  none: false
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: "0"
128
+ requirements:
129
+ - - ! '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
83
132
  requirements: []
84
-
85
133
  rubyforge_project:
86
- rubygems_version: 1.6.2
134
+ rubygems_version: 1.8.24
87
135
  signing_key:
88
136
  specification_version: 3
89
137
  summary: Soft-delete your ActiveRecord records
90
138
  test_files: []
91
-
data/init.rb DELETED
@@ -1 +0,0 @@
1
- require 'permanent_records'
data/install.rb DELETED
File without changes
data/uninstall.rb DELETED
@@ -1 +0,0 @@
1
- # Uninstall hook code here