Commit Graph

9 Commits

Author SHA1 Message Date
carlad
2974dccd3b Merge branch 'master' into cd-v3-parity 2015-11-25 18:18:56 +01:00
carlad
baa1881bf7 v3 change name of starred_repository to star 2015-11-24 18:59:16 +01:00
carlad
d3b13e8d7c v3 fix relation of starred_repository to repostiory model 2015-11-24 18:15:17 +01:00
carlad
af3087446c v3 adjust repo model, query and service for filtering by starred - not working 2015-11-24 18:03:15 +01:00
Piotr Sarnacki
81e11da856 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 15:09:58 +01:00
carlad
4a0932df1e prefix ids with correct tables when ordering 2015-09-15 11:45:16 +02:00
Konstantin Haase
2f19ba3357 API v3: don't load all builds when eagerloading repository.last_build 2015-05-05 17:01:03 +02:00
Konstantin Haase
c968bbaab1 v3: use branches table for default_branch, eager load on /repos endpoint to avoid N+1 queries 2015-02-23 22:54:28 +01:00
Konstantin Haase
5f2dc47e07 no longer use models from travis-core in queries 2015-02-23 16:50:51 +01:00