Skip to content

Commit

Permalink
Fix factory bot lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
coalest committed Jan 6, 2025
1 parent af09236 commit b0bcd59
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/tagging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Tagging < ApplicationRecord

validates :tag_id, uniqueness: {scope: :taggable, message: "has already been applied"}

after_initialize :set_organization_id
before_create :set_organization_id

def set_organization_id
self.organization_id ||= taggable.organization_id
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/taggings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#
FactoryBot.define do
factory :tagging do
organization { create(:organization) }
organization { Organization.try(:first) || create(:organization) }
tag { create(:tag) }
taggable { create(:product_drive) }
end
Expand Down

0 comments on commit b0bcd59

Please sign in to comment.