summaryrefslogtreecommitdiff
path: root/app/models/environment.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-06-10 23:36:54 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-06-10 23:36:54 +0200
commit907c0e6796b69f9577c147dd489cf55748c749ac (patch)
treec4db6a3d3785fa845be98447eb4303b548ab7809 /app/models/environment.rb
parentcf7da039bedcad5163ce9deedccc94206d4c485a (diff)
downloadgitlab-ce-907c0e6796b69f9577c147dd489cf55748c749ac.tar.gz
Added initial version of deployments
Diffstat (limited to 'app/models/environment.rb')
-rw-r--r--app/models/environment.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb
new file mode 100644
index 00000000000..623404ba634
--- /dev/null
+++ b/app/models/environment.rb
@@ -0,0 +1,11 @@
+class Environment < ActiveRecord::Base
+ belongs_to :project
+
+ has_many :deployments
+
+ validates_presence_of :name
+
+ def last_deployment
+ deployments.last
+ end
+end