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

Commit

Permalink
Merge pull request #78 from annikoff/fix
Browse files Browse the repository at this point in the history
fix migration, bump version
  • Loading branch information
annikoff authored Feb 20, 2017
2 parents ef9c4e4 + 81c162b commit 684f1ae
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Change Log

## [1.0.1](https://github.com/annikoff/redmine_plugin_computed_custom_field/releases/tag/v1.0.0) - 2017-02-20
## [1.0.2](https://github.com/annikoff/redmine_plugin_computed_custom_field/releases/tag/v1.0.2) - 2017-02-20
### Fixed
- Migration.

## [1.0.1](https://github.com/annikoff/redmine_plugin_computed_custom_field/releases/tag/v1.0.1) - 2017-02-20
### Fixed
- Migration.

Expand Down
4 changes: 2 additions & 2 deletions db/migrate/20170205204732_convert_custom_fields.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class ConvertCustomFields < ActiveRecord::Migration
def up
fields = CustomField.where(field_format: 'computed')
fields.each do |field|
field.update_attribute(:formula, field.format_store[:formula])
format = case field.format_store[:output_format]
when 'integer'
'int'
Expand All @@ -10,9 +11,8 @@ def up
else
field.format_store[:output_format]
end
formula = field.format_store[:formula]
sql = "UPDATE #{CustomField.table_name} SET "
sql << "is_computed = '1', field_format = '#{format}', formula = '#{formula}' WHERE id = #{field.id}"
sql << "is_computed = '1', field_format = '#{format}' WHERE id = #{field.id}"
ActiveRecord::Base.connection.execute(sql)
end
end
Expand Down
2 changes: 1 addition & 1 deletion init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
author 'Yakov Annikov'
url 'https://github.com/annikoff/redmine_plugin_computed_custom_field'
description ''
version '1.0.1'
version '1.0.2'
settings default: {}
end

Expand Down

0 comments on commit 684f1ae

Please sign in to comment.