if block for new version

The rest apply in either case:

+    version.project = project
+    version.name = version_text
+    version.save!
+    version.id

Hope this is alright