permanent_records 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest.txt ADDED
@@ -0,0 +1,18 @@
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
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.2
1
+ 1.0.4
@@ -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 => true}
4
+ base.named_scope :deleted, :conditions => :deleted_at
5
5
  base.named_scope :not_deleted, :conditions => { :deleted_at => nil }
6
6
  else
7
7
  base.extend LegacyScopes
@@ -5,19 +5,19 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{permanent_records}
8
- s.version = "1.0.2"
8
+ s.version = "1.0.3"
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-26}
12
+ s.date = %q{2009-09-27}
13
13
  s.description = %q{Rather than actually deleting data this just sets Record#deleted_at. Provides helpful scopes.}
14
14
  s.email = %q{gems@6brand.com}
15
15
  s.extra_rdoc_files = [
16
16
  "README"
17
17
  ]
18
18
  s.files = [
19
- ".document",
20
- "MIT-LICENSE",
19
+ "MIT-LICENSE",
20
+ "Manifest.txt",
21
21
  "README",
22
22
  "Rakefile",
23
23
  "VERSION",
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
25
25
  "install.rb",
26
26
  "lib/permanent_records.rb",
27
27
  "permanent_records.gemspec",
28
+ "tasks/permanent_records_tasks.rake",
28
29
  "test/database.yml",
29
30
  "test/hole.rb",
30
31
  "test/kitty.rb",
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :permanent_records do
3
+ # # Task goes here
4
+ # end
@@ -78,6 +78,16 @@ class PermanentRecordsTest < ActiveSupport::TestCase
78
78
  assert !@deleted.destroy.revive.revive.destroy.destroy.revive.deleted?
79
79
  end
80
80
 
81
+ def test_with_counting_on_deleted_limits_scope_to_count_deleted_records
82
+ assert_equal Muskrat.deleted.length,
83
+ Muskrat.deleted.count
84
+ end
85
+
86
+ def test_with_counting_on_not_deleted_limits_scope_to_count_not_deleted_records
87
+ assert_equal Muskrat.not_deleted.length,
88
+ Muskrat.not_deleted.count
89
+ end
90
+
81
91
  def test_with_deleted_limits_scope_to_deleted_records
82
92
  assert Muskrat.deleted.all?(&:deleted?)
83
93
  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.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Danger Canty
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-26 00:00:00 -07:00
12
+ date: 2009-09-27 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -22,8 +22,8 @@ extensions: []
22
22
  extra_rdoc_files:
23
23
  - README
24
24
  files:
25
- - .document
26
25
  - MIT-LICENSE
26
+ - Manifest.txt
27
27
  - README
28
28
  - Rakefile
29
29
  - VERSION
@@ -31,6 +31,7 @@ files:
31
31
  - install.rb
32
32
  - lib/permanent_records.rb
33
33
  - permanent_records.gemspec
34
+ - tasks/permanent_records_tasks.rake
34
35
  - test/database.yml
35
36
  - test/hole.rb
36
37
  - test/kitty.rb
data/.document DELETED
@@ -1,6 +0,0 @@
1
- init.rb
2
- uninstall.rb
3
- rails/*
4
- test/*
5
- README
6
- MIT-LICENSE