Permalink
Browse files

Rename action :delete to :destroy

  • Loading branch information...
1 parent 0337677 commit b778829679d8f296a4ef620b566ba5f98e84c4a3 @denyago committed Nov 27, 2012
Showing with 3 additions and 3 deletions.
  1. +2 −2 lib/heimdallr/proxy/record.rb
  2. +1 −1 spec/proxy_examples.rb
View
4 lib/heimdallr/proxy/record.rb
@@ -287,7 +287,7 @@ def inspect
#
# @return [Hash]
def reflect_on_security
- operations = @restrictions.actions | ( destroyable? ? [:delete] : [] )
+ operations = @restrictions.actions | ( destroyable? ? [:destroy] : [] )
{
model: @record.class,
context: @context,
@@ -319,7 +319,7 @@ def destroyable?
end
# Checks, if restrictions allow to do an +action+.
- # Standard actions like +:create+, +:update+, +:delete+
+ # Standard actions like +:create+, +:update+, +:destroy+
# and +:fetch+ can be extanded with custom ones.
#
# @return [Boolean]
View
2 spec/proxy_examples.rb
@@ -103,7 +103,7 @@ def run_specs(user_model, article_model, dont_save_model)
describe "contains all available actions in reflect_on_security[:operations]" do
it "of Proxy::Record" do
article = article_model.create! :owner_id => @john.id, :content => 'test', :secrecy_level => 4
- article.restrict(@john).reflect_on_security[:operations].should =~ [:create, :view, :update, :delete, :foo]
+ article.restrict(@john).reflect_on_security[:operations].should =~ [:create, :view, :update, :destroy, :foo]
article.restrict(@looser).reflect_on_security[:operations].should =~ [:create, :view]
end

0 comments on commit b778829

Please sign in to comment.