docbrown/app
Daniel Uber 18a2a98b7a
Simplify logic around generated article description (#13965)
* Simplify logic around generated article description

@citizen428 helpfully pointed out ActiveSupport's String#truncate
method, and I had read the processed_description method body
immediately before and knew it could benefit from using truncate.

When the body text is present, if it's long, truncate to 100
characters (with trailing ellipsis as needed), removing newlines.

When the body text is absent, populate with a generic "post by user"
message.

* Change magic description length to match the original behavior

Since we were previously slicing [0..100] we would get 101 characters, and then
appending three dots makes for 104 total.

There is a longish description passed in the articles api request test
that shows "part of the body as a description" that failed to match
with the first pass.
2021-06-11 15:24:09 -05:00
..
assets RFC #74, Pt. 2: Private Forem Landing Page (#13819) 2021-06-10 11:46:24 -06:00
black_box Remove <provider>_created_at columns (#13264) 2021-04-29 10:24:16 -05:00
controllers Removing Settings::General.email_addresses (#13958) 2021-06-11 12:34:34 +03:00
decorators Pin posts to feed (#13807) 2021-06-04 10:54:53 +02:00
errors Removing Settings::General.email_addresses (#13958) 2021-06-11 12:34:34 +03:00
helpers Removing Settings::General.email_addresses (#13958) 2021-06-11 12:34:34 +03:00
javascript Remove defer attributes from inline scripts - gist embeds (#13407) 2021-06-11 08:22:50 +01:00
lib Removing Settings::General.email_addresses (#13958) 2021-06-11 12:34:34 +03:00
liquid_tags Bump rubocop from 1.15.0 to 1.16.0 (#13894) 2021-06-02 09:11:38 -04:00
mailers Removing Settings::General.email_addresses (#13958) 2021-06-11 12:34:34 +03:00
models Simplify logic around generated article description (#13965) 2021-06-11 15:24:09 -05:00
policies Create DiscussionLocks (#13905) 2021-06-10 11:04:33 -04:00
queries Have specs run without Redis and refactor ConsumerApp and Device (#13647) 2021-05-07 08:03:16 +02:00
refinements Drop profile columns from user (#10707) 2020-12-03 08:14:38 +07:00
sanitizers Remove unused attributes from markdown parser (#13484) 2021-04-27 09:33:01 -04:00
serializers Cleanup search classes and serializers (#13645) 2021-05-05 09:20:59 -04:00
services 15 minute fix: Shorten long titles from feed items if needed (#13961) 2021-06-11 12:51:51 -05:00
uploaders Change frame limit to match imgproxy (#13265) 2021-04-06 12:28:50 +02:00
validators Pin posts to feed (#13807) 2021-06-04 10:54:53 +02:00
view_objects Rename SiteConfig to Settings::General (#13573) 2021-05-21 14:45:37 +02:00
views Removing Settings::General.email_addresses (#13958) 2021-06-11 12:34:34 +03:00
workers Detect animated images in articles asynchronously (#13766) 2021-06-01 10:34:04 +02:00