Since we've removed Buffer related algorithm, posts aren't automatically featured
anymore, leaving the RSS feed pretty empty. The default view should also include
those posts, above a minimum score, that are not featured.
* Remove pro role on user, expose pro dashboard to all users as analytics
* Remove pro from Elasticsearch mappings
* Update user role docs to use :trusted over :pro
* Remove pro from Role model spec
* Remove more references to pro, as noted by @rhymes
* Optimize Article.published scope
The index on `articles.published` is not being invoked due to lack of
diversity in the values in that column (it only has 2 possible values
because it's a boolean).
The index on `articles.published_at` is extremely diverse and will be
invoked any time it can reduce the scope of a query by an order of
magnitude or more.
On DEV, this does not change the row count for the scope:
irb(main):001:0> Article.where(published: true).count == Article.where(published: true).where(Arel.sql("published_at < now()")).count
=> true
The query plan for the `Articles::Feeds::LargeForemExperimental` service
invoked in the `Stories::FeedController#show` endpoint goes from this:
Planning Time: 0.271 ms
Execution Time: 329.258 ms
to this:
Planning Time: 0.330 ms
Execution Time: 0.468 ms
This is a reduction in query time of 99.7%
* Set published_at in articles factory
An article that is published should always have a `published_at`
timestamp
* Use Time.current for Zonebie
* Add clarifying comment to Article.published scope
* Generate timestamp in Ruby instead of SQL
I think using transactions for specs was interfering with comparing
timestamps generated in SQL, so this commit generates the timestamp in
Ruby.
* Move published_at outside of the transient block
This was causing articles to be marked as `published_at` right now even
if `published_at` was specified in the `FactoryBot.create` call.
* published_at: nil is no longer the factory default
* published_at is no longer nil by default
* published_at is no longer nil by default
* We didn't actually want to clear this published_at
This was intentionally left out to show that published_at does not get
cleared when we flip published true->false.
* Start refactoring articles update
* Articles update refactoring
* Added a couple of tests for Articles::Updater
* Reorganized code in Articles::Updater and ::Attributes a bit
* A couple of more tests for Articles::Attributes
* Reverted changed in the articles_controller
* Edited_at in Articles::Attributes
* Use Articles::Updater in ArticlesController
* Tests for notifications when published/unpublished an article
* Removed old code
* Return result object from Articles::Updater
* Don't reset articles collection when no series was passed
* Fixed sending notifications when published an article the first time
* Fix articles collection when updating
* Fix setting attributes for articles update
* Spec for articles update via api failure
* More tests for Articles::Updater
* More specs for articles updating
* Pass article instead of article_id to articles updater to avoid loading an article twice
* Remove the redundant check in the articles_controller
* Articles::Attributes refactoring
* Add query string option for filtering latest articles
* Show last featured articles on /feed/latest
* Add handle_latest_feed method
* Add support for page query
* Use better naming
* Use functionailty of LargeForemExperimental#latest_feed instead of calling the service
* Include 'not featured articles' on feed
* Cleanup
* Removes collective_noun and collective_noun_disabled from app
* Config Generalization: replaces community_qualified_name with community_name
- Generalizes SiteConfig after the removal of collective_noun field
- Updates copy where necessary to be readable with community_name
- Makes the community_name SiteConfig description more explicit
- Adds flexibility for Admins by removing appended "community"
* Adds a data_update script to remove collective_noun and collective_noun_disabled
* Removes appended community from stories_controller.rb
* Removes unnecessary quotation marks around SiteConfig.community_name.to_s
* Makes SiteConfig community_name description more explicit
* Removes topic from #email_from and replaces arg with _
* Removes argument from #email_from (facepalm)
* Reverts changes to application_mailer and notify_mailer_spec
* Removes default "Community" topic from application_mailer and makes topic optional
* Refactors #prepopulate_new_form to resolve Code Climate failures
* Refactors #email_from even further by use of a ternary operator per review suggestion
* Simplifies the data_update script used to remove collective_noun per review request
* Adds a data_update script to append community to community_name
* Updates data_update script to correctly append Community to community_name
* Removes RemoveCollectiveNounFromConfig and updates other script
* Removes superfluous false from data_update script
* Updates data_update script to be more idiomatic
* Add image composite element to feed if user exists
If the feed is a tag or the latest feed, user won't exist and we don't want to
render an <image> tag in the feed.
* Use profile_image_90 to limit the width and height
* Add tests for feed; address cr comments
* Fix typo
* Address rubocop issues
* Fix another typo
* Fix tests
Co-authored-by: rhymes <rhymes@hey.com>
* Remove extra character from meta_keywords in /listings/index.html.erb
* Remove meta_keywords from MANDATORY_CONFIGS
* Add and use meta_keywords_tag helper
* Use modern tag syntax instead of deprecated syntax
* Add and use meta_keywords_default helper
* Add and use meta_keywords_article helper
* Remove * from meta_keywords_field.label
* Update meta_keyword specs to account for no keywords being set
* Replace in Cache-Control header to support Nginx caching
* Add 'X-Accel-Expires' header for Nginx caching
* Remove max-age directive from remaining specs
* Update caching header specs to test against x-accel-expires header
* Add dual booting logic to Gemfile
This might be helpful for the Rails 6.0 upgrade project.
* Add more than one gemfile to Travis' configuration
We want to see how the application behaves with more than one Rails versions:
- Gemfile -> Rails 5.2
- Gemfile.next -> Rails 6.0
This will help us figure out what needs to be addressed before migrating to Rails 6.0.
If you want to read more about this technique (dual booting) you can check out this page: https://www.fastruby.io/blog/upgrade-rails/dual-boot/dual-boot-with-rails-6-0-beta.html
* Fix joins
* Upgrade Gemfile.next.lock
* Make sure we're installing the correct versions of gems
* Add Rails 6 notes
* Update rubocop in Gemfile.next.lock
* Fix organization spec
* Fix page_views_spec
* Add Rails 6 and run rails app:update
* Remove some tricks
* Remove Gemfile.next for now
* Fix .content_type deprecation
* Fix deprecation of .where.not NAND/NOR behavior
* Fix deprecation of parameterized emails
* Fix specs
* Remove next flag for now
* Fix spec (hopefully)
* Add wait_for_javascript
* Fix spec, thanks @maestromac!
* Try without wait for javascript hack
* Remove unnecessary bin/update
* Remove file that snuck in the rebase
* Update the vendored gems
* Replace migrate+db:setup with db:prepare
* Update vendored gems
* Fix Gemfile.lock and update vendored stuff
* Fix Gemfile.lock to be the same as master's minus the changes
Co-authored-by: rhymes <rhymesete@gmail.com>
* Refactor articles_show_spec.rb to better test JSON data
* Adds additional tests around JSON-LD data
* Removes original tests for JSON-LD from articles_show_spec
* Add org data to spec to test against actual JSON-LD data
* Removes inline variables in favor of let declarations
* Adds and tests organization structured data
* Removes unnecessary objs and variables from spec
* Adjust org JSON-LD description in the Stories::Controller
* Replaces user summary with org summary in org data structure
* Capitalize the S in RSpec in articles_show_spec.rb
* Remove OR from dateModified in favor of published_timestamp
* Added configurable meta keywords
* Replaced hardcoded meta-keywords with the configurable ones
* Added tests for configurable meta_keywords
* Improve info for configuring meta-keywords
* Add correct rate limit exception to Articles::Updater
* Send Retry-After with HTTP 429 back to the client
* Update API specs for error 429
* Test build
* Fix spec
* Add retry after to ImageUploadsController and fix specs
* Generalize a bit
* Add JSON-LD in place of schema.org in _video_player.html.erb
* Remove unnecessary tags around JSON-LD to clean up templates
* Fix indenatation and remove extra elements from show.html.erb and _profile_header.html.erb
* Remove empty line from articles/show.html.erb
* Clean up JSON-LD commas across erb templates
* Revert articleBody changes, adjust nesting, and remove extra quote
* Add application/ld+json to allowed_types in .erb-lint.yml
This addition makes it so that the no verify flag is no longer required
* Add additional data for Articles, Users, and Orgs to better SEO
* Add additional data to JSON-LD structures
*Add sameAs data to articles/show.html.erb
*Add sameAs data to users/show.html.erb
*Make adjustments to VideoObject data in _video_player
*Make adjustments to Org in _profile_header
*Add removed erb back to all erb templates
* Refactor code to fix syntax Google syntax errors
* Add missing double quotes to values
* Remove unnecessary meta tags from _video_player.html.erb
* Add additional key-value pairs to data structures
* General code clean up
* Clean up existing data structures
*Remove useless meta tag and replace with a tag
*Small refactor to users/show.html.erb data
* Extract user json-ld out of users/show.html.erb
*Move json-ld logic to stories_controller
*Use user_json_ld variable in place of entire data structure
*Set user_json_ld as a before_action in the controller
* Add specs around JSON-LD data in templates
*Add request spec for users/show.html.erb
*Add request spec for articles/show.html.erb
*Add request spec for _video_player.html.erb
*Add request spec for _profile_header.html.erb
*WIP: Fix pending specs for all templates
* Remove useless meta tags from users/show and _profile_header.html.erb
* Add additional test coverage to users/show.html.erb
*Add additional tests to user_show_spec
*Ensure that all tests pass
*Small refactor to users/show.html.erb JSON data structure
* Add additional test coverage around JSON-LD data
*Add more robust tests to template specs
*Remove unnecessary comments from specs
*Uncomment pending specs
* Adjust modified date to be more readable in article specs
* Refactor spec to be more readable and update GitHub username test
* Remove meta erb from articles/show.html.erb
* Remove meta data from _video_player.html.erb
* Clean up useless codeand whitespace for final review
* Extract users/show data structure from template into StoriesController
* Remove JSON-LD object from users/show.html.erb
* Place JSON-LD for users/show.html.erb in StoriesController
* Store user_json_ld in set_json_ld method in StoriesController
* Call user_json_ld variable in script tag in users/show
* Clean up trailing commas and refactor articles/show.html.erb
* Remove redundant user/profile_header_spec.rb
* Remove unnecessary code from _profile_header and articles/show
* Remove Organization from articles/show.html.erb
* Remove unnecessary comments from _profile_header.html.erb
* Extract user_json_ld into separate methods to fix Code Climate failures
* Rename user_profile_details and user_same_as methods to be more explicit
* Refactored user_json_ld methods to use symbols instead of strings
* Use symbols to fetch keys from a hash instead of strings
* Changed user_url in data structure
* Removal of erb tags and general clean up
* Revert schema changes
* Remove unnecessary quotation marks