Commit a9338d88787f189d3a40ddf1855cfcefb628b831

Authored by Daniel
1 parent 2e3381f8

Fix wrong association to Project in ProjectAttributes

It doesn't work since Project is an entity from KalibroClient, not a
normal ActiveRecord model.
app/models/project_attributes.rb
1 class ProjectAttributes < ActiveRecord::Base 1 class ProjectAttributes < ActiveRecord::Base
2 belongs_to :user 2 belongs_to :user
3 - belongs_to :project  
4 - 3 +
5 def project 4 def project
6 Project.find(self.project_id) 5 Project.find(self.project_id)
7 end 6 end
spec/models/project_attributes_spec.rb
@@ -3,7 +3,6 @@ require &#39;rails_helper&#39; @@ -3,7 +3,6 @@ require &#39;rails_helper&#39;
3 RSpec.describe ProjectAttributes, type: :model do 3 RSpec.describe ProjectAttributes, type: :model do
4 describe 'associations' do 4 describe 'associations' do
5 it { is_expected.to belong_to(:user) } 5 it { is_expected.to belong_to(:user) }
6 - it { is_expected.to belong_to(:project) }  
7 end 6 end
8 7
9 describe 'methods' do 8 describe 'methods' do