acts_as_trashable 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.3
1
+ 1.0.4
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{acts_as_trashable}
8
- s.version = "1.0.3"
8
+ s.version = "1.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Brian Durand"]
12
- s.date = %q{2010-06-22}
12
+ s.date = %q{2010-10-08}
13
13
  s.description = %q{ActiveRecord extension that serializes destroyed records into a trash table from which they can be restored. This is intended to reduce the risk of users misusing your application's delete function and losing data.}
14
14
  s.email = %q{brian@embellishedvisions.com}
15
15
  s.extra_rdoc_files = [
@@ -35,7 +35,7 @@ module ActsAsTrashable
35
35
  connection.create_table :trash_records do |t|
36
36
  t.string :trashable_type, :null => false
37
37
  t.integer :trashable_id, :null => false
38
- t.binary :data, :limit => 5.megabytes
38
+ t.binary :data, :limit => (connection.adapter_name == "MySQL" ? 5.megabytes : nil)
39
39
  t.timestamp :created_at
40
40
  end
41
41
 
data/spec/spec_helper.rb CHANGED
@@ -5,19 +5,13 @@ require 'sqlite3'
5
5
  module ActsAsTrashable
6
6
  module Test
7
7
  def self.create_database
8
- db_dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'tmp'))
9
- Dir.mkdir(db_dir) unless File.exist?(db_dir)
10
- db = File.join(db_dir, 'test.sqlite3')
11
- ActiveRecord::Base.establish_connection("adapter" => "sqlite3", "database" => db)
8
+ ActiveRecord::Base.establish_connection("adapter" => "sqlite3", "database" => ":memory:")
12
9
  ActsAsTrashable::TrashRecord.create_table
13
10
  end
14
11
 
15
12
  def self.delete_database
16
- db_dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'tmp'))
17
- db = File.join(db_dir, 'test.sqlite3')
13
+ ActiveRecord::Base.connection.drop_table(ActsAsTrashable::TrashRecord.table_name)
18
14
  ActiveRecord::Base.connection.disconnect!
19
- File.delete(db) if File.exist?(db)
20
- Dir.delete(db_dir) if File.exist?(db_dir) and Dir.entries(db_dir).reject{|f| f.match(/^\.+$/)}.empty?
21
15
  end
22
16
  end
23
17
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_trashable
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 3
10
- version: 1.0.3
9
+ - 4
10
+ version: 1.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brian Durand
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-06-22 00:00:00 -05:00
18
+ date: 2010-10-08 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency