Skip to content
Browse files

Use Arel to generate default document scope

  • Loading branch information...
1 parent 8a17d2f commit 5cdefe425a6ae0c104c24d7ca1623ae8f5d27dc1 @tomstuart tomstuart committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/models/document/workflow.rb
View
2 app/models/document/workflow.rb
@@ -5,7 +5,7 @@ module Document::Workflow
include ::Transitions
include ActiveRecord::Transitions
- default_scope where(%{documents.state <> "deleted"})
+ default_scope where(arel_table[:state].not_eq('deleted'))
define_model_callbacks :publish, :archive, only: :after
set_callback :publish, :after do

0 comments on commit 5cdefe4

Please sign in to comment.
Something went wrong with that request. Please try again.