Commit 99ae2c02 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Explicitly say approve class name in association

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 7ba4e05f
......@@ -35,7 +35,7 @@ class MergeRequest < ActiveRecord::Base
belongs_to :source_project, foreign_key: :source_project_id, class_name: "Project"
has_one :merge_request_diff, dependent: :destroy
has_many :approves, dependent: :destroy
has_many :approves, class_name: 'Approve', dependent: :destroy
after_create :create_merge_request_diff
after_update :update_merge_request_diff
......
......@@ -130,7 +130,7 @@ class User < ActiveRecord::Base
has_many :assigned_issues, dependent: :destroy, foreign_key: :assignee_id, class_name: "Issue"
has_many :assigned_merge_requests, dependent: :destroy, foreign_key: :assignee_id, class_name: "MergeRequest"
has_many :oauth_applications, class_name: 'Doorkeeper::Application', as: :owner, dependent: :destroy
has_many :approves, dependent: :destroy
has_many :approves, class_name: 'Approve', dependent: :destroy
#
......
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :approve, class: 'Approve' do
factory :approve do
merge_request
user
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment