Skip to content
This repository was archived by the owner on Apr 13, 2021. It is now read-only.

Commit 1a31a92

Browse files
authored
Merge pull request #105 from annikoff/v1.0.6
Redmine 3.4.x support
2 parents ab27a9b + 240aeb6 commit 1a31a92

File tree

6 files changed

+23
-13
lines changed

6 files changed

+23
-13
lines changed

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ Metrics/AbcSize:
1010
Metrics/MethodLength:
1111
Max: 25
1212

13+
Metrics/LineLength:
14+
Max: 120
15+
1316
Style/ClassAndModuleChildren:
1417
Enabled: false
1518

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ gemfile:
77
- $REDMINE_PATH/Gemfile
88

99
env:
10+
- REDMINE_VER=3.4-stable
1011
- REDMINE_VER=3.3-stable
1112
- REDMINE_VER=3.2-stable
1213
- REDMINE_VER=3.1-stable
@@ -25,8 +26,9 @@ before_install:
2526
- ln -s $TRAVIS_BUILD_DIR $REDMINE_PATH/plugins/$PLUGIN_NAME
2627
- cp config/database.yml.travis $REDMINE_PATH/config/database.yml
2728
- if [[ $(ruby --version | awk '{print $2}') < 2.1 ]]; then
28-
echo "gem 'nokogiri', '= 1.5.11'" >> $REDMINE_PATH/Gemfile;
29-
sed -ri 's/("selenium-webdriver")/\1, "= 2.53.4"/' $REDMINE_PATH/Gemfile; fi
29+
echo "gem 'nokogiri', '= 1.5.11'" >> $REDMINE_PATH/Gemfile; fi
30+
- sed -ri 's/("selenium-webdriver")/\1, "= 2.53.4"/' $REDMINE_PATH/Gemfile
31+
- sed -ri 's/("minitest")/\1, "= 5.10.1"/' $REDMINE_PATH/Gemfile
3032
- cd $REDMINE_PATH
3133
- if [[ $REDMINE_VER < '3.2-stable' ]]; then
3234
echo "$(curl http://www.redmine.org/projects/redmine/repository/revisions/14891/diff/trunk/lib/tasks/redmine.rake?format=diff)" > redmine.rake.patch;

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## [1.0.6](https://github.com/annikoff/redmine_plugin_computed_custom_field/releases/tag/v1.0.6) - 2017-08-07
4+
### Added
5+
- Redmine 3.4.x support.
6+
37
## [1.0.5](https://github.com/annikoff/redmine_plugin_computed_custom_field/releases/tag/v1.0.5) - 2017-03-21
48
### Changed
59
- PluginGemfile
@@ -107,15 +111,15 @@
107111
- Formula validation.
108112

109113
### Changed
110-
- List of classes for a patch.
114+
- List of classes for a patch.
111115
- README.
112116
- Excluded CF own id from available fields list.
113117

114118
### Removed
115119
- Groups of custom fields from creation form.
116120

117121
### Fixed
118-
- Conversion error when formula computation
122+
- Conversion error when formula computation
119123

120124
## [0.0.1](https://github.com/annikoff/redmine_plugin_computed_custom_field/releases/tag/v0.0.1) - 2015-08-13
121125
### Added

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
### Description:
77

8-
This plugin provides a possibility to create a computed custom field.
9-
The value of computed field can be set by formula.
10-
In formula constructions like `cfs[cf_id]` are replaced by IDs of custom fields.
11-
Valid formula is a valid Ruby code executed when customized object is updated.
8+
This plugin provides a possibility to create a computed custom field.
9+
The value of computed field can be set by formula.
10+
In formula constructions like `cfs[cf_id]` are replaced by IDs of custom fields.
11+
Valid formula is a valid Ruby code executed when customized object is updated.
1212
To put a field ID in the formula, double-click on an item in the list of available fields.
1313

1414

@@ -53,12 +53,12 @@ rake redmine:plugins:migrate
5353

5454
### Compatibility
5555

56-
The plugins supports the following Redmine versions: 3.3.x, 3.2.x, 3.1.x, 3.0.x, 2.6.x, 2.5.x.
56+
The plugins supports the following Redmine versions: 3.4.x, 3.3.x, 3.2.x, 3.1.x, 3.0.x, 2.6.x, 2.5.x.
5757

5858
### Examples:
5959
```ruby
6060
cfs[1]*2+cfs[2]
61-
# means
61+
# means
6262
# custom_field_value(1) * 2 + custom_field_value(2)
6363
```
6464

@@ -75,12 +75,12 @@ end
7575
```
7676

7777
```ruby
78-
# For IssueCustomField
78+
# For IssueCustomField
7979
(self.estimated_hours || 0) * 2
8080
```
8181

8282
```ruby
83-
# For ProjectCustomField
83+
# For ProjectCustomField
8484
self.parent_id == 2
8585
```
8686

init.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
author 'Yakov Annikov'
44
url 'https://github.com/annikoff/redmine_plugin_computed_custom_field'
55
description ''
6-
version '1.0.5'
6+
version '1.0.6'
77
settings default: {}
88
end
99

lib/computed_custom_field/custom_field_patch.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module CustomFieldPatch
55
included do
66
before_validation -> { self.formula ||= '' }, if: :is_computed?
77
validates_with FormulaValidator, if: :is_computed?
8+
safe_attributes 'is_computed', 'formula' if CustomField.respond_to? 'safe_attributes'
89
end
910

1011
def is_computed=(arg)

0 commit comments

Comments
 (0)