Skip to content

Commit

Permalink
Add timestamps to user_preferences table. Thus we know when the cache…
Browse files Browse the repository at this point in the history
…d styles are invalid and needs to be reloaded.
  • Loading branch information
HDinger committed Jul 3, 2024
1 parent 5a77b48 commit c4141fb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
2 changes: 1 addition & 1 deletion app/helpers/highlighting_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ def highlight_css_version_tag(max_updated_at = highlight_css_updated_at)
end

def highlight_css_updated_at
ApplicationRecord.most_recently_changed Status, IssuePriority, Type
ApplicationRecord.most_recently_changed Status, IssuePriority, Type, UserPreference
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddTimestampsToUserPreferences < ActiveRecord::Migration[7.1]
def change
add_timestamps :user_preferences, default: DateTime.now
end
end
18 changes: 0 additions & 18 deletions spec/models/user_preference_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,6 @@
end
end

describe "#respond_to?" do
context "for created_at (key not in the schema)" do
it "is does not respond" do
expect(preference)
.not_to respond_to(:created_at)
end
end
end

describe "an unsupported method" do
context "for created_at (key not in the schema)" do
it "raises an error" do
expect { preference.created_at }
.to raise_error NoMethodError
end
end
end

describe "sort order" do
it_behaves_like "accepts real and false booleans",
:comments_in_reverse_order=,
Expand Down

0 comments on commit c4141fb

Please sign in to comment.