Conversation
| @most_printed_resources = decorate_with_counts(most_printed_for_model(Resource, time_scope), :print_count) | ||
| # @most_printed_community_news = decorate_with_counts(most_printed_for_model(CommunityNews, time_scope), :print_count) | ||
| # @most_printed_stories = decorate_with_counts(most_printed_for_model(Story, time_scope), :print_count) | ||
| @most_printed_community_news = decorate_with_counts(most_printed_for_model(CommunityNews, time_scope), :print_count) |
There was a problem hiding this comment.
sidequest: these were missing from the view
|
|
||
| total_results = grouped_results.values.sum { |r| r.respond_to?(:total_entries) ? r.total_entries : r.size } | ||
|
|
||
| # total_results = grouped_results.values.sum { |r| r.respond_to?(:total_entries) ? r.total_entries : r.size } |
There was a problem hiding this comment.
sidequest: turning ahoy totals off for now bc was hitting an error
| # Read more about authorization context: https://actionpolicy.evilmartians.io/#/authorization_context | ||
| # | ||
| authorize :user, optional: true, allow_nil: true | ||
| pre_check :verify_authenticated! |
There was a problem hiding this comment.
this was conflicting w rules like def index?, and making it impossible to open some endpoints to public/guest access
| add_column table, :published, :boolean, null: false, default: false | ||
| add_index table, :published | ||
|
|
||
| say_with_time "Backfilling #{table}.published" do |
There was a problem hiding this comment.
convert inactive column data input published data
| workshop_variations | ||
| workshops | ||
|
|
||
| banners |
There was a problem hiding this comment.
these two don't have an inactive column
| @@ -0,0 +1,74 @@ | |||
| class AddPublishedToTables < ActiveRecord::Migration[8.1] | |||
| TABLES = %i[ | |||
| events | |||
There was a problem hiding this comment.
these tables have an inactive column
this migration adds published but leaves the inactive column in place.
we'll remove this column later when we remove all legacy tables and columns.
| @@ -0,0 +1,12 @@ | |||
| class RemoveInactiveFromTaggings < ActiveRecord::Migration[8.1] | |||
| def change | |||
| # Remove inactive column from sectorable_items and categorizable_items bc they should either exist or not | |||
There was a problem hiding this comment.
there was a boolean on [taggable]_items but none of the code was using it to filter taggings -- all were showing in the UI. looks like all of the taggings should be live, so, removing these columns entirely since they're not needed. going forward, an item will either have a tagging or not -- no inactive/published state.
| factory :category_type do | ||
| sequence(:name) { |n| "Category Type Name #{n}" } | ||
| published { true } | ||
| published { false } |
There was a problem hiding this comment.
setting all factories to published=false, since that's the db default
| class Category < ApplicationRecord | ||
| include NameFilterable | ||
| include Positioning | ||
| include NameFilterable, Positioning, Publishable |
There was a problem hiding this comment.
| include NameFilterable, Positioning, Publishable | |
| include NameFilterable, Publishable |
Side note: I don't think you have to include Positioning. Should just need to call the positioned method (which we already have below)
What is the goal of this PR and why is this important?
How did you approach the change?
Anything else to add?