mirror of
https://github.com/discourse/discourse.git
synced 2025-06-22 19:21:34 +08:00
PERF: prevents N+1 on last_updated_by (#32817)
This commit is contained in:
@ -4,6 +4,8 @@ module DiscourseAutomation
|
||||
class Automation < ActiveRecord::Base
|
||||
self.table_name = "discourse_automation_automations"
|
||||
|
||||
belongs_to :last_updated_by, class_name: "User", foreign_key: "last_updated_by_id"
|
||||
|
||||
has_many :fields,
|
||||
class_name: "DiscourseAutomation::Field",
|
||||
dependent: :delete_all,
|
||||
@ -17,7 +19,6 @@ module DiscourseAutomation
|
||||
class_name: "DiscourseAutomation::PendingPm",
|
||||
dependent: :delete_all,
|
||||
foreign_key: "automation_id"
|
||||
|
||||
has_many :stats, class_name: "DiscourseAutomation::Stat", dependent: :delete_all
|
||||
|
||||
validates :script, presence: true
|
||||
|
Reference in New Issue
Block a user