acts_as_archive 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -41,15 +41,15 @@ end
41
41
  config/acts\_as\_archive.yml
42
42
  ----------------------------
43
43
 
44
+ Create <code>config/acts\_as\_archive.yml</code> to define the archive class and archive table for each of your models:
45
+
44
46
  <pre>
45
47
  Article:
46
48
  - class: Article::Archive
47
49
  table: archived_articles
48
50
  </pre>
49
51
 
50
- Specify the name of your model, the name of the archive class, and the name of the archive table.
51
-
52
- If the archive model is created automatically if it does not exist.
52
+ It is expected that neither the archive class or archive table exist yet. <code>ActsAsArchive</code> will create these automatically.
53
53
 
54
54
  Migrate
55
55
  -------
@@ -78,7 +78,7 @@ No action is necessary on your part.
78
78
  Query the archive
79
79
  -----------------
80
80
 
81
- Use the Archive model you specified in the configuration:
81
+ Use the archive class you specified in the configuration:
82
82
 
83
83
  <pre>
84
84
  Article::Archive.first
@@ -104,6 +104,8 @@ Article::Archive.first.destroy
104
104
  Article::Archive.delete_all([ "id in (?)", [ 1, 2, 3 ] ])
105
105
  </pre>
106
106
 
107
+ Any relationships that were automatically archived will be restored as well.
108
+
107
109
  Magic columns
108
110
  -------------
109
111
 
@@ -1,10 +1,10 @@
1
1
  acts_as_archive:
2
- rake: >=0.8.7
3
- rspec: ~>1.0
2
+ rake: ">=0.8.7"
3
+ rspec: "~>1.0"
4
4
  default:
5
- active_wrapper-solo: =0.4.4
6
- also_migrate: =0.3.5
7
- externals: =1.0.2
8
- framework_fixture: =0.1.3
9
- mover: =0.3.6
10
- rack-test: =0.5.6
5
+ active_wrapper-solo: "=0.4.4"
6
+ also_migrate: "=0.3.5"
7
+ externals: "=1.0.2"
8
+ framework_fixture: "=0.1.3"
9
+ mover: "=0.3.6"
10
+ rack-test: "=0.5.6"
@@ -1,5 +1,5 @@
1
1
  name: acts_as_archive
2
- version: 0.4.0
2
+ version: 0.4.1
3
3
  authors:
4
4
  - Winton Welsh
5
5
  email: mail@wintoni.us
@@ -208,7 +208,7 @@ class ActsAsArchive
208
208
  @mutex.synchronize do
209
209
  unless ActsAsArchive.disabled
210
210
  from, where = /DELETE FROM (.+)/i.match(sql)[1].split(/\s+WHERE\s+/i, 2)
211
- from = from.strip.gsub(/`/, '').split(/\s*,\s*/)
211
+ from = from.strip.gsub(/[`"]/, '').split(/\s*,\s*/)
212
212
 
213
213
  ActsAsArchive.find(from).each do |config|
214
214
  ActsAsArchive.move(config, where)
@@ -226,4 +226,4 @@ end
226
226
  ::ActiveRecord::ConnectionAdapters::DatabaseStatements.send(:include, ::ActsAsArchive::DatabaseStatements)
227
227
 
228
228
  require "acts_as_archive/adapters/rails#{Rails.version[0..0]}" if defined?(Rails)
229
- require "acts_as_archive/adapters/sinatra" if defined?(Sinatra)
229
+ require "acts_as_archive/adapters/sinatra" if defined?(Sinatra)
metadata CHANGED
@@ -1,61 +1,45 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: acts_as_archive
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 4
8
- - 0
9
- version: 0.4.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.4.1
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Winton Welsh
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2011-01-25 00:00:00 -08:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2011-11-21 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: also_migrate
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70215774523160 !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - "="
27
- - !ruby/object:Gem::Version
28
- segments:
29
- - 0
30
- - 3
31
- - 5
18
+ requirements:
19
+ - - =
20
+ - !ruby/object:Gem::Version
32
21
  version: 0.3.5
33
22
  type: :runtime
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: mover
37
23
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70215774523160
25
+ - !ruby/object:Gem::Dependency
26
+ name: mover
27
+ requirement: &70215774522660 !ruby/object:Gem::Requirement
39
28
  none: false
40
- requirements:
41
- - - "="
42
- - !ruby/object:Gem::Version
43
- segments:
44
- - 0
45
- - 3
46
- - 6
29
+ requirements:
30
+ - - =
31
+ - !ruby/object:Gem::Version
47
32
  version: 0.3.6
48
33
  type: :runtime
49
- version_requirements: *id002
50
- description: Don't delete your records, move them to a different table. Like acts_as_paranoid, but doesn't mess with your SQL queries.
34
+ prerelease: false
35
+ version_requirements: *70215774522660
36
+ description: Don't delete your records, move them to a different table. Like acts_as_paranoid,
37
+ but doesn't mess with your SQL queries.
51
38
  email: mail@wintoni.us
52
39
  executables: []
53
-
54
40
  extensions: []
55
-
56
41
  extra_rdoc_files: []
57
-
58
- files:
42
+ files:
59
43
  - .gitignore
60
44
  - LICENSE
61
45
  - README.md
@@ -109,39 +93,31 @@ files:
109
93
  - spec/run
110
94
  - spec/spec.opts
111
95
  - spec/spec_helper.rb
112
- has_rdoc: true
113
96
  homepage: http://github.com/winton/acts_as_archive
114
97
  licenses: []
115
-
116
98
  post_install_message:
117
99
  rdoc_options: []
118
-
119
- require_paths:
100
+ require_paths:
120
101
  - lib
121
- required_ruby_version: !ruby/object:Gem::Requirement
102
+ required_ruby_version: !ruby/object:Gem::Requirement
122
103
  none: false
123
- requirements:
124
- - - ">="
125
- - !ruby/object:Gem::Version
126
- segments:
127
- - 0
128
- version: "0"
129
- required_rubygems_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ! '>='
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ required_rubygems_version: !ruby/object:Gem::Requirement
130
109
  none: false
131
- requirements:
132
- - - ">="
133
- - !ruby/object:Gem::Version
134
- segments:
135
- - 0
136
- version: "0"
110
+ requirements:
111
+ - - ! '>='
112
+ - !ruby/object:Gem::Version
113
+ version: '0'
137
114
  requirements: []
138
-
139
115
  rubyforge_project:
140
- rubygems_version: 1.3.7
116
+ rubygems_version: 1.8.6
141
117
  signing_key:
142
118
  specification_version: 3
143
119
  summary: Don't delete your records, move them to a different table
144
- test_files:
120
+ test_files:
145
121
  - spec/Rakefile
146
122
  - spec/acts_as_archive/gems_spec.rb
147
123
  - spec/acts_as_archive_spec.rb