permanent_records 1.0.3 → 1.0.5

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/.document ADDED
@@ -0,0 +1,6 @@
1
+ init.rb
2
+ uninstall.rb
3
+ rails/*
4
+ test/*
5
+ README
6
+ MIT-LICENSE
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ test/debug.log
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ begin
6
6
  Jeweler::Tasks.new do |gem|
7
7
  gem.name = "permanent_records"
8
8
  gem.summary = %Q{Soft-delete your ActiveRecord records}
9
- gem.description = %Q{Rather than actually deleting data this just sets Record#deleted_at. Provides helpful scopes.}
9
+ gem.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.}
10
10
  gem.email = "gems@6brand.com"
11
11
  gem.homepage = "http://github.com/JackDanger/permanent_records"
12
12
  gem.authors = ["Jack Danger Canty"]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.4
1
+ 1.0.6
data/init.rb CHANGED
@@ -1,3 +1 @@
1
1
  require 'permanent_records'
2
-
3
- ActiveRecord::Base.send :include, PermanentRecords
@@ -1,7 +1,7 @@
1
1
  module PermanentRecords
2
2
  def self.included(base)
3
3
  if base.respond_to?(:named_scope)
4
- base.named_scope :deleted, :conditions => :deleted_at
4
+ base.named_scope :deleted, :conditions => 'deleted_at IS NOT NULL'
5
5
  base.named_scope :not_deleted, :conditions => { :deleted_at => nil }
6
6
  else
7
7
  base.extend LegacyScopes
@@ -83,3 +83,5 @@ module PermanentRecords
83
83
  end
84
84
  end
85
85
  end
86
+ ActiveRecord::Base.send :include, PermanentRecords
87
+
@@ -5,19 +5,20 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{permanent_records}
8
- s.version = "1.0.3"
8
+ s.version = "1.0.5"
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"]
12
- s.date = %q{2009-09-27}
13
- s.description = %q{Rather than actually deleting data this just sets Record#deleted_at. Provides helpful scopes.}
12
+ s.date = %q{2009-11-13}
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
14
  s.email = %q{gems@6brand.com}
15
15
  s.extra_rdoc_files = [
16
16
  "README"
17
17
  ]
18
18
  s.files = [
19
- "MIT-LICENSE",
20
- "Manifest.txt",
19
+ ".document",
20
+ ".gitignore",
21
+ "MIT-LICENSE",
21
22
  "README",
22
23
  "Rakefile",
23
24
  "VERSION",
@@ -25,7 +26,6 @@ Gem::Specification.new do |s|
25
26
  "install.rb",
26
27
  "lib/permanent_records.rb",
27
28
  "permanent_records.gemspec",
28
- "tasks/permanent_records_tasks.rake",
29
29
  "test/database.yml",
30
30
  "test/hole.rb",
31
31
  "test/kitty.rb",
@@ -82,12 +82,12 @@ class PermanentRecordsTest < ActiveSupport::TestCase
82
82
  assert_equal Muskrat.deleted.length,
83
83
  Muskrat.deleted.count
84
84
  end
85
-
85
+
86
86
  def test_with_counting_on_not_deleted_limits_scope_to_count_not_deleted_records
87
87
  assert_equal Muskrat.not_deleted.length,
88
88
  Muskrat.not_deleted.count
89
89
  end
90
-
90
+
91
91
  def test_with_deleted_limits_scope_to_deleted_records
92
92
  assert Muskrat.deleted.all?(&:deleted?)
93
93
  end
data/test/schema.rb CHANGED
@@ -1,21 +1,21 @@
1
1
  ActiveRecord::Schema.define(:version => 1) do
2
2
 
3
- create_table :muskrats do |t|
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
- create_table :kitties do |t|
9
+ create_table :kitties, :force => true do |t|
10
10
  t.column :name, :string
11
11
  end
12
12
 
13
- create_table :holes do |t|
13
+ create_table :holes, :force => true do |t|
14
14
  t.integer :number
15
15
  t.datetime :deleted_at
16
16
  end
17
17
 
18
- create_table :moles do |t|
18
+ create_table :moles, :force => true do |t|
19
19
  t.string :name
20
20
  t.references :hole
21
21
  end
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: 1.0.3
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Danger Canty
@@ -9,11 +9,11 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-27 00:00:00 -07:00
12
+ date: 2009-11-13 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
16
- description: Rather than actually deleting data this just sets Record#deleted_at. Provides helpful scopes.
16
+ 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.
17
17
  email: gems@6brand.com
18
18
  executables: []
19
19
 
@@ -22,8 +22,9 @@ extensions: []
22
22
  extra_rdoc_files:
23
23
  - README
24
24
  files:
25
+ - .document
26
+ - .gitignore
25
27
  - MIT-LICENSE
26
- - Manifest.txt
27
28
  - README
28
29
  - Rakefile
29
30
  - VERSION
@@ -31,7 +32,6 @@ files:
31
32
  - install.rb
32
33
  - lib/permanent_records.rb
33
34
  - permanent_records.gemspec
34
- - tasks/permanent_records_tasks.rake
35
35
  - test/database.yml
36
36
  - test/hole.rb
37
37
  - test/kitty.rb
data/Manifest.txt DELETED
@@ -1,18 +0,0 @@
1
- MIT-LICENSE
2
- Manifest.txt
3
- README
4
- Rakefile
5
- init.rb
6
- install.rb
7
- lib/permanent_records.rb
8
- tasks/permanent_records_tasks.rake
9
- test/cached_values_test.rb
10
- test/database.yml
11
- test/hole.rb
12
- test/kitty.rb
13
- test/mole.rb
14
- test/muskrat.rb
15
- test/permanent_records_test.rb
16
- test/schema.rb
17
- test/test_helper.rb
18
- uninstall.rb
@@ -1,4 +0,0 @@
1
- # desc "Explaining what the task does"
2
- # task :permanent_records do
3
- # # Task goes here
4
- # end