Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b1a379
commit c826229
Showing
12 changed files
with
360 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/ | ||
module HasKarmaActivityLog | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
before_destroy :karma_activity_log_destroy | ||
end | ||
|
||
=begin | ||
delete object online notification list, will be executed automatically | ||
model = Model.find(123) | ||
model.karma_activity_log_destroy | ||
=end | ||
|
||
def karma_activity_log_destroy | ||
Karma::ActivityLog.remove(self.class.to_s, id) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/ | ||
module HasLinks | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
before_destroy :links_destroy | ||
end | ||
|
||
=begin | ||
delete object link list, will be executed automatically | ||
model = Model.find(123) | ||
model.links_destroy | ||
=end | ||
|
||
def links_destroy | ||
Link.remove_all( | ||
link_object: self.class.to_s, | ||
link_object_value: id, | ||
) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/ | ||
module HasOnlineNotifications | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
before_destroy :online_notification_destroy | ||
end | ||
|
||
=begin | ||
delete object online notification list, will be executed automatically | ||
model = Model.find(123) | ||
model.online_notification_destroy | ||
=end | ||
|
||
def online_notification_destroy | ||
OnlineNotification.remove(self.class.to_s, id) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FactoryGirl.define do | ||
factory :online_notification do | ||
object_lookup_id { ObjectLookup.by_name('Ticket') } | ||
type_lookup_id { TypeLookup.by_name('Assigned to you') } | ||
seen false | ||
user_id 1 | ||
created_by_id 1 | ||
updated_by_id 1 | ||
created_at Time.zone.now | ||
updated_at Time.zone.now | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FactoryGirl.define do | ||
factory :tag do | ||
tag_object_id { Tag::Object.lookup_by_name_and_create('Ticket').id } | ||
tag_item_id { Tag::Item.lookup_by_name_and_create('blub').id } | ||
created_by_id 1 | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FactoryGirl.define do | ||
factory :ticket_article, class: Ticket::Article do | ||
from 'factory-customer-1@example.com' | ||
to 'factory-customer-1@example.com' | ||
subject 'factory article' | ||
message_id 'factory@id_com_1' | ||
body 'some message 123' | ||
internal false | ||
sender { Ticket::Article::Sender.find_by(name: 'Customer') } | ||
type { Ticket::Article::Type.find_by(name: 'email') } | ||
updated_by_id 1 | ||
created_by_id 1 | ||
end | ||
end |
Oops, something went wrong.