918e589c2b
- 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.
7 lines
225 B
Ruby
7 lines
225 B
Ruby
class MergeRequestsClosingIssues < ActiveRecord::Base
|
|
belongs_to :merge_request
|
|
belongs_to :issue
|
|
|
|
validates :merge_request_id, uniqueness: { scope: :issue_id }, presence: true
|
|
validates :issue_id, presence: true
|
|
end
|