redmine_remotes 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/redmine_remotes/tableless/remote_issue_fetch/base/_local_issue.rb +26 -1
- data/app/models/redmine_remotes/tableless/remote_issue_fetch/create.rb +1 -1
- data/app/models/redmine_remotes/tableless/remote_issue_fetch/create/_local_issue.rb +5 -11
- data/app/models/redmine_remotes/tableless/remote_issue_fetch/update.rb +1 -1
- data/app/models/redmine_remotes/tableless/remote_issue_fetch/update/_local_issue.rb +0 -7
- data/lib/redmine_remotes/jira/entities/issue.rb +0 -4
- data/lib/redmine_remotes/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd846a3cc1a788360a4b120472ea5fe1d8f8d55835a95a3af3e842fe77e1d898
|
4
|
+
data.tar.gz: d4c1a544d79c5cedd5db4030df30d61cb021813a2b96457d039c77e1c35d5821
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 429c14c070e2c1d8fe18aa45d08eeb2561fc144397811e45c6f0b6571fc85e8fce06dd3c01798c47aa78b9b7ecef313e43d6352c2dd4615dd1d87e588085a2b0
|
7
|
+
data.tar.gz: 87dbdb0ddf2fb97b7db523512c5687e38c8982abf08cc1d4013c3bcd708162a9b240b93a2b39b002b078c9db883068367df158e646cf8bb5bfafecd2323b697f
|
@@ -6,11 +6,36 @@ module RedmineRemotes
|
|
6
6
|
class Base < ::EacRailsUtils::TablelessModel
|
7
7
|
private
|
8
8
|
|
9
|
+
def save_local_issue
|
10
|
+
save_local_issue_except_create_on && save_local_issue_created_on
|
11
|
+
end
|
12
|
+
|
13
|
+
def save_local_issue_created_on
|
14
|
+
local_issue_provider_attributes[:created_on].if_present do |created_on|
|
15
|
+
if created_on.present? && local_issue.created_on != created_on
|
16
|
+
local_issue.update_column( # rubocop:disable Rails/SkipsModelValidations
|
17
|
+
:created_on, created_on
|
18
|
+
)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
true
|
23
|
+
end
|
24
|
+
|
25
|
+
def save_local_issue_except_create_on
|
26
|
+
local_issue_provider_attributes.except(:created_on)
|
27
|
+
.each { |attr, value| local_issue.send("#{attr}=", value) }
|
28
|
+
return true if local_issue.save
|
29
|
+
|
30
|
+
fetch_record_errors(local_issue, default_column: default_error_column)
|
31
|
+
false
|
32
|
+
end
|
33
|
+
|
9
34
|
def local_issue_provider_attributes
|
10
35
|
{
|
11
36
|
subject: local_issue_subject, author: local_issue_author, status: local_issue_status,
|
12
37
|
description: local_issue_description,
|
13
|
-
created_on: provider_issue.created_on
|
38
|
+
created_on: provider_issue.created_on
|
14
39
|
}
|
15
40
|
end
|
16
41
|
|
@@ -6,20 +6,14 @@ module RedmineRemotes
|
|
6
6
|
class Create < ::RedmineRemotes::Tableless::RemoteIssueFetch::Base
|
7
7
|
private
|
8
8
|
|
9
|
-
def
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
false
|
9
|
+
def local_issue_provider_attributes
|
10
|
+
super.merge(
|
11
|
+
project: project, tracker: local_tracker, priority: local_issue_priority
|
12
|
+
)
|
14
13
|
end
|
15
14
|
|
16
15
|
def local_issue_uncached
|
17
|
-
remote_issue_by_remote_code.if_present
|
18
|
-
::Issue.new(
|
19
|
-
local_issue_provider_attributes.merge(
|
20
|
-
project: project, tracker: local_tracker, priority: local_issue_priority
|
21
|
-
)
|
22
|
-
)
|
16
|
+
remote_issue_by_remote_code.if_present(&:local_issue) || ::Issue.new
|
23
17
|
end
|
24
18
|
|
25
19
|
def local_issue_priority
|
@@ -13,13 +13,6 @@ module RedmineRemotes
|
|
13
13
|
def local_tracker
|
14
14
|
local_issue.if_present(&:tracker)
|
15
15
|
end
|
16
|
-
|
17
|
-
def update_local_issue_with_remote_data
|
18
|
-
return true if local_issue.update(local_issue_provider_attributes)
|
19
|
-
|
20
|
-
fetch_record_errors(local_issue, default_column: default_error_column)
|
21
|
-
false
|
22
|
-
end
|
23
16
|
end
|
24
17
|
end
|
25
18
|
end
|