permanent_records 3.0.3 → 3.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +9 -12
- data/Rakefile +15 -1
- data/VERSION +1 -1
- data/lib/permanent_records.rb +2 -2
- data/permanent_records.gemspec +3 -1
- metadata +5 -3
data/Gemfile
CHANGED
@@ -1,16 +1,13 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
|
3
|
+
ver = ENV['AR_TEST_VERSION']
|
4
|
+
ver = ver.dup.chomp if ver
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
gem 'sqlite3'
|
10
|
-
end
|
6
|
+
gem 'pg'
|
7
|
+
gem 'activerecord', ver
|
8
|
+
gem 'activesupport', ver
|
9
|
+
gem 'rake'
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
gem 'database_cleaner'
|
16
|
-
end
|
11
|
+
gem 'awesome_print'
|
12
|
+
gem 'database_cleaner'
|
13
|
+
gem 'rspec'
|
data/Rakefile
CHANGED
@@ -1,12 +1,26 @@
|
|
1
1
|
require 'bundler'
|
2
|
+
require 'yaml'
|
2
3
|
Bundler::GemHelper.install_tasks
|
3
4
|
|
5
|
+
$config = YAML::load_file File.expand_path('spec/support/database.yml', File.dirname(__FILE__))
|
6
|
+
|
7
|
+
def test_database_exists?
|
8
|
+
system "psql -l | grep -q #{$config['test'][:database]}"
|
9
|
+
$?.success?
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_test_database
|
13
|
+
system "createdb #{$config['test'][:database]}"
|
14
|
+
end
|
15
|
+
|
4
16
|
namespace :db do
|
5
17
|
task :create do
|
6
|
-
|
18
|
+
create_test_database unless test_database_exists?
|
7
19
|
end
|
8
20
|
end
|
9
21
|
|
22
|
+
task :default => [:spec]
|
23
|
+
|
10
24
|
desc 'Run all tests'
|
11
25
|
task :spec => 'db:create' do
|
12
26
|
exec 'rspec'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.1.3
|
data/lib/permanent_records.rb
CHANGED
@@ -29,7 +29,7 @@ module PermanentRecords
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def revive
|
32
|
-
|
32
|
+
run_callbacks(:revive) { set_deleted_at nil }
|
33
33
|
self
|
34
34
|
end
|
35
35
|
|
@@ -65,7 +65,7 @@ module PermanentRecords
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def destroy_with_permanent_records(force = nil)
|
68
|
-
|
68
|
+
run_callbacks(:destroy) do
|
69
69
|
deleted? || new_record? ? save : set_deleted_at(Time.now, force)
|
70
70
|
end
|
71
71
|
self
|
data/permanent_records.gemspec
CHANGED
@@ -3,12 +3,14 @@
|
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
|
+
require 'date'
|
7
|
+
|
6
8
|
Gem::Specification.new do |s|
|
7
9
|
s.name = "permanent_records"
|
8
10
|
s.version = File.read('VERSION')
|
9
11
|
|
10
12
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Jack Danger Canty", "David Sulc"]
|
13
|
+
s.authors = ["Jack Danger Canty", "David Sulc", "Joe Nelson", "Trond Arve Nordheim"]
|
12
14
|
s.date = Date.today.to_s
|
13
15
|
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
16
|
s.email = "gems@6brand.com"
|
metadata
CHANGED
@@ -1,16 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: permanent_records
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jack Danger Canty
|
9
9
|
- David Sulc
|
10
|
+
- Joe Nelson
|
11
|
+
- Trond Arve Nordheim
|
10
12
|
autorequire:
|
11
13
|
bindir: bin
|
12
14
|
cert_chain: []
|
13
|
-
date: 2013-
|
15
|
+
date: 2013-04-01 00:00:00.000000000 Z
|
14
16
|
dependencies:
|
15
17
|
- !ruby/object:Gem::Dependency
|
16
18
|
name: activerecord
|
@@ -90,7 +92,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
90
92
|
version: '0'
|
91
93
|
segments:
|
92
94
|
- 0
|
93
|
-
hash:
|
95
|
+
hash: 3995586655398578288
|
94
96
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
97
|
none: false
|
96
98
|
requirements:
|