diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-10-06 13:01:16 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-10-12 12:53:49 +0300 |
commit | 914cfbd2f154ed3154a7dc3cee3309713eea786f (patch) | |
tree | 445862a347f3c915b2c41f0e8ba26d362017aa52 /app/models/generic_commit_status.rb | |
parent | 5ffbf5feb7577ec3affc32992c79cddca3036c4d (diff) |
Implement Commit Status API
Diffstat (limited to 'app/models/generic_commit_status.rb')
-rw-r--r-- | app/models/generic_commit_status.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/models/generic_commit_status.rb b/app/models/generic_commit_status.rb new file mode 100644 index 00000000000..fa54e3540d0 --- /dev/null +++ b/app/models/generic_commit_status.rb @@ -0,0 +1,15 @@ +class GenericCommitStatus < CommitStatus + before_validation :set_default_values + + # GitHub compatible API + alias_attribute :context, :name + + def set_default_values + self.context ||= 'default' + self.stage ||= 'external' + end + + def tags + [:external] + end +end |