archivable 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bab99e0cb1b1cb2dbf7aa144bff9246f28364be1
4
- data.tar.gz: 9c0ac440a506c6a33839a52fd9f060d8c7ba86c5
3
+ metadata.gz: d44e5bc4b028fa7d6ac216051693c1ecf972d1eb
4
+ data.tar.gz: 1e5453096684c7f2260a1098307018fae11e9f80
5
5
  SHA512:
6
- metadata.gz: 1c3575eb4962718d146ee01f45edb9a3429fc8cbfe43d2260c0f29d593673a03ca3b9cb6a00141352ef7466e182c55d71b030dc5892e61c019ce9ca8d22212e2
7
- data.tar.gz: 66f1f9297ffcc182b97e36d347f0abdeb525698fe799023d5d37cd300cc335f9d4e07a5a525c0a3166c0b131fcf0abbfd66c887d36a1910dcaeed36bdb7696d7
6
+ metadata.gz: a779492544bbc49bc9fce1800c2b305a2dc1473ee7e54e398176bcb8d8a5c21cac51caa1933315d239c2632da93fefdd29ed29dc5eb9e430253d1b5327623d8a
7
+ data.tar.gz: 72e4e0c6327ed264e14acc2e4ef4ef96a73bcd7ca186a1a114c0dec8db4182a61f3ccd498bd6d833f1baef89e3c08f3fcecac893f8e6ef1f7b490474a9d5c547
@@ -18,7 +18,8 @@ module Archivable
18
18
  end
19
19
 
20
20
  def archived
21
- assign_models_instance_variable_array.archived
21
+ instance_variable_set(:"@#{ controller_name }",
22
+ policy_scope(get_model_class).where(archived: true))
22
23
  render :index
23
24
  end
24
25
 
@@ -17,5 +17,15 @@ module Archivable
17
17
  def archived?
18
18
  archived
19
19
  end
20
+
21
+ def archive!
22
+ self.archived = true
23
+ save
24
+ end
25
+
26
+ def unarchive!
27
+ self.archived = false
28
+ save
29
+ end
20
30
  end
21
31
  end
@@ -1,3 +1,3 @@
1
1
  module Archivable
2
- VERSION = "0.0.2"
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: archivable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Otander
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-24 00:00:00.000000000 Z
11
+ date: 2014-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport