Skip to content

Commit 7bcd342

Browse files
authored
Set owner type on workshop log to workshop (#537)
* Remove validation on workshop from story idea (bc sometimes enter external workshop title) * Set owner_type to Workshop if workshop_id present on workshop_log
1 parent 69d1610 commit 7bcd342

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

app/models/story_idea.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class StoryIdea < ApplicationRecord
2323
validates :updated_by_id, presence: true
2424
validates :project_id, presence: true
2525
validates :windows_type_id, presence: true
26-
validates :workshop_id, presence: true
2726
validates :body, presence: true
2827
validates :permission_given, presence: true
2928
validates :publish_preferences, presence: true

app/models/workshop_log.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ def update_owner_and_date
168168
changes = {}
169169
changes[:date] = created_at if date.blank?
170170
changes[:owner_id] = workshop_id if owner_id.blank?
171+
changes[:owner_type] = "Workshop" if workshop_id
171172
update_columns(changes) if changes.any?
172173
end
173174

0 commit comments

Comments
 (0)