diff options
author | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2011-11-27 17:35:49 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2011-11-27 17:35:49 +0200 |
commit | a031813887a203b80006e7fdc3204355fd8d02b7 (patch) | |
tree | 880220df6e58e81503bd5c299164cb5b3582dd7f /app/models/commit.rb | |
parent | 1b2fba08fe83c7075d58cb34ba6ce79dfd527b41 (diff) | |
download | gitlab-ce-a031813887a203b80006e7fdc3204355fd8d02b7.tar.gz |
Commit, network graph refactoring
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index 09030cab06b..6d724bc825d 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -1,2 +1,37 @@ class Commit + attr_accessor :commit + attr_accessor :head + + delegate :message, + :committed_date, + :parents, + :sha, + :date, + :author, + :message, + :diffs, + :tree, + :id, + :to => :commit + + def initialize(raw_commit, head = nil) + @commit = raw_commit + @head = head + end + + def safe_message + message.force_encoding(Encoding::UTF_8) + end + + def created_at + committed_date + end + + def author_email + author.email.force_encoding(Encoding::UTF_8) + end + + def author_name + author.name.force_encoding(Encoding::UTF_8) + end end |