* Only include needed fields for top comments
* Test for included user info in comments in feed
* Omit hidden and deleted comments from feed json
* Optimize selected columns from comment
* Revert field selection to prevent user n+1
* Add profile_image_90 to users in comments in feed
* Add 'top_comments' to article feed
* Only include root comments
* Cache and eagerly load top comments
* Clear top comments cache when article score is updated
* Add articles.top_comments to bullet whitelist
* Update app/models/article.rb
Co-Authored-By: rhymes <rhymesete@gmail.com>
* Remove limit in top_comments association, remove Rails caching of top comments
* Remove unnecessary test
Co-authored-by: rhymes <rhymesete@gmail.com>
* Add a discuss/ask notification(s) to seeds + factories
* Add a start discussion/ask question welcome notification
* Add a scope for finding articles published by a user + with a certain tag.
* Some clean up/refactoring in the generator
* Reorganize welcome notification sending, add specs for discuss/ask notification
* Index reactions when they are created and updated, remove when destroyed
* update reading list reactions when related article fields are updated
* create indexable method and use for indexing to elasticsearch
Currently, we don't allow users to remove the `main_image` of an article once it has been set. It can be changed, but never removed.
This change allows the `main_image` to be removed by checking for the `cover_image` key in the frontmatter that is sent along in the article's markdown. This means that a user should be able to remove the image associated with an article by removing the value of `cover_image:` from their frontmatter.
When an article is updated the associated collection is touched along with all its articles. This creates a deadlock where two transaction(nested) lock the article that was updated.
With this commit the collection wll be touched after the article updates transaction has been commited. Doing so we have two sequential transactions.
* feat: we add the attribute for faceting
* feat: pass the requires_approval tag through with the dataset
* feat: if the tag requires approval then filter by the approved:true facet that we setup via algolia
* chore: false is redundant
* chore: robocop syntax improvement
* refactor: rename filters to tagFilters
* chore: standard javascript styleguide formatting
* chore: javascript styling
* Update app/assets/javascripts/initializers/initScrolling.js.erb
Co-Authored-By: Nick Taylor <nick@iamdeveloper.com>
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* feat: the number of published posts should show up by approved article.
* chore: Do not use spaces between -> and ( in lambda literals
* refactor: use the existing function in order to spawn the one where we need approval
* refactor: move logic to the controller instead of the view :)
* chore: code climate syntax
* chore: more codeclimate
* Add sink user service and specs for mass vomits
* Use new score calculation
* Lower articles' scores instead and make async
* Add lower score functionality to controllers
* Remove unused variable
* Use correct var and add missing arg
* Remove unused status
* Add composite index for reactable_type and ID
* Use alias instead of additional boolean
* Use medium priority for sink worker
* Log to honeybadger and not logs
* Log the error and not a string
* feat: add approved as an index or ordered articles and for the algolia search
* oops: added approved to the wrong place, should be on ordered_articles
* Add new UpdateMainImageBackgroundHexWorker worker class
This is a port of app/jobs/update_main_image_background_job.rb
that works with Sidekiq instead of DelayedJob.
* Update all references to UpdateMainImageBackgroundHexJob
This updates all references to UpdateMainImageBackgroundHexJob
so they now call UpdateMainImageBackgroundHexWorker, which works
with Sidekiq instead of DelayedJob.
* Move method call to after_commit callback
* Fix article specs with sidekiq helpers
Co-authored-by: Alex <alexandersmith223@gmail.com>
* Create Articles::ScoreCalcWorker
* Create Articles::ScoreCalcWorker spec
* Update references to the new ScoreCalcWorker
* Refactoring conditional callbacks and biz logic
- Move update_columns to a model method
- Move conditions on callback to guard clause in callback method
- Make article_destroy_spec more explicit
* Add tests and improve pagination and caching
* Add two more specs
* Add .with_video scope
* Get rid of N+1
* Only select needed columns
* Improve efficiency of the video page as well
* Add missing set_cache_control_headers to API videos#index
* Fix article description issues
* Move tag info to decorator
* Fix description edge cases
* Fix description creation logic
* Fix test and adjust naming
* Modify line in processed_description
* Create RemoveFromIndexWorker
* Create spec for RemoveFromIndexWorker
* Update RemoveFromIndexJob to RemoveFromIndexWorker
- Update references from the job to the new worker
- Update specs to use the new worker
- Fix spec in comment_spec that causes linter/RuboCop violation
* Remove unnecessary argument nil check
* Update spec for missing data
Related to: #5305
In order to move all the jobs to Sidekiq, this commit creates a new
Articles/BustMultipleCachesWorker using Sidekiq based on the
Articles/BustMultipleCachesJob (this one is not removed until we know
that any job on this one will be performed).