thwart 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/thwart/actions_store.rb +3 -3
- data/lib/thwart.rb +1 -1
- data/thwart.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/lib/thwart/actions_store.rb
CHANGED
@@ -14,7 +14,7 @@ module Thwart
|
|
14
14
|
#
|
15
15
|
# @param [Symbol] able_method The name of the [action-able]_by? method to check for.
|
16
16
|
def has_able?(able)
|
17
|
-
self.actions.has_value?(able)
|
17
|
+
self.actions.has_value?(able.to_sym)
|
18
18
|
end
|
19
19
|
|
20
20
|
# Returns true if Thwart is providing methods for the can_[action]? style action
|
@@ -22,14 +22,14 @@ module Thwart
|
|
22
22
|
#
|
23
23
|
# @param [Symbol] able_method The name of the can_[action]? method to check for.
|
24
24
|
def has_can?(can)
|
25
|
-
self.actions.has_key?(can)
|
25
|
+
self.actions.has_key?(can.to_sym)
|
26
26
|
end
|
27
27
|
|
28
28
|
# Finds the corresponding can from an able.
|
29
29
|
#
|
30
30
|
# @param [Symbol] able_method The name of the [action-able]_by? method.
|
31
31
|
def can_from_able(able)
|
32
|
-
self.actions.key(able)
|
32
|
+
self.actions.key(able.to_sym)
|
33
33
|
end
|
34
34
|
|
35
35
|
# Adds an action to actions and the correct methods to can and able modules.
|
data/lib/thwart.rb
CHANGED
@@ -30,7 +30,7 @@ module Thwart
|
|
30
30
|
# autoload :Dsl, 'thwart/dsl'
|
31
31
|
|
32
32
|
# The default can => able methods for CRUD
|
33
|
-
CrudActions = {:create => :creatable, :
|
33
|
+
CrudActions = {:create => :creatable, :show => :shoew, :update => :updatable, :destroy => :destroyable}
|
34
34
|
|
35
35
|
Actions = ActionsStore.new
|
36
36
|
Roles = RoleRegistry.new
|
data/thwart.gemspec
CHANGED