redmine_remotes 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5f35dbfa9b3937fe817de6c4b40ee9d2478f8cf109a4972dcf23013af7aaf38
4
- data.tar.gz: a9351636d9086cb45149db0221ec92dc74ac7d9860e8b98720be6544b799c31e
3
+ metadata.gz: 4b65843d810df106f89cfab8c6da6beef03d5421263f21a7b7730e9dab08ce13
4
+ data.tar.gz: ec23913f8340a42f5c69f28e0f24f72baacf3b59b38adb9d8f32dadeca9fc06c
5
5
  SHA512:
6
- metadata.gz: f0019b818f02217850e974d6ae9095f887349db3bf732965038abbc51438e5f00b6c622e844748bdccb87c074cddbddfff2b94e501610c16af8b8afb8a44ba8d
7
- data.tar.gz: cf17dc61038a50092c9e4158303d9678ef57a3a2b561d2c38b4a7a568e006e4384e58cd70e92b3e10363941cc921ec07a2ab28a831cd78b15ce75545c2fac887
6
+ metadata.gz: 886781f236327ed6e0d30d26f3950e80a07629c3c2905c8bf98a50cb8c9ed10daa9be495c804059d2ac195816894c77ee2af43e87d3c253ccb20a568bcd0bb5d
7
+ data.tar.gz: 41578f7e2bfa7a6c97bdad8cc9bff55c1a8e26f8099d5ba824c0b0e420ed746ee46f8058b6d9cfb8069de6fc6dda8c4b16b5ed566bce325abada1043e1b268dd
@@ -9,6 +9,7 @@ class RemoteIssuesController < ApplicationController
9
9
  require_permission PERMISSIONS
10
10
 
11
11
  active_scaffold :remote_issue do |conf|
12
- conf.columns[:tracker].form_ui = :select
12
+ conf.columns[:remote_tracker].form_ui = :select
13
+ conf.actions.exclude :create, :update, :delete
13
14
  end
14
15
  end
@@ -11,16 +11,13 @@ module RedmineRemotes
11
11
  require_sub __FILE__
12
12
  include ::Eac::Model
13
13
 
14
+ validates :local_tracker, presence: true
15
+ validates :remote_tracker, presence: true
16
+ validates :issue_remote_code, presence: true
17
+
14
18
  validate :author_present
15
19
  validate :provider_issue_present
16
20
 
17
- def tracker_in_project
18
- return unless local_tracker.present? && project.present?
19
- return if project.trackers.include?(local_tracker)
20
-
21
- errors.add(:local_tracker, 'is not a tracker of project')
22
- end
23
-
24
21
  def author_present
25
22
  return if provider_issue.blank?
26
23
  return if local_issue_author.present?
@@ -15,10 +15,7 @@ module RedmineRemotes
15
15
  belongs_to :project, class_name: 'Project'
16
16
  belongs_to :remote_tracker, class_name: 'RemoteTracker'
17
17
 
18
- validates :local_tracker, presence: true
19
- validates :remote_tracker, presence: true
20
18
  validates :project, presence: true
21
- validates :issue_remote_code, presence: true
22
19
 
23
20
  validate :tracker_in_project
24
21
 
@@ -47,8 +44,12 @@ module RedmineRemotes
47
44
  end
48
45
 
49
46
  def update
50
- ::RedmineRemotes::Tableless::RemoteIssueFetch::Update
51
- .new(remote_issue: remote_issue_by_remote_code).save
47
+ update_record = ::RedmineRemotes::Tableless::RemoteIssueFetch::Update
48
+ .new(remote_issue: remote_issue_by_remote_code)
49
+ return true if update_record.save
50
+
51
+ fetch_record_errors(update_record, default_column: default_error_column)
52
+ false
52
53
  end
53
54
  end
54
55
  end
@@ -9,7 +9,7 @@ module RedmineRemotes
9
9
  def create_local_issue
10
10
  return true if local_issue.save
11
11
 
12
- fetch_record_errors(local_issue, default_column: :issue_remote_code)
12
+ fetch_record_errors(local_issue, default_column: default_error_column)
13
13
  false
14
14
  end
15
15
 
@@ -11,13 +11,13 @@ module RedmineRemotes
11
11
  end
12
12
 
13
13
  def local_tracker
14
- local_issue.tracker
14
+ local_issue.if_present(&:tracker)
15
15
  end
16
16
 
17
17
  def update_local_issue_with_remote_data
18
18
  return true if local_issue.update(local_issue_provider_attributes)
19
19
 
20
- fetch_record_errors(local_issue, default_column: :issue_remote_code)
20
+ fetch_record_errors(local_issue, default_column: default_error_column)
21
21
  false
22
22
  end
23
23
  end
@@ -3,7 +3,7 @@
3
3
  module RedmineRemotes
4
4
  SLUG = 'redmine_remotes'
5
5
  NAME = 'Redmine Remotes'
6
- VERSION = '0.8.0'
6
+ VERSION = '0.8.1'
7
7
  AUTHOR = 'Eduardo Henrique Bogoni'
8
8
  SUMMARY = 'Integração do Redmine com trackers diversos.'
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmine_remotes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo Henrique Bogoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-06 00:00:00.000000000 Z
11
+ date: 2020-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers