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

Commit 81c162b

Browse files
committed
fix migration, bump version
1 parent a577e3c commit 81c162b

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

CHANGELOG.md

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

3-
## [1.0.1](https://github.com/annikoff/redmine_plugin_computed_custom_field/releases/tag/v1.0.0) - 2017-02-20
3+
## [1.0.2](https://github.com/annikoff/redmine_plugin_computed_custom_field/releases/tag/v1.0.2) - 2017-02-20
4+
### Fixed
5+
- Migration.
6+
7+
## [1.0.1](https://github.com/annikoff/redmine_plugin_computed_custom_field/releases/tag/v1.0.1) - 2017-02-20
48
### Fixed
59
- Migration.
610

db/migrate/20170205204732_convert_custom_fields.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ class ConvertCustomFields < ActiveRecord::Migration
22
def up
33
fields = CustomField.where(field_format: 'computed')
44
fields.each do |field|
5+
field.update_attribute(:formula, field.format_store[:formula])
56
format = case field.format_store[:output_format]
67
when 'integer'
78
'int'
@@ -10,9 +11,8 @@ def up
1011
else
1112
field.format_store[:output_format]
1213
end
13-
formula = field.format_store[:formula]
1414
sql = "UPDATE #{CustomField.table_name} SET "
15-
sql << "is_computed = '1', field_format = '#{format}', formula = '#{formula}' WHERE id = #{field.id}"
15+
sql << "is_computed = '1', field_format = '#{format}' WHERE id = #{field.id}"
1616
ActiveRecord::Base.connection.execute(sql)
1717
end
1818
end

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.1'
6+
version '1.0.2'
77
settings default: {}
88
end
99

0 commit comments

Comments
 (0)