permissable 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
@@ -45,7 +45,7 @@ module Permissable
45
45
 
46
46
  def cannot!(methods, resources)
47
47
  methods = [methods].flatten.uniq
48
- existing = permissions.for_resource(resource).with_permission_to(methods).all.collect{ |perm| perm.id }
48
+ existing = permissions.for_resource(resource).with_permission_to(methods).all.collect{ |perm| perm.id }.uniq
49
49
  Permission.destroy(existing)
50
50
  end
51
51
 
@@ -21,11 +21,12 @@ class Permission < ActiveRecord::Base
21
21
  perm = perm.is_a?(Array) ? perm.collect{ |p| p.to_s } : perm.to_s
22
22
  where(:permission_type => perm)
23
23
  end
24
- end
25
-
26
- def flatten(obj)
27
- return { :ids => obj, :types => obj.class.to_s } unless obj.is_a?(Array)
28
- { :ids => obj.collect{ |o| o.id }, :types => obj.collect{ |o| o.class.to_s } }
24
+
25
+ def flatten(obj)
26
+ return { :ids => obj, :types => obj.class.to_s } unless obj.is_a?(Array)
27
+ { :ids => obj.collect{ |o| o.id }, :types => obj.collect{ |o| o.class.to_s } }
28
+ end
29
+
29
30
  end
30
31
 
31
32
  end
data/permissable.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{permissable}
8
- s.version = "0.0.2"
8
+ s.version = "0.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Brent Kirby"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: permissable
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brent Kirby