summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-19 08:37:14 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-19 08:37:14 +0100
commitedb3c4d6eeb603a84403bf81e695330a8ea9c603 (patch)
treeca1835ee7c0047846ced01198d460ad2bb7842e5 /config
parent313a6bfb2c5eddca7872bda007b7eae87306e5c6 (diff)
Bugfix
Diffstat (limited to 'config')
-rw-r--r--config/initializers/update_gs_version_number.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/config/initializers/update_gs_version_number.rb b/config/initializers/update_gs_version_number.rb
index 972c480..4770858 100644
--- a/config/initializers/update_gs_version_number.rb
+++ b/config/initializers/update_gs_version_number.rb
@@ -2,7 +2,8 @@
# It equals the branch in git.
#
if !ENV['GS_VERSION'].nil? && GsParameter.table_exists? && GsParameter.get('GEMEINSCHAFT_VERSION') != ENV['GS_VERSION']
- if GsParameter.where(:name => 'GEMEINSCHAFT_VERSION').any?
- GsParameter.where(:name => 'GEMEINSCHAFT_VERSION').first.update_attributes(:name => ENV['GS_VERSION'])
- end
+ version = GsParameter.find_or_create_by_name('GEMEINSCHAFT_VERSION')
+ version.section = 'Generic'
+ version.value = ENV['GS_VERSION']
+ version.save
end