summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/initializers/update_gs_version_number.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/config/initializers/update_gs_version_number.rb b/config/initializers/update_gs_version_number.rb
index 914f007..972c480 100644
--- a/config/initializers/update_gs_version_number.rb
+++ b/config/initializers/update_gs_version_number.rb
@@ -2,5 +2,7 @@
# It equals the branch in git.
#
if !ENV['GS_VERSION'].nil? && GsParameter.table_exists? && GsParameter.get('GEMEINSCHAFT_VERSION') != ENV['GS_VERSION']
- GsParameter.where(:name => 'GEMEINSCHAFT_VERSION').first.update_attributes(:name => ENV['GS_VERSION'])
-end \ No newline at end of file
+ if GsParameter.where(:name => 'GEMEINSCHAFT_VERSION').any?
+ GsParameter.where(:name => 'GEMEINSCHAFT_VERSION').first.update_attributes(:name => ENV['GS_VERSION'])
+ end
+end