Commit Graph

6 Commits

Author SHA1 Message Date
Timothy Andrew 244ec0a84c Implement fourth round of comments from @DouweM.
- Pluralize summary titles
- Remove the `run_query` method - always return sql strings from the
  `date_time_sql` methods
2016-09-21 09:57:14 +05:30
Timothy Andrew 6df2d57394 Improve indentation in `Gitlab::Database::Median` 2016-09-21 02:18:57 +05:30
Timothy Andrew 918e589c2b Implement a second round of review comments from @DouweM.
- Don't use `TableReferences` - using `.arel_table` is shorter!
- Move some database-related code to `Gitlab::Database`
- Remove the `MergeRequest#issues_closed` and
  `Issue#closed_by_merge_requests`  associations. They were either
  shadowing or were too similar to existing methods. They are not being
  used anywhere, so it's better to remove them to reduce confusion.
- Use Rails 3-style validations
- Index for `MergeRequest::Metrics#first_deployed_to_production_at`
- Only include `CycleAnalyticsHelpers::TestGeneration` for specs that
  need it.
- Other minor refactorings.
2016-09-21 00:47:37 +05:30
Timothy Andrew 231a9f5b87 Fix rubocop spec.
And `scss_lint`
2016-09-20 18:26:31 +05:30
Timothy Andrew 71d4bf721b Implement (some) comments from @DouweM's review.
- Move things common to `Issue` and `MergeRequest` into `Issuable`
- Move more database-specific functions into `Gitlab::Database`
- Indentation changes and other minor refactorings.
2016-09-20 18:13:11 +05:30
Timothy Andrew 8957293d9b Implement review comments from @yorickpeterse
1. Change multiple updates to a single `update_all`

2. Use cascading deletes

3. Extract an average function for the database median.

4. Move database median to `lib/gitlab/database`

5. Use `delete_all` instead of `destroy_all`

6. Minor refactoring
2016-09-20 16:05:25 +05:30