travis-api/lib/travis/api
Piotr Sarnacki 1cc6a2623d Fix error when default branch tries to be autosaved
For some reason when branch from V2 models is being saved, it tries to
also update relationships for V3 models, at least in tests. This fails,
because default_branch association on the V3 Repository model has a
primary key set to [:id, :default_branch]. In theory we use composite
keys plugin, but it seems that it doesn't cover that case and because of
that AR fails with an error "[:id, :default_branch] is not a Symbol"
when it tries to call Model#send with primary_key as an argument.

This commit fixes the issue by overriding the send method on the
Repository model to not fail when AR does
repository.send([:id, :default_branch_name]), when it needs to fetch
a primary key.

This is hacky, but I haven't found a nicer way to get around it.
2015-11-24 13:46:15 +01:00
..
app User-Agent-Tracker: check if comment is there 2015-11-20 14:20:02 +01:00
v2 add repository.active to v2 2015-07-17 11:26:00 +02:00
v3 Fix error when default branch tries to be autosaved 2015-11-24 13:46:15 +01:00
workers remove empty line 2015-09-30 17:19:08 +02:00
app.rb only enable request throttling in production 2015-09-17 15:26:30 +02:00
attack.rb also add a throttle 2015-11-19 19:29:07 +01:00
instruments.rb only run Skylight for 20% of the dynos (rounding up if there are less than five) 2015-01-19 14:00:00 +01:00
serializer.rb Allow to handle settings collections 2014-04-01 12:00:06 +02:00
v2.rb Move API v2 payload definitions to travis-api from travis-core 2014-03-24 20:25:06 +01:00
v3.rb V3 add user/:id/sync endpoint 2015-10-29 17:57:30 +01:00