Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit fb089fd8a0ee2cfeb6882e993bbfe637847ddea5 Author: Rolf Schmidt <rolf.schmidt@znuny.com> Date: Wed May 3 17:12:24 2017 +0200 Moved touch_reference_by_params to own function. commit 13971570cba1bf0f437ff810792755c3bfbd8f1c Author: Rolf Schmidt <rolf.schmidt@znuny.com> Date: Wed May 3 16:20:15 2017 +0200 Added code to perform ticket deletions in frontend of zammad. commit 88a079b6a5558cbfe5f4b76bfdc74cde98d79e6a Author: Rolf Schmidt <rolf.schmidt@znuny.com> Date: Wed May 3 14:03:29 2017 +0200 Fixed test. commit c6e44a2027834f2f70b17f821232cbf8501a3f5c Author: Rolf Schmidt <rolf.schmidt@znuny.com> Date: Wed May 3 13:57:31 2017 +0200 Fixed pod. commit f0ed06be7d6759cbfeabaac5e2653b84f9646967 Author: Rolf Schmidt <rolf.schmidt@znuny.com> Date: Wed May 3 13:55:34 2017 +0200 Improved ticket object to kill all associations on destroy (#214). commit 56d39992045f5bf8fb91721f3fe7497d5d49f880 Merge: cbbbc00 7647849 Author: Rolf Schmidt <rolf.schmidt@znuny.com> Date: Wed May 3 09:38:03 2017 +0200 Merge branch 'develop' into private-bugfix-214-rs-develop commit cbbbc0039e9ecdaab185e7bc2fdee046e636eb3a Author: Rolf Schmidt <rolf.schmidt@znuny.com> Date: Tue May 2 16:53:21 2017 +0200 Reworked file structure of concerns. - can (new methods) - checks (events, pre/post function checks) - has (model related functions and events)
- Loading branch information
1 parent
057ecce
commit 7d2409b
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.
7d2409b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#214