rails-trash 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/rails-trash.rb +5 -3
  2. metadata +28 -34
@@ -21,9 +21,11 @@ module Rails
21
21
 
22
22
  module ClassMethodsMixin
23
23
 
24
- def deleted
24
+ def deleted(field = nil, value = nil)
25
25
  deleted_at = Arel::Table.new(self.table_name)[:deleted_at]
26
- unscoped.where(deleted_at.not_eq(nil))
26
+ data = unscoped
27
+ data = data.where(field => value) if field && value
28
+ data.where(deleted_at.not_eq(nil))
27
29
  end
28
30
 
29
31
  def find_in_trash(id)
@@ -64,7 +66,7 @@ module Rails
64
66
  end
65
67
 
66
68
  def trashed?
67
- deleted_at.present?
69
+ deleted_at.present?
68
70
  end
69
71
 
70
72
  end
metadata CHANGED
@@ -1,64 +1,58 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rails-trash
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.2
4
5
  prerelease:
5
- version: 1.1.1
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Francesc Esplugas
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-06-14 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2011-07-15 00:00:00.000000000 +02:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
16
  name: rails
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &2153320580 !ruby/object:Gem::Requirement
19
18
  none: false
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
23
22
  version: 3.0.0
24
23
  type: :runtime
25
- version_requirements: *id001
24
+ prerelease: false
25
+ version_requirements: *2153320580
26
26
  description:
27
27
  email: contact@francescesplugas.com
28
28
  executables: []
29
-
30
29
  extensions: []
31
-
32
30
  extra_rdoc_files: []
33
-
34
- files:
31
+ files:
35
32
  - lib/rails-trash.rb
33
+ has_rdoc: true
36
34
  homepage: https://github.com/fesplugas/rails-trash
37
35
  licenses: []
38
-
39
36
  post_install_message:
40
37
  rdoc_options: []
41
-
42
- require_paths:
38
+ require_paths:
43
39
  - lib
44
- required_ruby_version: !ruby/object:Gem::Requirement
40
+ required_ruby_version: !ruby/object:Gem::Requirement
45
41
  none: false
46
- requirements:
47
- - - ">="
48
- - !ruby/object:Gem::Version
49
- version: "0"
50
- required_rubygems_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
47
  none: false
52
- requirements:
53
- - - ">="
54
- - !ruby/object:Gem::Version
55
- version: "0"
48
+ requirements:
49
+ - - ! '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
56
52
  requirements: []
57
-
58
53
  rubyforge_project:
59
- rubygems_version: 1.8.5
54
+ rubygems_version: 1.6.2
60
55
  signing_key:
61
56
  specification_version: 3
62
57
  summary: Trash
63
58
  test_files: []
64
-