diff --git a/lib/acts-as-messageable/scopes.rb b/lib/acts-as-messageable/scopes.rb index fba864d56..020aa321d 100644 --- a/lib/acts-as-messageable/scopes.rb +++ b/lib/acts-as-messageable/scopes.rb @@ -13,8 +13,8 @@ def initialize_scopes scope :are_from, lambda { |*args| where(:sent_messageable_id => args.first, :sent_messageable_type => args.first.class.name) } scope :are_to, lambda { |*args| where(:received_messageable_id => args.first, :received_messageable_type => args.first.class.name) } scope ActsAsMessageable.search_scope_name, - lambda { |*args| where("body like :search_txt or topic like :search_txt",:search_txt => "%#{args.first}%")} - scope :connected_with, lambda { |*args| where("(sent_messageable_type = :sent_type and + lambda { |*args| where("body like :search_txt or topic like :search_txt", :search_txt => "%#{args.first}%") } + scope :connected_with, lambda { |*args| where("(sent_messageable_type = :sent_type and sent_messageable_id = :sent_id and sender_delete = :s_delete and sender_permanent_delete = :s_perm_delete) or (received_messageable_type = :received_type and