Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-06-11 00:36:54 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2016-06-11 00:36:54 +0300
commit907c0e6796b69f9577c147dd489cf55748c749ac (patch)
treec4db6a3d3785fa845be98447eb4303b548ab7809 /app/models/environment.rb
parentcf7da039bedcad5163ce9deedccc94206d4c485a (diff)
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