Skip to content

Commit

Permalink
🧹 Journal: Annnnd this is what I get without CI
Browse files Browse the repository at this point in the history
While working on
#11, I completely
forgot to run the tests locally. Embaressing, right? But I've grown
overly used to codebases where running tests takes minutes-not-seconds;
and there's not an easy way to "scope" the tests run to just the code
that matters.

Also I'm hacking while high, sue me!

Anyway, people forget things... For reasons. And this time I forgot
this, which exposed a hole in the safety-net in my weird multi-repo
experiment.

So I patched the hole in the bottom of the sea...
sea: #12

Which uncovered a log in the hole in the bottom of the sea:
zinc-collective#2160

So now I'm finishing the refactor and putting the frog on the log in the
hole of the bottom of the sea, so that I can feed a gnat to the frog on
the log in the hole of the bottom of the sea and implement the form
fields to capture the `Entry#summary`
  • Loading branch information
zspencer committed Jan 29, 2024
1 parent c3c384b commit a08188e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/furniture/journal/entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class Entry < ApplicationRecord

scope :matching_keywords, ->(keywords) { where("keywords::text[] && ARRAY[?]::text[]", keywords) }

DESCRIPTION_MAX_LENGTH = 300
validates :description, length: {maximum: DESCRIPTION_MAX_LENGTH, allow_blank: true}
SUMMARY_MAX_LENGTH = 300
validates :summary, length: {maximum: SUMMARY_MAX_LENGTH, allow_blank: true}

def migrate_to(journal:, keywords: [])
new_body = keywords.present? ? body + "\n##{keywords.join(" #")}" : body
Expand Down
4 changes: 2 additions & 2 deletions spec/furniture/journal/entry_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
end
end

describe "#description" do
it { is_expected.to validate_length_of(:description).is_at_most(300).allow_blank }
describe "#summary" do
it { is_expected.to validate_length_of(:summary).is_at_most(300).allow_blank }
end

describe "#save" do
Expand Down

0 comments on commit a08188e

Please sign in to comment.