diff options
-rw-r--r-- | config/initializers/update_gs_version_number.rb | 7 |
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 |