lib/trust/controller/properties.rb in trust-0.8.3 vs lib/trust/controller/properties.rb in trust-1.4.2
- old
+ new
@@ -81,9 +81,21 @@
# Returns the class for the model
def model_class
model.to_s.classify.constantize
end
+ # => true if action is a new_action
+ def new_action?(action)
+ new_actions.include? action.to_sym
+ end
+ # => true if action is a collection_action
+ def collection_action?(action)
+ collection_actions.include? action.to_sym
+ end
+ # => true if action is a member_action
+ def member_action?(action)
+ member_actions.include? action.to_sym
+ end
# Specify associated resources (nested resources)
#
# === Example
#
# +belongs_to+ :lottery