diff --git a/app/models/extractor.rb b/app/models/extractor.rb index 402ecfb98..29ef77b30 100644 --- a/app/models/extractor.rb +++ b/app/models/extractor.rb @@ -20,7 +20,7 @@ def self.of_type(type) end end - belongs_to :workflow + belongs_to :workflow, counter_cache: true validates :workflow, presence: true validates :key, presence: true, uniqueness: {scope: [:workflow_id]} diff --git a/app/models/reducer.rb b/app/models/reducer.rb index f4dd7b2bd..687080fd3 100644 --- a/app/models/reducer.rb +++ b/app/models/reducer.rb @@ -1,6 +1,6 @@ class Reducer < ApplicationRecord include Configurable - include BelongsToReducible + include BelongsToReducibleCached enum topic: { reduce_by_subject: 0, diff --git a/app/models/subject_rule.rb b/app/models/subject_rule.rb index 90b8397fe..d209f176c 100644 --- a/app/models/subject_rule.rb +++ b/app/models/subject_rule.rb @@ -2,7 +2,7 @@ class SubjectRule < ApplicationRecord include RankedModel ranks :row_order, with_same: :workflow_id - belongs_to :workflow + belongs_to :workflow, counter_cache: true has_many :subject_rule_effects, dependent: :destroy validate :valid_condition? diff --git a/app/models/user_rule.rb b/app/models/user_rule.rb index b9be11c62..df401362b 100644 --- a/app/models/user_rule.rb +++ b/app/models/user_rule.rb @@ -2,7 +2,7 @@ class UserRule < ApplicationRecord include RankedModel ranks :row_order, with_same: :workflow_id - belongs_to :workflow + belongs_to :workflow, counter_cache: true has_many :user_rule_effects, dependent: :destroy validate :valid_condition? diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb index c4d679728..37b60e5d6 100644 --- a/app/views/projects/index.html.erb +++ b/app/views/projects/index.html.erb @@ -1,5 +1,11 @@
+
+ +
+

Projects

@@ -28,7 +34,7 @@ - + @@ -36,12 +42,6 @@
<%= project.id %> <%= link_to project.display_name || "No Name", project_path(project) %> N/A<%= project.reducers.count %><%= project.reducers_count %> N/A <%= project.updated_at %>
-
- -
-