Merge branch 'master' into caches_endpoint

This commit is contained in:
Renée Hendricksen 2016-08-14 21:54:29 -04:00
commit e780180394
3 changed files with 8 additions and 6 deletions

View File

@ -21,7 +21,7 @@ module Travis::Api::App::Responders
<updated><%= ::DateTime.parse(build.updated_at.to_s).rfc3339 %></updated>
<summary type="html">
&lt;p&gt;
<%= build.commit.message.encode(:xml => :text) %> (<%= build.commit.committer_name %>)
<%= build.commit.message.encode(:xml => :text) if build.commit.message %> (<%= build.commit.committer_name %>)
&lt;br/&gt;&lt;br/&gt;
State: <%= build.state %>
&lt;br/&gt;

View File

@ -111,6 +111,7 @@ module Travis
#
# By default, this return false.
def owner_active?(feature, owner)
return false unless owner
redis.sismember(owner_key(feature, owner), owner.id)
end
@ -123,7 +124,7 @@ module Travis
end
def owner_key(feature, owner)
suffix = owner.class.table_name
suffix = owner.class.table_name if owner
"#{key(feature)}:#{suffix}"
end

View File

@ -174,6 +174,7 @@ class Job < Travis::Model
end
def normalize_config(config)
config = YAML.load(config) if config.is_a? String
config = config ? config.deep_symbolize_keys : {}
if config[:deploy]