Split of app/model/ticket.rb to app/model/ticket/search.rb and app/model/permission.rb.

This commit is contained in:
Martin Edenhofer 2013-08-17 23:10:36 +02:00
parent 4b623f9e8e
commit 9fa835014d
2 changed files with 17 additions and 2 deletions

View file

@ -24,11 +24,26 @@ class Ticket < ApplicationModel
include Ticket::Escalation include Ticket::Escalation
include Ticket::Subject include Ticket::Subject
include Ticket::Permission
extend Ticket::Search extend Ticket::Search
extend Ticket::Permission
attr_accessor :callback_loop attr_accessor :callback_loop
=begin
merge tickets
ticket = Ticket.find(123)
result = ticket.merge_to(
:ticket_id => 123,
)
returns
result = true|false
=end
def agent_of_group def agent_of_group
Group.find( self.group_id ).users.where( :active => true ).joins(:roles).where( 'roles.name' => 'Agent', 'roles.active' => true ).uniq() Group.find( self.group_id ).users.where( :active => true ).joins(:roles).where( 'roles.name' => 'Agent', 'roles.active' => true ).uniq()
end end

View file

@ -18,7 +18,7 @@ returns
=end =end
def self.search (params) def search (params)
# get params # get params
query = params[:query] query = params[:query]