From c3b79d1d3fb28b071b7b947559efcaef1d05793c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 07:34:17 +0000 Subject: [PATCH 001/203] Bump rubocop from 1.64.1 to 1.65.0 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.64.1 to 1.65.0. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.64.1...v1.65.0) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 77c8549ae..f2298c04c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -427,7 +427,7 @@ GEM rack orm_adapter (0.5.0) parallel (1.25.1) - parser (3.3.3.0) + parser (3.3.4.0) ast (~> 2.4.1) racc percy-capybara (5.0.0) @@ -562,13 +562,13 @@ GEM rswag-ui (2.13.0) actionpack (>= 3.1, < 7.2) railties (>= 3.1, < 7.2) - rubocop (1.64.1) + rubocop (1.65.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) + regexp_parser (>= 2.4, < 3.0) rexml (>= 3.2.5, < 4.0) rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) From 000f4979dbc0a2444242cfb76af7e20afa2299e1 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 13 Jul 2024 14:45:33 +0930 Subject: [PATCH 002/203] Trial Ruby32 (#3418) * Ruby 3.2/Bundler 2.4 * Fix creation * Upgrade to js-routes 2. Put all js routes into a global namespace. * Remove js-routes * Remove * Adjust ownership * Appease codeclimate for the nth time * Fix deprecation warning by explicitly calling to_fs * Fix deprecation warning by explicitly calling to_fs * Fix deprecation warning by explicitly calling to_fs * Swap to will paginate successor for bootstrap * Update app/views/members/show.html.haml * Update app/views/plantings/index.rss.haml * Update .env * Update .devcontainer/.env * Fix spec * Update spec * Fix spec * Pin to 2.4.22 * 3 space indent * Regenerate * Update rubocop --- .devcontainer/.env | 2 +- .devcontainer/Dockerfile | 8 +- .rubocop_todo.yml | 290 +++++++++++------- .ruby-version | 2 +- Gemfile | 1 + Gemfile.lock | 8 +- app/views/members/show.html.haml | 2 +- app/views/posts/_single.html.haml | 4 +- db/migrate/20150201052245_create_cms.rb | 2 +- ...te_active_storage_tables.active_storage.rb | 2 +- spec/models/post_spec.rb | 2 +- spec/views/posts/_single.html.haml_spec.rb | 2 +- 12 files changed, 198 insertions(+), 127 deletions(-) diff --git a/.devcontainer/.env b/.devcontainer/.env index 2ba97513c..92615121e 100644 --- a/.devcontainer/.env +++ b/.devcontainer/.env @@ -1,2 +1,2 @@ # Ruby version -VARIANT=3.1.4 +VARIANT=3.2.4 diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 9ed258cc8..d09387907 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/devcontainers/ruby:0-3.1-bullseye +FROM mcr.microsoft.com/devcontainers/ruby:0-3.2-bullseye # Install Rails RUN gem install rails:7.0.8 @@ -24,3 +24,9 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ # [Optional] Uncomment this line to install global node packages. # RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 + +# We run as the vscode user. +# Make sure this is writable as https://github.com/rubygems/rubygems/issues/6272 was removed +RUN su root -c "mkdir -p /usr/local/rvm/gems/default/cache/bundler/" +RUN su root -c "mkdir -p /usr/local/rvm/gems/default/bundler/gems/" +RUN su root -c "chmod -R 777 /usr/local/rvm/gems/" diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 4fa490610..1336b72aa 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,57 +1,36 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2023-09-16 07:51:19 UTC using RuboCop version 1.56.3. +# on 2024-07-13 04:50:02 UTC using RuboCop version 1.65.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 15 -Capybara/SpecificMatcher: +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyleAlignWith. +# SupportedStylesAlignWith: either, start_of_block, start_of_line +Layout/BlockAlignment: Exclude: - - 'spec/features/crops/browse_crops_spec.rb' - - 'spec/features/footer_spec.rb' - - 'spec/features/gardens/adding_gardens_spec.rb' - - 'spec/features/harvests/harvesting_a_crop_spec.rb' - - 'spec/features/plantings/planting_a_crop_spec.rb' - - 'spec/features/seeds/adding_seeds_spec.rb' + - 'spec/factories/activity.rb' # Offense count: 1 -Capybara/VisibilityMatcher: +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowForAlignment. +Layout/CommentIndentation: Exclude: - - 'spec/features/shared_examples/crop_suggest.rb' + - 'config/environments/production.rb' # Offense count: 6 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: Include, EnforcedStyle, NonImplicitAssociationMethodNames. -# Include: spec/factories.rb, spec/factories/**/*.rb, features/support/factories/**/*.rb -# SupportedStyles: explicit, implicit -FactoryBot/AssociationStyle: +# This cop supports safe autocorrection (--autocorrect). +Layout/EmptyLineAfterMagicComment: Exclude: - - 'spec/factories/alternate_names.rb' - - 'spec/factories/crop.rb' - - 'spec/factories/like.rb' - - 'spec/factories/scientific_name.rb' - -# Offense count: 8 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: Include, EnforcedStyle, ExplicitOnly. -# Include: **/*_spec.rb, **/spec/**/*, spec/factories.rb, spec/factories/**/*.rb, features/support/factories/**/*.rb -# SupportedStyles: create_list, n_times -FactoryBot/CreateList: - Exclude: - - 'spec/factories/member.rb' - - 'spec/helpers/gardens_helper_spec.rb' - - 'spec/views/comments/index.rss.haml_spec.rb' - - 'spec/views/home/index_spec.rb' - - 'spec/views/photos/index.html.haml_spec.rb' - - 'spec/views/places/show.html.haml_spec.rb' - - 'spec/views/posts/index.html.haml_spec.rb' - -# Offense count: 1135 -# This cop supports unsafe autocorrection (--autocorrect-all). -FactoryBot/SyntaxMethods: - Enabled: false + - 'config/initializers/application_controller_renderer.rb' + - 'config/initializers/backtrace_silencers.rb' + - 'config/initializers/content_security_policy.rb' + - 'config/initializers/mime_types.rb' + - 'config/initializers/new_framework_defaults_5_2.rb' + - 'db/migrate/20240218053122_add_slug_to_activity.rb' # Offense count: 5 # This cop supports safe autocorrection (--autocorrect). @@ -61,6 +40,32 @@ Layout/EmptyLineBetweenDefs: - 'db/migrate/20171129041341_create_photographings.rb' - 'db/migrate/20190130090437_add_crop_to_photographings.rb' +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Layout/EmptyLines: + Exclude: + - 'spec/models/ability_spec.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: empty_lines, no_empty_lines +Layout/EmptyLinesAroundBlockBody: + Exclude: + - 'lib/tasks/gardens.rake' + - 'spec/rails_helper.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. +# SupportedHashRocketStyles: key, separator, table +# SupportedColonStyles: key, separator, table +# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit +Layout/HashAlignment: + Exclude: + - 'app/models/concerns/search_activities.rb' + - 'app/models/concerns/search_plantings.rb' + # Offense count: 10 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. @@ -88,12 +93,30 @@ Layout/LineEndStringConcatenationIndentation: - 'spec/features/rss/posts_spec.rb' - 'spec/features/rss/seeds_spec.rb' -# Offense count: 1 +# Offense count: 3 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. +# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. # URISchemes: http, https Layout/LineLength: - Max: 304 + Exclude: + - 'app/helpers/crops_helper.rb' + - 'db/seeds.rb' + - 'spec/requests/plantings_spec.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: final_newline, final_blank_line +Layout/TrailingEmptyLines: + Exclude: + - 'spec/features/admin/newsletter_spec.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowInHeredoc. +Layout/TrailingWhitespace: + Exclude: + - 'spec/factories/activity.rb' # Offense count: 3 # This cop supports safe autocorrection (--autocorrect). @@ -103,11 +126,12 @@ Lint/AmbiguousOperatorPrecedence: - 'spec/helpers/gardens_helper_spec.rb' - 'spec/helpers/seeds_helper_spec.rb' -# Offense count: 2 +# Offense count: 3 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: RequireParenthesesForMethodChains. Lint/AmbiguousRange: Exclude: + - 'app/models/concerns/search_activities.rb' - 'app/models/concerns/search_harvests.rb' - 'app/models/concerns/search_plantings.rb' @@ -152,38 +176,44 @@ Lint/SymbolConversion: # Offense count: 7 # This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AutoCorrect. Lint/UselessAssignment: Exclude: - 'config.rb' - 'config/compass.rb' -# Offense count: 45 +# Offense count: 52 # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. Metrics/AbcSize: Max: 151 -# Offense count: 10 +# Offense count: 13 # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode. # AllowedMethods: refine Metrics/BlockLength: - Max: 61 + Max: 115 -# Offense count: 6 +# Offense count: 7 # Configuration parameters: CountComments, CountAsOne. Metrics/ClassLength: - Max: 171 + Max: 183 -# Offense count: 4 +# Offense count: 6 # Configuration parameters: AllowedMethods, AllowedPatterns. Metrics/CyclomaticComplexity: Max: 32 -# Offense count: 61 +# Offense count: 70 # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. Metrics/MethodLength: - Max: 59 + Max: 127 -# Offense count: 3 +# Offense count: 2 +# Configuration parameters: CountComments, CountAsOne. +Metrics/ModuleLength: + Max: 125 + +# Offense count: 5 # Configuration parameters: AllowedMethods, AllowedPatterns. Metrics/PerceivedComplexity: Max: 32 @@ -202,7 +232,7 @@ RSpec/ContextWording: # Offense count: 36 # This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: SkipBlocks, EnforcedStyle. +# Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants. # SupportedStyles: described_class, explicit RSpec/DescribedClass: Exclude: @@ -212,6 +242,7 @@ RSpec/DescribedClass: # Offense count: 13 # This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AutoCorrect. RSpec/EmptyExampleGroup: Exclude: - 'spec/controllers/authentications_controller_spec.rb' @@ -227,7 +258,14 @@ RSpec/EmptyExampleGroup: - 'spec/views/photos/edit.html.haml_spec.rb' - 'spec/views/posts/_single.html.haml_spec.rb' -# Offense count: 134 +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowConsecutiveOneLiners. +RSpec/EmptyLineAfterExample: + Exclude: + - 'spec/models/ability_spec.rb' + +# Offense count: 140 # Configuration parameters: CountAsOne. RSpec/ExampleLength: Max: 25 @@ -239,12 +277,14 @@ RSpec/ExcessiveDocstringSpacing: - 'spec/controllers/crops_controller_spec.rb' - 'spec/features/crops/crop_photos_spec.rb' -# Offense count: 30 +# Offense count: 32 RSpec/ExpectInHook: Exclude: - 'spec/controllers/garden_types_controller_spec.rb' - 'spec/controllers/gardens_controller_spec.rb' - 'spec/features/admin/forums_spec.rb' + - 'spec/features/admin/plant_parts_spec.rb' + - 'spec/features/admin/roles_spec.rb' - 'spec/features/crops/crop_photos_spec.rb' - 'spec/features/members/list_spec.rb' - 'spec/features/plantings/planting_a_crop_spec.rb' @@ -260,11 +300,12 @@ RSpec/HookArgument: # Offense count: 2 # This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AutoCorrect. RSpec/HooksBeforeExamples: Exclude: - 'spec/features/crops/creating_a_crop_spec.rb' -# Offense count: 35 +# Offense count: 37 # Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns. RSpec/IndexedLet: Exclude: @@ -272,6 +313,7 @@ RSpec/IndexedLet: - 'spec/controllers/plantings_controller_spec.rb' - 'spec/features/crops/crop_photos_spec.rb' - 'spec/features/members/list_spec.rb' + - 'spec/features/members/profile_spec.rb' - 'spec/features/percy/percy_spec.rb' - 'spec/features/planting_reminder_spec.rb' - 'spec/features/timeline/index_spec.rb' @@ -279,7 +321,7 @@ RSpec/IndexedLet: - 'spec/models/member_spec.rb' - 'spec/views/forums/index.html.haml_spec.rb' -# Offense count: 710 +# Offense count: 720 # Configuration parameters: AssignmentOnly. RSpec/InstanceVariable: Enabled: false @@ -288,6 +330,12 @@ RSpec/InstanceVariable: RSpec/LetSetup: Enabled: false +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +RSpec/MatchArray: + Exclude: + - 'spec/models/post_spec.rb' + # Offense count: 2 RSpec/MessageChain: Exclude: @@ -304,16 +352,16 @@ RSpec/MultipleDescribes: Exclude: - 'spec/features/crops/crop_wranglers_spec.rb' -# Offense count: 147 +# Offense count: 152 RSpec/MultipleExpectations: Max: 19 -# Offense count: 137 +# Offense count: 138 # Configuration parameters: AllowSubject. RSpec/MultipleMemoizedHelpers: Max: 14 -# Offense count: 132 +# Offense count: 133 # Configuration parameters: EnforcedStyle, IgnoreSharedExamples. # SupportedStyles: always, named_only RSpec/NamedSubject: @@ -324,7 +372,7 @@ RSpec/NamedSubject: RSpec/NestedGroups: Max: 6 -# Offense count: 407 +# Offense count: 403 # Configuration parameters: AllowedPatterns. # AllowedPatterns: ^expect_, ^assert_ RSpec/NoExpectationExample: @@ -336,21 +384,6 @@ RSpec/PendingWithoutReason: - 'spec/features/seeds/misc_seeds_spec.rb' - 'spec/features/unsubscribing_spec.rb' -# Offense count: 7 -# This cop supports unsafe autocorrection (--autocorrect-all). -RSpec/Rails/HaveHttpStatus: - Exclude: - - 'spec/controllers/api/v1/plantings_controller_spec.rb' - - 'spec/controllers/harvests_controller_spec.rb' - - 'spec/controllers/likes_controller_spec.rb' - - 'spec/requests/harvests_spec.rb' - -# Offense count: 16 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: Inferences. -RSpec/Rails/InferredSpecType: - Enabled: false - # Offense count: 2 RSpec/RepeatedDescription: Exclude: @@ -370,6 +403,7 @@ RSpec/RepeatedExampleGroupBody: # Offense count: 6 # This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AutoCorrect. RSpec/ScatteredSetup: Exclude: - 'spec/features/percy/percy_spec.rb' @@ -382,14 +416,6 @@ RSpec/SpecFilePathFormat: Exclude: - 'spec/controllers/member_controller_spec.rb' -# Offense count: 2 -# Configuration parameters: Include. -# Include: **/*_spec*rb*, **/spec/**/* -RSpec/SpecFilePathSuffix: - Exclude: - - 'spec/features/seeds/seed_photos.rb' - - 'spec/models/garden_type.rb' - # Offense count: 3 RSpec/StubbedMock: Exclude: @@ -413,7 +439,7 @@ RSpec/VerifiedDoubles: - 'spec/controllers/gardens_controller_spec.rb' - 'spec/views/devise/shared/_links_spec.rb' -# Offense count: 26 +# Offense count: 28 # Configuration parameters: Database, Include. # SupportedDatabases: mysql, postgresql # Include: db/**/*.rb @@ -485,12 +511,13 @@ Rails/I18nLocaleAssignment: Rails/I18nLocaleTexts: Enabled: false -# Offense count: 2 +# Offense count: 3 # Configuration parameters: Include. # Include: app/controllers/**/*.rb, app/mailers/**/*.rb Rails/LexicallyScopedActionFilter: Exclude: - 'app/controllers/data_controller.rb' + - 'app/controllers/registrations_controller.rb' # Offense count: 2 Rails/OutputSafety: @@ -498,6 +525,12 @@ Rails/OutputSafety: - 'app/helpers/auto_suggest_helper.rb' - 'app/helpers/gardens_helper.rb' +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Rails/PluralizationGrammar: + Exclude: + - 'spec/requests/plantings_spec.rb' + # Offense count: 4 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Include. @@ -508,8 +541,10 @@ Rails/RakeEnvironment: - 'lib/tasks/i18n.rake' - 'lib/tasks/testing.rake' -# Offense count: 10 +# Offense count: 9 # This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowedReceivers. +# AllowedReceivers: ActionMailer::Preview, ActiveSupport::TimeZone Rails/RedundantActiveRecordAllMethod: Exclude: - 'app/controllers/admin/roles_controller.rb' @@ -518,7 +553,6 @@ Rails/RedundantActiveRecordAllMethod: - 'app/controllers/plant_parts_controller.rb' - 'app/controllers/scientific_names_controller.rb' - 'app/services/openfarm_service.rb' - - 'spec/features/members/deletion_spec.rb' - 'spec/features/percy/percy_spec.rb' - 'spec/models/harvest_spec.rb' @@ -541,8 +575,8 @@ Rails/ResponseParsedBody: - 'spec/controllers/likes_controller_spec.rb' - 'spec/requests/api/v1/crop_request_spec.rb' - 'spec/requests/api/v1/gardens_request_spec.rb' - - 'spec/requests/api/v1/harvest_request_spec.rb' - - 'spec/requests/api/v1/member_request_spec.rb' + - 'spec/requests/api/v1/harvests_request_spec.rb' + - 'spec/requests/api/v1/members_request_spec.rb' - 'spec/requests/api/v1/photos_request_spec.rb' - 'spec/requests/api/v1/plantings_request_spec.rb' - 'spec/requests/api/v1/seeds_request_spec.rb' @@ -562,26 +596,11 @@ Rails/RootPathnameMethods: - 'app/controllers/crops_controller.rb' - 'app/helpers/icons_helper.rb' -# Offense count: 20 +# Offense count: 21 # Configuration parameters: Include. # Include: db/**/*.rb Rails/ThreeStateBooleanColumn: - Exclude: - - 'db/migrate/20121203034745_add_tos_agreement_to_users.rb' - - 'db/migrate/20130206051328_add_show_email_to_member.rb' - - 'db/migrate/20130212123628_create_notifications.rb' - - 'db/migrate/20130327120024_add_send_email_to_member.rb' - - 'db/migrate/20130517051922_create_account_types.rb' - - 'db/migrate/20130718011247_add_trading_to_seeds.rb' - - 'db/migrate/20130722050836_remove_tradable_from_seeds.rb' - - 'db/migrate/20130827105823_add_newsletter_to_member.rb' - - 'db/migrate/20131025104228_add_fields_to_gardens.rb' - - 'db/migrate/20140829230600_add_finished_to_planting.rb' - - 'db/migrate/20140928085713_add_send_planting_reminder_to_member.rb' - - 'db/migrate/20171022032108_all_the_predictions.rb' - - 'db/migrate/20180213005731_seed_usage.rb' - - 'db/migrate/20190720000555_create_mailboxer.mailboxer_engine.rb' - - 'db/migrate/20190720000558_add_delivery_tracking_info_to_mailboxer_receipts.mailboxer_engine.rb' + Enabled: false # Offense count: 6 # Configuration parameters: Include. @@ -603,6 +622,13 @@ Rails/WhereEquals: - 'app/models/harvest.rb' - 'app/models/planting.rb' +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +Rails/WhereRange: + Exclude: + - 'app/models/concerns/predict_planting.rb' + - 'app/models/garden.rb' + # Offense count: 3 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. @@ -613,6 +639,14 @@ Style/ClassAndModuleChildren: - 'lib/haml/filters/escaped_markdown.rb' - 'lib/haml/filters/growstuff_markdown.rb' +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Keywords, RequireColon. +# Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE +Style/CommentAnnotation: + Exclude: + - 'spec/features/seeds/adding_seeds_spec.rb' + # Offense count: 6 # This cop supports unsafe autocorrection (--autocorrect-all). Style/CommentedKeyword: @@ -628,7 +662,7 @@ Style/CommentedKeyword: Style/FetchEnvVar: Enabled: false -# Offense count: 4 +# Offense count: 3 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. # SupportedStyles: always, always_true, never @@ -636,32 +670,42 @@ Style/FrozenStringLiteralComment: Exclude: - 'config/initializers/new_framework_defaults_6_0.rb' - 'db/migrate/20200801084007_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.active_storage.rb' - - 'db/migrate/20200815012538_remove_median_function.rb' - 'spec/lib/haml/filters/growstuff_markdown_spec.rb' -# Offense count: 2 +# Offense count: 3 # This cop supports unsafe autocorrection (--autocorrect-all). Style/GlobalStdStream: Exclude: - 'config/environments/production.rb' + - 'lib/tasks/gbif.rake' - 'lib/tasks/openfarm.rake' +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals. +Style/GuardClause: + Exclude: + - 'app/controllers/activities_controller.rb' + # Offense count: 5 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys -# SupportedShorthandSyntax: always, never, either, consistent +# SupportedShorthandSyntax: always, never, either, consistent, either_consistent Style/HashSyntax: Exclude: - 'app/models/csv_importer.rb' - 'spec/requests/api/v1/gardens_request_spec.rb' - 'spec/requests/api/v1/plantings_request_spec.rb' -# Offense count: 2 +# Offense count: 5 # This cop supports safe autocorrection (--autocorrect). Style/IfUnlessModifier: Exclude: + - 'app/controllers/activities_controller.rb' + - 'app/controllers/application_controller.rb' - 'bin/setup' + - 'spec/features/shared_examples/crop_suggest.rb' # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). @@ -683,13 +727,21 @@ Style/MixinUsage: - 'bin/update' - 'spec/rails_helper.rb' +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: literals, strict +Style/MutableConstant: + Exclude: + - 'app/models/activity.rb' + # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). Style/NegatedIfElseCondition: Exclude: - 'app/helpers/crops_helper.rb' -# Offense count: 3 +# Offense count: 4 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns. # SupportedStyles: predicate, comparison @@ -697,6 +749,7 @@ Style/NumericPredicate: Exclude: - 'app/helpers/harvests_helper.rb' - 'app/helpers/plantings_helper.rb' + - 'app/models/concerns/predict_planting.rb' # Offense count: 6 Style/OpenStructUse: @@ -760,7 +813,7 @@ Style/SoleNestedConditional: - 'app/controllers/application_controller.rb' - 'app/controllers/messages_controller.rb' -# Offense count: 20 +# Offense count: 24 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Mode. Style/StringConcatenation: @@ -771,6 +824,13 @@ Style/StringConcatenation: - 'spec/helpers/gardens_helper_spec.rb' - 'spec/helpers/seeds_helper_spec.rb' +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +Style/SuperArguments: + Exclude: + - 'app/controllers/omniauth_callbacks_controller.rb' + - 'lib/haml/filters/escaped_markdown.rb' + # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments. diff --git a/.ruby-version b/.ruby-version index 0aec50e6e..be94e6f53 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.1.4 +3.2.2 diff --git a/Gemfile b/Gemfile index 641f523bf..3fae781ae 100644 --- a/Gemfile +++ b/Gemfile @@ -169,6 +169,7 @@ group :development, :test do gem 'rswag-specs' gem 'rubocop-rails' gem 'rubocop-rspec' + gem 'rubocop-rspec_rails' gem 'webrat' # provides HTML matchers for view tests gem 'dotenv-rails' diff --git a/Gemfile.lock b/Gemfile.lock index f2298c04c..dc2f7205b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -582,6 +582,9 @@ GEM rubocop-ast (>= 1.31.1, < 2.0) rubocop-rspec (3.0.2) rubocop (~> 1.61) + rubocop-rspec_rails (2.30.0) + rubocop (~> 1.61) + rubocop-rspec (~> 3, >= 3.0.1) ruby-progressbar (1.13.0) ruby-units (4.0.3) ruby-vips (2.2.1) @@ -773,6 +776,7 @@ DEPENDENCIES rubocop rubocop-rails rubocop-rspec + rubocop-rspec_rails ruby-units sassc-rails scout_apm @@ -791,7 +795,7 @@ DEPENDENCIES xmlrpc RUBY VERSION - ruby 3.1.4p223 + ruby 3.2.2p53 BUNDLED WITH - 2.3.11 + 2.4.22 diff --git a/app/views/members/show.html.haml b/app/views/members/show.html.haml index c2e389c48..e8f06f111 100644 --- a/app/views/members/show.html.haml +++ b/app/views/members/show.html.haml @@ -35,7 +35,7 @@ - if @member.last_sign_in_at %p %strong Last Login - = @member.last_sign_in_at + = @member.last_sign_in_at&.to_fs(:default) - if can? :update, @member = link_to edit_member_registration_path, class: 'btn btn-block' do diff --git a/app/views/posts/_single.html.haml b/app/views/posts/_single.html.haml index fa7a07aea..e3ed56405 100644 --- a/app/views/posts/_single.html.haml +++ b/app/views/posts/_single.html.haml @@ -8,10 +8,10 @@ in = link_to @post.forum, @post.forum on - = @post.created_at + = @post.created_at.to_fs(:default) - if @post.updated_at > @post.created_at and edited at - = @post.updated_at + = @post.updated_at.to_fs(:default) = link_to "Permalink", post diff --git a/db/migrate/20150201052245_create_cms.rb b/db/migrate/20150201052245_create_cms.rb index 56ecebb8b..b12cdf090 100644 --- a/db/migrate/20150201052245_create_cms.rb +++ b/db/migrate/20150201052245_create_cms.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class CreateCms < ActiveRecord::Migration[4.2] - def self.up # rubocop:disable Metrics/MethodLength + def self.up # -- Sites -------------------------------------------------------------- create_table :comfy_cms_sites do |t| t.string :label, null: false diff --git a/db/migrate/20230313015323_create_active_storage_tables.active_storage.rb b/db/migrate/20230313015323_create_active_storage_tables.active_storage.rb index ed5c1d300..2cd98fd53 100644 --- a/db/migrate/20230313015323_create_active_storage_tables.active_storage.rb +++ b/db/migrate/20230313015323_create_active_storage_tables.active_storage.rb @@ -39,7 +39,7 @@ class CreateActiveStorageTables < ActiveRecord::Migration[5.2] t.foreign_key :active_storage_blobs, column: :blob_id end - create_table :active_storage_variant_records, id: primary_key_type do |t| + create_table :active_storage_variant_records, id: primary_key_type do |t| # rubocop:disable Rails/CreateTableWithTimestamps t.belongs_to :blob, null: false, index: false, type: foreign_key_type t.string :variation_digest, null: false diff --git a/spec/models/post_spec.rb b/spec/models/post_spec.rb index aed44225d..2fcb2a2f1 100644 --- a/spec/models/post_spec.rb +++ b/spec/models/post_spec.rb @@ -144,7 +144,7 @@ describe Post do end it "does not duplicate" do - expect(post.crops) =~ [tomato, maize] + expect(post.crops).to match_array([tomato, maize]) end it "is updated when post was modified" do diff --git a/spec/views/posts/_single.html.haml_spec.rb b/spec/views/posts/_single.html.haml_spec.rb index 403ea1198..a3321e4ce 100644 --- a/spec/views/posts/_single.html.haml_spec.rb +++ b/spec/views/posts/_single.html.haml_spec.rb @@ -68,7 +68,7 @@ describe "posts/_single" do end it "shows the updated time" do - rendered.should have_content @post.updated_at + rendered.should have_content @post.updated_at.to_fs(:default) end end From 78fee52f17ddff3a925f9ebe1b16320a9e4b2c57 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 13 Jul 2024 15:09:32 +0930 Subject: [PATCH 003/203] Ruby 3.2: Upgrade Rubocop and add more rubocop helpers (#3779) * Ruby 3.2/Bundler 2.4 * Fix creation * Upgrade to js-routes 2. Put all js routes into a global namespace. * Remove js-routes * Remove * Adjust ownership * Appease codeclimate for the nth time * Fix deprecation warning by explicitly calling to_fs * Fix deprecation warning by explicitly calling to_fs * Fix deprecation warning by explicitly calling to_fs * Swap to will paginate successor for bootstrap * Update app/views/members/show.html.haml * Update app/views/plantings/index.rss.haml * Update .env * Update .devcontainer/.env * Fix spec * Update spec * Fix spec * Pin to 2.4.22 * 3 space indent * Regenerate * Update rubocop * Rubocop * More rubocop * Regenerate * Fix config file --- .rubocop.yml | 4 ++ .rubocop_todo.yml | 116 ++++++++++++++++++++++++++++++++++++++++++++-- Gemfile | 3 ++ Gemfile.lock | 9 ++++ 4 files changed, 129 insertions(+), 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index b42b06f04..629f585a9 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,7 +1,11 @@ inherit_from: .rubocop_todo.yml require: + - rubocop-factory_bot + - rubocop-capybara - rubocop-rails - rubocop-rspec + - rubocop-rspec_rails + - rubocop-rake AllCops: NewCops: enable Exclude: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 1336b72aa..62e1540ec 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,11 +1,93 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2024-07-13 04:50:02 UTC using RuboCop version 1.65.0. +# on 2024-07-13 05:22:30 UTC using RuboCop version 1.65.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. +# Offense count: 231 +# Configuration parameters: EnforcedStyle. +# SupportedStyles: link_or_button, strict +Capybara/ClickLinkOrButtonStyle: + Enabled: false + +# Offense count: 84 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: have_no, not_to +Capybara/NegationMatcher: + Enabled: false + +# Offense count: 39 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: DefaultSelector. +Capybara/RSpec/HaveSelector: + Exclude: + - 'spec/features/conversations/index_spec.rb' + - 'spec/features/footer_spec.rb' + - 'spec/features/gardens/adding_gardens_spec.rb' + - 'spec/features/harvests/harvesting_a_crop_spec.rb' + - 'spec/features/members/list_spec.rb' + - 'spec/features/plantings/planting_a_crop_spec.rb' + - 'spec/features/seeds/adding_seeds_spec.rb' + - 'spec/features/shared_examples/crop_suggest.rb' + - 'spec/helpers/application_helper_spec.rb' + - 'spec/support/feature_helpers.rb' + - 'spec/views/posts/show.html.haml_spec.rb' + +# Offense count: 14 +Capybara/SpecificMatcher: + Exclude: + - 'spec/features/footer_spec.rb' + - 'spec/features/gardens/adding_gardens_spec.rb' + - 'spec/features/harvests/harvesting_a_crop_spec.rb' + - 'spec/features/plantings/planting_a_crop_spec.rb' + - 'spec/features/seeds/adding_seeds_spec.rb' + +# Offense count: 1 +Capybara/VisibilityMatcher: + Exclude: + - 'spec/features/shared_examples/crop_suggest.rb' + +# Offense count: 6 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle, NonImplicitAssociationMethodNames. +# SupportedStyles: explicit, implicit +FactoryBot/AssociationStyle: + Exclude: + - 'spec/factories/alternate_names.rb' + - 'spec/factories/crop.rb' + - 'spec/factories/like.rb' + - 'spec/factories/scientific_name.rb' + +# Offense count: 3 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AutoCorrect, Include, EnforcedStyle, ExplicitOnly. +# Include: **/*_spec.rb, **/spec/**/*, **/test/**/*, **/features/support/factories/**/*.rb +# SupportedStyles: create_list, n_times +FactoryBot/CreateList: + Exclude: + - 'spec/views/comments/index.rss.haml_spec.rb' + - 'spec/views/photos/index.html.haml_spec.rb' + - 'spec/views/posts/index.html.haml_spec.rb' + +# Offense count: 4 +# Configuration parameters: Include, MaxAmount. +# Include: **/*_spec.rb, **/spec/**/*, **/test/**/*, **/features/support/factories/**/*.rb +FactoryBot/ExcessiveCreateList: + Exclude: + - 'spec/controllers/posts_controller_spec.rb' + - 'spec/features/crops/show_spec.rb' + - 'spec/features/percy/percy_spec.rb' + +# Offense count: 1127 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Include. +# Include: **/*_spec.rb, **/spec/**/*, **/test/**/*, **/features/support/factories/**/*.rb +FactoryBot/SyntaxMethods: + Enabled: false + # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyleAlignWith. @@ -154,6 +236,12 @@ Lint/EmptyBlock: - 'spec/features/crops/crop_detail_page_spec.rb' - 'spec/requests/authentications_spec.rb' +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Lint/RedundantCopDisableDirective: + Exclude: + - 'db/migrate/20230313015323_create_active_storage_tables.active_storage.rb' + # Offense count: 2 # This cop supports unsafe autocorrection (--autocorrect-all). Lint/RedundantDirGlobSort: @@ -187,7 +275,7 @@ Lint/UselessAssignment: Metrics/AbcSize: Max: 151 -# Offense count: 13 +# Offense count: 14 # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode. # AllowedMethods: refine Metrics/BlockLength: @@ -203,7 +291,7 @@ Metrics/ClassLength: Metrics/CyclomaticComplexity: Max: 32 -# Offense count: 70 +# Offense count: 71 # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. Metrics/MethodLength: Max: 127 @@ -439,6 +527,23 @@ RSpec/VerifiedDoubles: - 'spec/controllers/gardens_controller_spec.rb' - 'spec/views/devise/shared/_links_spec.rb' +# Offense count: 7 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: ResponseMethods. +# ResponseMethods: response, last_response +RSpecRails/HaveHttpStatus: + Exclude: + - 'spec/controllers/api/v1/plantings_controller_spec.rb' + - 'spec/controllers/harvests_controller_spec.rb' + - 'spec/controllers/likes_controller_spec.rb' + - 'spec/requests/harvests_spec.rb' + +# Offense count: 16 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Inferences. +RSpecRails/InferredSpecType: + Enabled: false + # Offense count: 28 # Configuration parameters: Database, Include. # SupportedDatabases: mysql, postgresql @@ -629,6 +734,11 @@ Rails/WhereRange: - 'app/models/concerns/predict_planting.rb' - 'app/models/garden.rb' +# Offense count: 1 +Rake/MethodDefinitionInTask: + Exclude: + - 'lib/tasks/growstuff.rake' + # Offense count: 3 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. diff --git a/Gemfile b/Gemfile index 3fae781ae..5a19c18ae 100644 --- a/Gemfile +++ b/Gemfile @@ -167,7 +167,10 @@ group :development, :test do gem 'rspec-activemodel-mocks' gem 'rspec-rails' # unit testing framework gem 'rswag-specs' + gem 'rubocop-capybara' + gem 'rubocop-factory_bot' gem 'rubocop-rails' + gem 'rubocop-rake' gem 'rubocop-rspec' gem 'rubocop-rspec_rails' gem 'webrat' # provides HTML matchers for view tests diff --git a/Gemfile.lock b/Gemfile.lock index dc2f7205b..b94ab9127 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -575,11 +575,17 @@ GEM unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.31.3) parser (>= 3.3.1.0) + rubocop-capybara (2.21.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.26.1) + rubocop (~> 1.61) rubocop-rails (2.25.1) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rake (0.6.0) + rubocop (~> 1.0) rubocop-rspec (3.0.2) rubocop (~> 1.61) rubocop-rspec_rails (2.30.0) @@ -774,7 +780,10 @@ DEPENDENCIES rswag-specs rswag-ui rubocop + rubocop-capybara + rubocop-factory_bot rubocop-rails + rubocop-rake rubocop-rspec rubocop-rspec_rails ruby-units From 1176d189186ec33cb4f7e8fcb44fc4dab8000318 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 13 Jul 2024 15:11:49 +0930 Subject: [PATCH 004/203] Ruby 3.2: Rubocop - Fix Lint/symbol conversion (#3781) * Lint/SymbolConversion: Unnecessary symbol conversion; use error: instead. --- .rubocop_todo.yml | 8 -------- app/controllers/likes_controller.rb | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 62e1540ec..f09a2d9df 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -254,14 +254,6 @@ Lint/SuppressedException: Exclude: - 'lib/tasks/testing.rake' -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: strict, consistent -Lint/SymbolConversion: - Exclude: - - 'app/controllers/likes_controller.rb' - # Offense count: 7 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AutoCorrect. diff --git a/app/controllers/likes_controller.rb b/app/controllers/likes_controller.rb index 638a5038c..3093ce42e 100644 --- a/app/controllers/likes_controller.rb +++ b/app/controllers/likes_controller.rb @@ -58,7 +58,7 @@ class LikesController < ApplicationController def failed(like, message) respond_to do |format| - format.json { render(json: { 'error': message }, status: :forbidden) } + format.json { render(json: { error: message }, status: :forbidden) } format.html do flash[:error] = message if like&.likeable From e69467f056f20658b99357651aa84ceb7d0db6ea Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 13 Jul 2024 15:12:56 +0930 Subject: [PATCH 005/203] Ruby 3.2: Rubocop - RSpec/excessive docstring spacing (#3782) * RSpec/ExcessiveDocstringSpacing --- .rubocop_todo.yml | 7 ------- spec/controllers/crops_controller_spec.rb | 2 +- spec/features/crops/crop_photos_spec.rb | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index f09a2d9df..c62b699a9 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -350,13 +350,6 @@ RSpec/EmptyLineAfterExample: RSpec/ExampleLength: Max: 25 -# Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). -RSpec/ExcessiveDocstringSpacing: - Exclude: - - 'spec/controllers/crops_controller_spec.rb' - - 'spec/features/crops/crop_photos_spec.rb' - # Offense count: 32 RSpec/ExpectInHook: Exclude: diff --git a/spec/controllers/crops_controller_spec.rb b/spec/controllers/crops_controller_spec.rb index 62f441a39..718da23bb 100644 --- a/spec/controllers/crops_controller_spec.rb +++ b/spec/controllers/crops_controller_spec.rb @@ -28,7 +28,7 @@ describe CropsController do end end - describe "GET crop hierarchy " do + describe "GET crop hierarchy" do describe 'fetches the crop hierarchy page' do context 'wrangler' do include_context 'login as wrangler' diff --git a/spec/features/crops/crop_photos_spec.rb b/spec/features/crops/crop_photos_spec.rb index d2c7f397b..1bcfa3667 100644 --- a/spec/features/crops/crop_photos_spec.rb +++ b/spec/features/crops/crop_photos_spec.rb @@ -69,7 +69,7 @@ describe "crop detail page", :js, :search do include_examples "shows photos" end - context "when not signed in " do + context "when not signed in" do include_examples "shows photos" end end From d542326047043f2bed1d5d299ff6f3baede0007c Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 13 Jul 2024 15:13:56 +0930 Subject: [PATCH 006/203] Ruby 3.2: Rubocop - Rails/FilePath (#3783) * Rails/FilePath --- .rubocop_todo.yml | 11 ----------- app/controllers/crops_controller.rb | 2 +- config/application.rb | 2 +- config/environments/development.rb | 2 +- db/seeds.rb | 4 ++-- 5 files changed, 5 insertions(+), 16 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index c62b699a9..f3729f004 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -552,17 +552,6 @@ Rails/Date: Exclude: - 'app/mailers/notifier_mailer.rb' -# Offense count: 5 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: slashes, arguments -Rails/FilePath: - Exclude: - - 'app/controllers/crops_controller.rb' - - 'config/application.rb' - - 'config/environments/development.rb' - - 'db/seeds.rb' - # Offense count: 11 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AllowedMethods, AllowedPatterns. diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index d974b9201..490a0076b 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -81,7 +81,7 @@ class CropsController < ApplicationController @companions = @crop.companions.approved end format.svg do - icon_data = @crop.svg_icon.presence || File.read(Rails.root.join('app', 'assets', 'images', 'icons', 'sprout.svg')) + icon_data = @crop.svg_icon.presence || File.read(Rails.root.join("app/assets/images/icons/sprout.svg")) send_data(icon_data, type: "image/svg+xml", disposition: "inline") end format.json do diff --git a/config/application.rb b/config/application.rb index 7b18d9243..208026060 100644 --- a/config/application.rb +++ b/config/application.rb @@ -26,7 +26,7 @@ module Growstuff config.active_record.yaml_column_permitted_classes = [Symbol, Date, Time, ActiveSupport::TimeWithZone, ActiveSupport::TimeZone] # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. - I18n.load_path += Dir[Rails.root.join('config', 'locales', '*.{rb,yml}')] + I18n.load_path += Dir[Rails.root.join("config/locales/*.{rb,yml}")] I18n.default_locale = :en # rails will fallback to config.i18n.default_locale translation config.i18n.fallbacks = true diff --git a/config/environments/development.rb b/config/environments/development.rb index c3d3bc990..ae00291b8 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -16,7 +16,7 @@ Rails.application.configure do # Enable/disable caching. By default caching is disabled. # Run rails dev:cache to toggle caching. - if Rails.root.join('tmp', 'caching-dev.txt').exist? + if Rails.root.join("tmp/caching-dev.txt").exist? config.action_controller.perform_caching = true config.cache_store = :memory_store diff --git a/db/seeds.rb b/db/seeds.rb index 7b99bb9e2..3c34783f9 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -26,7 +26,7 @@ def load_data end def load_crops - source_path = Rails.root.join('db', 'seeds') + source_path = Rails.root.join("db/seeds") Dir.glob("#{source_path}/crops*.csv").each do |crop_file| puts "Loading crops from #{crop_file}..." CSV.foreach(crop_file) do |row| @@ -48,7 +48,7 @@ def load_test_users puts "Loading test users..." # Open suburb csv - source_path = Rails.root.join('db', 'seeds') + source_path = Rails.root.join("db/seeds") begin suburb_file = File.open("#{source_path}/suburbs.csv") rescue StandardError From 4f5c47ba58a19e1ef46607c8e18beab7472f4964 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 13 Jul 2024 15:19:09 +0930 Subject: [PATCH 007/203] Ruby 3.2: Rubocop - Layout/* (#3785) * Rubocop - Layout/* * Regenerate --- .rubocop_todo.yml | 111 +----------------- app/mailers/notifier_mailer.rb | 4 +- app/models/concerns/search_activities.rb | 2 +- app/models/concerns/search_plantings.rb | 2 +- app/models/seed.rb | 16 +-- config/environments/production.rb | 2 +- .../application_controller_renderer.rb | 1 + config/initializers/backtrace_silencers.rb | 1 + .../initializers/content_security_policy.rb | 1 + config/initializers/mime_types.rb | 1 + .../new_framework_defaults_5_2.rb | 1 + .../20171129041341_create_photographings.rb | 4 + ...190130090437_add_crop_to_photographings.rb | 1 + .../20240218053122_add_slug_to_activity.rb | 1 + lib/tasks/gardens.rake | 1 - lib/tasks/growstuff.rake | 4 +- spec/factories/activity.rb | 35 +++--- spec/features/admin/newsletter_spec.rb | 2 +- spec/features/rss/plantings_spec.rb | 4 +- spec/features/rss/posts_spec.rb | 4 +- spec/features/rss/seeds_spec.rb | 4 +- spec/models/ability_spec.rb | 1 - spec/models/seed_spec.rb | 2 +- spec/rails_helper.rb | 1 - spec/requests/plantings_spec.rb | 3 +- 25 files changed, 56 insertions(+), 153 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index f3729f004..96d08c22e 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2024-07-13 05:22:30 UTC using RuboCop version 1.65.0. +# on 2024-07-13 05:47:38 UTC using RuboCop version 1.65.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -88,117 +88,14 @@ FactoryBot/ExcessiveCreateList: FactoryBot/SyntaxMethods: Enabled: false -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyleAlignWith. -# SupportedStylesAlignWith: either, start_of_block, start_of_line -Layout/BlockAlignment: - Exclude: - - 'spec/factories/activity.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowForAlignment. -Layout/CommentIndentation: - Exclude: - - 'config/environments/production.rb' - -# Offense count: 6 -# This cop supports safe autocorrection (--autocorrect). -Layout/EmptyLineAfterMagicComment: - Exclude: - - 'config/initializers/application_controller_renderer.rb' - - 'config/initializers/backtrace_silencers.rb' - - 'config/initializers/content_security_policy.rb' - - 'config/initializers/mime_types.rb' - - 'config/initializers/new_framework_defaults_5_2.rb' - - 'db/migrate/20240218053122_add_slug_to_activity.rb' - -# Offense count: 5 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, DefLikeMacros, AllowAdjacentOneLineDefs, NumberOfEmptyLines. -Layout/EmptyLineBetweenDefs: - Exclude: - - 'db/migrate/20171129041341_create_photographings.rb' - - 'db/migrate/20190130090437_add_crop_to_photographings.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Layout/EmptyLines: - Exclude: - - 'spec/models/ability_spec.rb' - # Offense count: 2 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: empty_lines, no_empty_lines -Layout/EmptyLinesAroundBlockBody: - Exclude: - - 'lib/tasks/gardens.rake' - - 'spec/rails_helper.rb' - -# Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. -# SupportedHashRocketStyles: key, separator, table -# SupportedColonStyles: key, separator, table -# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit -Layout/HashAlignment: - Exclude: - - 'app/models/concerns/search_activities.rb' - - 'app/models/concerns/search_plantings.rb' - -# Offense count: 10 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: space, no_space -Layout/LineContinuationSpacing: - Exclude: - - 'app/mailers/notifier_mailer.rb' - - 'app/models/seed.rb' - - 'lib/tasks/growstuff.rake' - - 'spec/features/rss/plantings_spec.rb' - - 'spec/features/rss/posts_spec.rb' - - 'spec/features/rss/seeds_spec.rb' - - 'spec/models/seed_spec.rb' - -# Offense count: 9 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle, IndentationWidth. -# SupportedStyles: aligned, indented -Layout/LineEndStringConcatenationIndentation: - Exclude: - - 'app/mailers/notifier_mailer.rb' - - 'app/models/seed.rb' - - 'lib/tasks/growstuff.rake' - - 'spec/features/rss/plantings_spec.rb' - - 'spec/features/rss/posts_spec.rb' - - 'spec/features/rss/seeds_spec.rb' - -# Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. # URISchemes: http, https Layout/LineLength: Exclude: - 'app/helpers/crops_helper.rb' - 'db/seeds.rb' - - 'spec/requests/plantings_spec.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: final_newline, final_blank_line -Layout/TrailingEmptyLines: - Exclude: - - 'spec/features/admin/newsletter_spec.rb' - -# Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowInHeredoc. -Layout/TrailingWhitespace: - Exclude: - - 'spec/factories/activity.rb' # Offense count: 3 # This cop supports safe autocorrection (--autocorrect). @@ -849,12 +746,10 @@ Style/OptionalBooleanParameter: # Offense count: 5 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. +# Configuration parameters: . # SupportedStyles: same_as_string_literals, single_quotes, double_quotes Style/QuotedSymbols: - Exclude: - - 'app/models/seed.rb' - - 'spec/controllers/crops_controller_spec.rb' + EnforcedStyle: double_quotes # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). diff --git a/app/mailers/notifier_mailer.rb b/app/mailers/notifier_mailer.rb index 345c3cad3..86ac948a5 100644 --- a/app/mailers/notifier_mailer.rb +++ b/app/mailers/notifier_mailer.rb @@ -6,8 +6,8 @@ class NotifierMailer < ApplicationMailer def verifier unless ENV['RAILS_SECRET_TOKEN'] - raise "RAILS_SECRET_TOKEN environment variable"\ - "not set - have you created config/application.yml?" + raise "RAILS_SECRET_TOKEN environment variable" \ + "not set - have you created config/application.yml?" end ActiveSupport::MessageVerifier.new(ENV['RAILS_SECRET_TOKEN']) diff --git a/app/models/concerns/search_activities.rb b/app/models/concerns/search_activities.rb index 96e0c2bdc..458d0921c 100644 --- a/app/models/concerns/search_activities.rb +++ b/app/models/concerns/search_activities.rb @@ -44,7 +44,7 @@ module SearchActivities 1..limit.times do where = { # photos_count: { gt: 0 }, - owner_id: { not: owners } + owner_id: { not: owners } } one_record = search('*', limit: 1, diff --git a/app/models/concerns/search_plantings.rb b/app/models/concerns/search_plantings.rb index 3452807b2..d8a0c135a 100644 --- a/app/models/concerns/search_plantings.rb +++ b/app/models/concerns/search_plantings.rb @@ -30,7 +30,7 @@ module SearchPlantings quantity:, sunniness:, garden_id:, - garden_name: garden&.name, + garden_name: garden&.name, description:, first_harvest_predicted_at:, diff --git a/app/models/seed.rb b/app/models/seed.rb index 5178dfcbe..9e1ce7527 100644 --- a/app/models/seed.rb +++ b/app/models/seed.rb @@ -33,17 +33,17 @@ class Seed < ApplicationRecord validates :days_until_maturity_max, allow_nil: true, numericality: { only_integer: true, greater_than_or_equal_to: 0 } validates :tradable_to, allow_blank: false, - inclusion: { in: TRADABLE_TO_VALUES, message: "You may only trade seed nowhere, "\ - "locally, nationally, or internationally" } + inclusion: { in: TRADABLE_TO_VALUES, message: "You may only trade seed nowhere, " \ + "locally, nationally, or internationally" } validates :organic, allow_blank: false, - inclusion: { in: ORGANIC_VALUES, message: "You must say whether the seeds "\ - "are organic or not, or that you don't know" } + inclusion: { in: ORGANIC_VALUES, message: "You must say whether the seeds " \ + "are organic or not, or that you don't know" } validates :gmo, allow_blank: false, - inclusion: { in: GMO_VALUES, message: "You must say whether the seeds are "\ - "genetically modified or not, or that you don't know" } + inclusion: { in: GMO_VALUES, message: "You must say whether the seeds are " \ + "genetically modified or not, or that you don't know" } validates :heirloom, allow_blank: false, - inclusion: { in: HEIRLOOM_VALUES, message: "You must say whether the seeds"\ - "are heirloom, hybrid, or unknown" } + inclusion: { in: HEIRLOOM_VALUES, message: "You must say whether the seeds" \ + "are heirloom, hybrid, or unknown" } # # Delegations diff --git a/config/environments/production.rb b/config/environments/production.rb index 8ba5acec9..d846e020c 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -27,7 +27,7 @@ Rails.application.configure do # Compress JavaScripts and CSS. config.assets.js_compressor = :terser -# config.assets.css_compressor = :sass + # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed. config.assets.compile = false diff --git a/config/initializers/application_controller_renderer.rb b/config/initializers/application_controller_renderer.rb index f4556db39..6d56e4390 100644 --- a/config/initializers/application_controller_renderer.rb +++ b/config/initializers/application_controller_renderer.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # ActiveSupport::Reloader.to_prepare do diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb index d0f0d3b5d..4b63f2893 100644 --- a/config/initializers/backtrace_silencers.rb +++ b/config/initializers/backtrace_silencers.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb index f3bcce546..9c49284a8 100644 --- a/config/initializers/content_security_policy.rb +++ b/config/initializers/content_security_policy.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Define an application-wide content security policy diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index 690e74d6d..d6cd97236 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks: diff --git a/config/initializers/new_framework_defaults_5_2.rb b/config/initializers/new_framework_defaults_5_2.rb index 7df9ce8f4..c300f2133 100644 --- a/config/initializers/new_framework_defaults_5_2.rb +++ b/config/initializers/new_framework_defaults_5_2.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # # This file contains migration options to ease your Rails 5.2 upgrade. diff --git a/db/migrate/20171129041341_create_photographings.rb b/db/migrate/20171129041341_create_photographings.rb index 2ae1168df..dcfa6d7fd 100644 --- a/db/migrate/20171129041341_create_photographings.rb +++ b/db/migrate/20171129041341_create_photographings.rb @@ -37,18 +37,22 @@ class CreatePhotographings < ActiveRecord::Migration[4.2] Photographing.create! photo_id: s.photo_id, photographable_id: s.seed_id, photographable_type: 'Seed' end end + class GardensPhoto < ApplicationRecord belongs_to :photo belongs_to :garden end + class PhotosPlanting < ApplicationRecord belongs_to :photo belongs_to :planting end + class HarvestsPhoto < ApplicationRecord belongs_to :photo belongs_to :harvest end + class PhotosSeed < ApplicationRecord belongs_to :photo belongs_to :seed diff --git a/db/migrate/20190130090437_add_crop_to_photographings.rb b/db/migrate/20190130090437_add_crop_to_photographings.rb index e74f57b66..19e429689 100644 --- a/db/migrate/20190130090437_add_crop_to_photographings.rb +++ b/db/migrate/20190130090437_add_crop_to_photographings.rb @@ -9,6 +9,7 @@ class AddCropToPhotographings < ActiveRecord::Migration[5.2] p.set_crop && p.save! end end + class Photographing < ApplicationRecord belongs_to :photo, inverse_of: :photo_associations belongs_to :photographable, polymorphic: true diff --git a/db/migrate/20240218053122_add_slug_to_activity.rb b/db/migrate/20240218053122_add_slug_to_activity.rb index 0282f78d9..20f7386d5 100644 --- a/db/migrate/20240218053122_add_slug_to_activity.rb +++ b/db/migrate/20240218053122_add_slug_to_activity.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class AddSlugToActivity < ActiveRecord::Migration[7.1] def change add_column :activities, :slug, :string diff --git a/lib/tasks/gardens.rake b/lib/tasks/gardens.rake index 605173363..450255ec4 100644 --- a/lib/tasks/gardens.rake +++ b/lib/tasks/gardens.rake @@ -1,7 +1,6 @@ # frozen_string_literal: true namespace :gardens do - desc "Mark old gardens inactive" task archive: :environment do Planting.archive! diff --git a/lib/tasks/growstuff.rake b/lib/tasks/growstuff.rake index 3b066727f..70fd11898 100644 --- a/lib/tasks/growstuff.rake +++ b/lib/tasks/growstuff.rake @@ -17,8 +17,8 @@ namespace :growstuff do def add_role_to_member!(login_name, role_name) unless login_name && role_name - raise "Usage: rake growstuff:[rolename] name=[username] "\ - "\n (login name is case-sensitive)\n" + raise "Usage: rake growstuff:[rolename] name=[username] " \ + "\n (login name is case-sensitive)\n" end member = Member.find_by!(login_name:) role = Role.find_by!(name: role_name) diff --git a/spec/factories/activity.rb b/spec/factories/activity.rb index 68046e5e6..322de2ea0 100644 --- a/spec/factories/activity.rb +++ b/spec/factories/activity.rb @@ -3,24 +3,23 @@ # Read about factories at https://github.com/thoughtbot/factory_bot FactoryBot.define do - factory :activity do - name { "Admire" } - description { "Spend 10 minutes admiring your hard work" } - category { "General" } - owner - - trait :garden do - category { "Soil Cultivation" } - description { "Apply compost from winter" } - due_date { 3.months.from_now } - garden - end + factory :activity do + name { "Admire" } + description { "Spend 10 minutes admiring your hard work" } + category { "General" } + owner - trait :planting do - category { "Pruning" } - description { "Stake tomato" } - planting - end + trait :garden do + category { "Soil Cultivation" } + description { "Apply compost from winter" } + due_date { 3.months.from_now } + garden + end + + trait :planting do + category { "Pruning" } + description { "Stake tomato" } + planting end end - \ No newline at end of file +end diff --git a/spec/features/admin/newsletter_spec.rb b/spec/features/admin/newsletter_spec.rb index 42023662b..9111f95eb 100644 --- a/spec/features/admin/newsletter_spec.rb +++ b/spec/features/admin/newsletter_spec.rb @@ -19,4 +19,4 @@ describe "newsletter subscribers", :js do it { expect(page).to have_current_path admin_newsletter_path, ignore_query: true } it { expect(page).to have_content @subscriber.email } end -end \ No newline at end of file +end diff --git a/spec/features/rss/plantings_spec.rb b/spec/features/rss/plantings_spec.rb index 30ffba947..69b46a075 100644 --- a/spec/features/rss/plantings_spec.rb +++ b/spec/features/rss/plantings_spec.rb @@ -11,7 +11,7 @@ describe 'Plantings RSS feed' do it 'The index title is what we expect' do Planting.reindex visit plantings_path(format: 'rss') - expect(page).to have_content "Recent plantings from "\ - "#{@owner || 'all members'} (#{ENV['GROWSTUFF_SITE_NAME']})" + expect(page).to have_content "Recent plantings from " \ + "#{@owner || 'all members'} (#{ENV['GROWSTUFF_SITE_NAME']})" end end diff --git a/spec/features/rss/posts_spec.rb b/spec/features/rss/posts_spec.rb index b07ca28cb..d2b27cb8c 100644 --- a/spec/features/rss/posts_spec.rb +++ b/spec/features/rss/posts_spec.rb @@ -10,7 +10,7 @@ describe 'Posts RSS feed' do it 'The index title is what we expect' do visit posts_path(format: 'rss') - expect(page).to have_content "Recent posts from "\ - "#{@author || 'all members'} (#{ENV['GROWSTUFF_SITE_NAME']})" + expect(page).to have_content "Recent posts from " \ + "#{@author || 'all members'} (#{ENV['GROWSTUFF_SITE_NAME']})" end end diff --git a/spec/features/rss/seeds_spec.rb b/spec/features/rss/seeds_spec.rb index c0a2e141d..35c4a5498 100644 --- a/spec/features/rss/seeds_spec.rb +++ b/spec/features/rss/seeds_spec.rb @@ -10,7 +10,7 @@ describe 'Seeds RSS feed' do it 'The index title is what we expect' do visit seeds_path(format: 'rss') - expect(page).to have_content "Recent seeds from "\ - "#{@owner || 'all members'} (#{ENV['GROWSTUFF_SITE_NAME']})" + expect(page).to have_content "Recent seeds from " \ + "#{@owner || 'all members'} (#{ENV['GROWSTUFF_SITE_NAME']})" end end diff --git a/spec/models/ability_spec.rb b/spec/models/ability_spec.rb index 43b97a108..7bef2ded8 100644 --- a/spec/models/ability_spec.rb +++ b/spec/models/ability_spec.rb @@ -119,7 +119,6 @@ describe Ability do end end - context 'members' do context 'ordinary member' do it "can't manage members" do diff --git a/spec/models/seed_spec.rb b/spec/models/seed_spec.rb index e54e455d1..70bc751b8 100644 --- a/spec/models/seed_spec.rb +++ b/spec/models/seed_spec.rb @@ -51,7 +51,7 @@ describe Seed do @seed = FactoryBot.build(:seed, tradable_to: 'not valid') @seed.should_not be_valid @seed.errors[:tradable_to].should include( - "You may only trade seed nowhere, locally, "\ + "You may only trade seed nowhere, locally, " \ "nationally, or internationally" ) end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 4353bcc60..2dfc3a2e7 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -127,7 +127,6 @@ RSpec.configure do |config| # Prevent Poltergeist from fetching external URLs during feature tests config.before(:each, :js) do - # TODO: Why are we setting this page size then straight afterwards, maximising? width = 1280 height = 1280 diff --git a/spec/requests/plantings_spec.rb b/spec/requests/plantings_spec.rb index 94151e8d8..1a1126cb7 100644 --- a/spec/requests/plantings_spec.rb +++ b/spec/requests/plantings_spec.rb @@ -15,7 +15,8 @@ describe "Plantings" do before do @member = create(:interesting_member) - @predictable_planting = create(:predictable_planting, owner: @member, planted_at: 1.days.ago, days_to_first_harvest: 10, days_to_last_harvest: 20) + @predictable_planting = create(:predictable_planting, owner: @member, planted_at: 1.days.ago, days_to_first_harvest: 10, +days_to_last_harvest: 20) @predictable_planting.crop.update(median_days_to_first_harvest: 10) @seedling_planting = create(:seedling_planting, owner: @member) From 8b4f0771c52ce0efc0e2da7ed6b89e1a79abf287 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 13 Jul 2024 15:20:11 +0930 Subject: [PATCH 008/203] Ruby 3.2: Rubocop - Fix Negation matcher (#3780) * Ruby 3.2/Bundler 2.4 * Fix creation * Upgrade to js-routes 2. Put all js routes into a global namespace. * Remove js-routes * Remove * Adjust ownership * Appease codeclimate for the nth time * Fix deprecation warning by explicitly calling to_fs * Fix deprecation warning by explicitly calling to_fs * Fix deprecation warning by explicitly calling to_fs * Swap to will paginate successor for bootstrap * Update app/views/members/show.html.haml * Update app/views/plantings/index.rss.haml * Update .env * Update .devcontainer/.env * Fix spec * Update spec * Fix spec * Pin to 2.4.22 * 3 space indent * Regenerate * Update rubocop * Rubocop * More rubocop * Regenerate * Fix Capybara/NegationMatcher --- .rubocop_todo.yml | 7 ------ spec/features/conversations/index_spec.rb | 10 ++++---- spec/features/crops/alternate_name_spec.rb | 2 +- spec/features/crops/browse_crops_spec.rb | 6 ++--- spec/features/crops/crop_detail_page_spec.rb | 12 +++++----- spec/features/crops/crop_wranglers_spec.rb | 4 ++-- .../crops/crop_wrangling_button_spec.rb | 4 ++-- spec/features/crops/scientific_name_spec.rb | 2 +- spec/features/gardens/actions_spec.rb | 4 ++-- spec/features/gardens/adding_gardens_spec.rb | 2 +- spec/features/gardens/gardens_spec.rb | 8 +++---- spec/features/gardens/index_spec.rb | 16 ++++++------- .../features/harvests/browse_harvests_spec.rb | 2 +- spec/features/members/ban_spec.rb | 2 +- spec/features/members/deletion_spec.rb | 10 ++++---- spec/features/members/following_spec.rb | 10 ++++---- spec/features/members/profile_spec.rb | 24 +++++++++---------- .../features/places/searching_a_place_spec.rb | 2 +- spec/features/planting_reminder_spec.rb | 4 ++-- .../plantings/planting_a_crop_spec.rb | 14 +++++------ spec/features/plantings/show_spec.rb | 2 +- spec/features/shared_examples/crop_suggest.rb | 4 ++-- spec/features/timeline/index_spec.rb | 2 +- spec/views/crops/show.html.haml_spec.rb | 6 ++--- spec/views/plantings/show.html.haml_spec.rb | 4 ++-- spec/views/posts/new.html.haml_spec.rb | 2 +- spec/views/posts/show.html.haml_spec.rb | 8 +++---- spec/views/seeds/index.rss.haml_spec.rb | 2 +- 28 files changed, 84 insertions(+), 91 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 96d08c22e..1b0d00f49 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -12,13 +12,6 @@ Capybara/ClickLinkOrButtonStyle: Enabled: false -# Offense count: 84 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: have_no, not_to -Capybara/NegationMatcher: - Enabled: false - # Offense count: 39 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: DefaultSelector. diff --git a/spec/features/conversations/index_spec.rb b/spec/features/conversations/index_spec.rb index d82837f77..a5225817c 100644 --- a/spec/features/conversations/index_spec.rb +++ b/spec/features/conversations/index_spec.rb @@ -37,7 +37,7 @@ describe "Conversations", :js do describe 'restore conversation' do before { click_link class: 'restore' } - it { expect(page).not_to have_content 'something i want to say' } + it { expect(page).to have_no_content 'something i want to say' } describe 'conversation was restored' do before { click_link 'inbox' } @@ -61,8 +61,8 @@ describe "Conversations", :js do all('input[type=checkbox]').each(&:click) click_button 'Delete' - expect(page).not_to have_content 'this is a message' - expect(page).not_to have_content 'this is another message' + expect(page).to have_no_content 'this is a message' + expect(page).to have_no_content 'this is another message' end it 'deletes multiple conversations from the sentbox' do @@ -81,8 +81,8 @@ describe "Conversations", :js do expect(page).to have_selector('.sent') find('.sent').click - expect(page).not_to have_content 'this is a message' - expect(page).not_to have_content 'this is another message' + expect(page).to have_no_content 'this is a message' + expect(page).to have_no_content 'this is another message' end end end diff --git a/spec/features/crops/alternate_name_spec.rb b/spec/features/crops/alternate_name_spec.rb index 380a7f71d..4cd37b9a8 100644 --- a/spec/features/crops/alternate_name_spec.rb +++ b/spec/features/crops/alternate_name_spec.rb @@ -46,7 +46,7 @@ describe "Alternate names", :js do accept_confirm do click_link 'Delete' end - expect(page).not_to have_content alternate_eggplant.name + expect(page).to have_no_content alternate_eggplant.name expect(page).to have_content 'Alternate name was successfully deleted' end diff --git a/spec/features/crops/browse_crops_spec.rb b/spec/features/crops/browse_crops_spec.rb index b06572f1b..7c64fd9d8 100644 --- a/spec/features/crops/browse_crops_spec.rb +++ b/spec/features/crops/browse_crops_spec.rb @@ -19,11 +19,11 @@ describe "browse crops", :search do end it "pending crops are not listed" do - expect(page).not_to have_content pending_crop.name + expect(page).to have_no_content pending_crop.name end it "rejected crops are not listed" do - expect(page).not_to have_content rejected_crop.name + expect(page).to have_no_content rejected_crop.name end end @@ -35,7 +35,7 @@ describe "browse crops", :search do context 'anon' do include_examples 'shows crops' - it { expect(page).not_to have_link "Add New Crop" } + it { expect(page).to have_no_link "Add New Crop" } end context 'member' do diff --git a/spec/features/crops/crop_detail_page_spec.rb b/spec/features/crops/crop_detail_page_spec.rb index b441bd7fe..96020dca7 100644 --- a/spec/features/crops/crop_detail_page_spec.rb +++ b/spec/features/crops/crop_detail_page_spec.rb @@ -22,7 +22,7 @@ describe "crop detail page", :js do context "varieties" do it "The crop DOES NOT have varieties" do visit crop_path(crop) - expect(page).not_to have_text 'Varieties' + expect(page).to have_no_text 'Varieties' end end @@ -92,7 +92,7 @@ describe "crop detail page", :js do it "User not signed in" do visit crop_path(seed.crop) - expect(page).not_to have_content "You have 20 seeds" + expect(page).to have_no_content "You have 20 seeds" end context 'signed in' do @@ -194,7 +194,7 @@ describe "crop detail page", :js do it { expect(page).to have_text 'Annual' } it { expect(page).to have_text 'living and reproducing in a single year or less' } - it { expect(page).not_to have_text 'Perennial' } + it { expect(page).to have_no_text 'Perennial' } end context 'crop is Perennial' do @@ -202,14 +202,14 @@ describe "crop detail page", :js do it { expect(page).to have_text 'Perennial' } it { expect(page).to have_text 'living more than two years' } - it { expect(page).not_to have_text 'Annual' } + it { expect(page).to have_no_text 'Annual' } end context 'crop Perennial value is null' do let(:crop) { FactoryBot.create(:crop, perennial: nil) } - it { expect(page).not_to have_text 'Perennial' } - it { expect(page).not_to have_text 'Annual' } + it { expect(page).to have_no_text 'Perennial' } + it { expect(page).to have_no_text 'Annual' } end end end diff --git a/spec/features/crops/crop_wranglers_spec.rb b/spec/features/crops/crop_wranglers_spec.rb index 555669c0d..7a373b298 100644 --- a/spec/features/crops/crop_wranglers_spec.rb +++ b/spec/features/crops/crop_wranglers_spec.rb @@ -75,11 +75,11 @@ context "signed in non-wrangler" do it "can't see wrangling page without js", js: false do visit root_path - expect(page).not_to have_link "Crop Wrangling" + expect(page).to have_no_link "Crop Wrangling" end it "can't see wrangling page with js" do visit member_path(member) - expect(page).not_to have_link "Crop Wrangling" + expect(page).to have_no_link "Crop Wrangling" end end diff --git a/spec/features/crops/crop_wrangling_button_spec.rb b/spec/features/crops/crop_wrangling_button_spec.rb index cba397cdc..d96ca9cef 100644 --- a/spec/features/crops/crop_wrangling_button_spec.rb +++ b/spec/features/crops/crop_wrangling_button_spec.rb @@ -6,14 +6,14 @@ describe "crop wrangling button" do context 'not signed in' do before { visit crops_path } - it { expect(page).not_to have_link "Wrangle Crops", href: wrangle_crops_path } + it { expect(page).to have_no_link "Wrangle Crops", href: wrangle_crops_path } end context "signed in, but not a crop wrangler" do include_context 'signed in member' before { visit crops_path } - it { expect(page).not_to have_link "Wrangle Crops", href: wrangle_crops_path } + it { expect(page).to have_no_link "Wrangle Crops", href: wrangle_crops_path } end context "signed in crop wrangler" do diff --git a/spec/features/crops/scientific_name_spec.rb b/spec/features/crops/scientific_name_spec.rb index ac437bc05..b8f382d9f 100644 --- a/spec/features/crops/scientific_name_spec.rb +++ b/spec/features/crops/scientific_name_spec.rb @@ -49,7 +49,7 @@ describe "Scientific names", :js do end end # expect(page.status_code).to equal 200 - expect(page).not_to have_content zea_mays.name + expect(page).to have_no_content zea_mays.name expect(page).to have_content 'Scientific name was successfully deleted.' end diff --git a/spec/features/gardens/actions_spec.rb b/spec/features/gardens/actions_spec.rb index 3fb3462cd..19ec7cb6f 100644 --- a/spec/features/gardens/actions_spec.rb +++ b/spec/features/gardens/actions_spec.rb @@ -51,7 +51,7 @@ describe "Gardens" do include_examples "has buttons bar at top" describe 'does not show actions on other member garden' do - it { is_expected.not_to have_link 'Actions' } + it { is_expected.to have_no_link 'Actions' } end end end @@ -73,7 +73,7 @@ describe "Gardens" do describe "someone else's garden" do before { visit garden_path(other_member_garden) } - it { is_expected.not_to have_link 'Actions' } + it { is_expected.to have_no_link 'Actions' } end end end diff --git a/spec/features/gardens/adding_gardens_spec.rb b/spec/features/gardens/adding_gardens_spec.rb index f92a7e3d1..9dc30df01 100644 --- a/spec/features/gardens/adding_gardens_spec.rb +++ b/spec/features/gardens/adding_gardens_spec.rb @@ -33,7 +33,7 @@ describe "Gardens", :js do fill_in "Name", with: "Negative Garden" fill_in "Area", with: -5 click_button "Save" - expect(page).not_to have_content "Garden was successfully created" + expect(page).to have_no_content "Garden was successfully created" expect(page).to have_content "Area must be greater than or equal to 0" end end diff --git a/spec/features/gardens/gardens_spec.rb b/spec/features/gardens/gardens_spec.rb index cc9a8842f..eea33d67d 100644 --- a/spec/features/gardens/gardens_spec.rb +++ b/spec/features/gardens/gardens_spec.rb @@ -31,7 +31,7 @@ describe "Planting a crop", :js do click_link 'Actions' expect(page).to have_content "Mark as active" - expect(page).not_to have_content "Mark as inactive" + expect(page).to have_no_content "Mark as inactive" end it "List only active gardens" do @@ -41,7 +41,7 @@ describe "Planting a crop", :js do click_link "Mark as inactive" end visit gardens_path - expect(page).not_to have_link garden_path(garden) + expect(page).to have_no_link garden_path(garden) end it "Create new garden" do @@ -57,7 +57,7 @@ describe "Planting a crop", :js do fill_in "Name", with: "Negative Garden" fill_in "Area", with: -5 click_button "Save" - expect(page).not_to have_content "Garden was successfully created" + expect(page).to have_no_content "Garden was successfully created" expect(page).to have_content "Area must be greater than or equal to 0" end @@ -124,7 +124,7 @@ describe "Planting a crop", :js do it "List only active plantings on a garden" do visit gardens_path - expect(page).not_to have_content finished_planting.crop_name + expect(page).to have_no_content finished_planting.crop_name end end diff --git a/spec/features/gardens/index_spec.rb b/spec/features/gardens/index_spec.rb index 443fc3cce..1b7bfd502 100644 --- a/spec/features/gardens/index_spec.rb +++ b/spec/features/gardens/index_spec.rb @@ -40,7 +40,7 @@ describe "Gardens#index", :js do end it "does not show inactive garden" do - expect(page).not_to have_text inactive_garden.name + expect(page).to have_no_text inactive_garden.name end it "links to active garden" do @@ -48,7 +48,7 @@ describe "Gardens#index", :js do end it "does not link to inactive gardens" do - expect(page).not_to have_link(inactive_garden.name, href: garden_path(inactive_garden)) + expect(page).to have_no_link(inactive_garden.name, href: garden_path(inactive_garden)) end end @@ -72,7 +72,7 @@ describe "Gardens#index", :js do end it "does not show finished planting" do - expect(page).not_to have_text(finished_planting.crop.name) + expect(page).to have_no_text(finished_planting.crop.name) end end end @@ -113,7 +113,7 @@ describe "Gardens#index", :js do it { expect(page).to have_link href: planting_path(planting) } it { expect(page).to have_link href: garden_path(planting.garden) } it { expect(page).to have_text '7 weeks' } - it { expect(page).not_to have_text 'harvesting now' } + it { expect(page).to have_no_text 'harvesting now' } end describe 'harvesting now' do @@ -128,7 +128,7 @@ describe "Gardens#index", :js do it { expect(crop.median_lifespan).to eq 90 } it { expect(page).to have_text 'harvesting now' } - it { expect(page).not_to have_text 'Predicted weeks until harvest' } + it { expect(page).to have_no_text 'Predicted weeks until harvest' } end describe 'super late' do @@ -139,9 +139,9 @@ describe "Gardens#index", :js do end it { expect(page).to have_text 'super late' } - it { expect(page).not_to have_text 'harvesting now' } - it { expect(page).not_to have_text 'Predicted weeks until harvest' } - it { expect(page).not_to have_text 'Predicted weeks until planting is finished' } + it { expect(page).to have_no_text 'harvesting now' } + it { expect(page).to have_no_text 'Predicted weeks until harvest' } + it { expect(page).to have_no_text 'Predicted weeks until planting is finished' } end end end diff --git a/spec/features/harvests/browse_harvests_spec.rb b/spec/features/harvests/browse_harvests_spec.rb index 5c73e3020..7d748d870 100644 --- a/spec/features/harvests/browse_harvests_spec.rb +++ b/spec/features/harvests/browse_harvests_spec.rb @@ -19,7 +19,7 @@ describe "browse harvests", :search do end it 'read more' do - expect(subject).not_to have_link "Read more" + expect(subject).to have_no_link "Read more" end end diff --git a/spec/features/members/ban_spec.rb b/spec/features/members/ban_spec.rb index 1f2c7b25a..0aa040b59 100644 --- a/spec/features/members/ban_spec.rb +++ b/spec/features/members/ban_spec.rb @@ -18,7 +18,7 @@ describe "members list" do end it { expect(page).to have_link admin.login_name } - it { expect(page).not_to have_link spammer.login_name } + it { expect(page).to have_no_link spammer.login_name } end end end diff --git a/spec/features/members/deletion_spec.rb b/spec/features/members/deletion_spec.rb index 18e17401a..6a4b088d0 100644 --- a/spec/features/members/deletion_spec.rb +++ b/spec/features/members/deletion_spec.rb @@ -117,9 +117,9 @@ describe "member deletion" do it "removes members from following" do visit member_follows_path(other_member) - expect(page).not_to have_content member.login_name.to_s + expect(page).to have_no_content member.login_name.to_s visit member_followers_path(other_member) - expect(page).not_to have_content member.login_name.to_s + expect(page).to have_no_content member.login_name.to_s end it "replaces posts with deletion note" do @@ -131,7 +131,7 @@ describe "member deletion" do FactoryBot.create(:comment, post: othermemberpost, author: member, body: 'i am deleting my account') visit post_path(othermemberpost) - expect(page).not_to have_content member.login_name + expect(page).to have_no_content member.login_name expect(page).to have_content other_member.login_name expect(page).to have_content "Member Deleted" end @@ -166,7 +166,7 @@ describe "member deletion" do login_as(otherwrangler) visit edit_crop_path(crop) expect(page).to have_content member.login_name - expect(page).not_to have_content "cropbot" + expect(page).to have_no_content "cropbot" logout login_as(member) visit member_path(member) @@ -176,7 +176,7 @@ describe "member deletion" do click_button "Delete" login_as(otherwrangler) visit edit_crop_path(crop) - expect(page).not_to have_content member.login_name + expect(page).to have_no_content member.login_name end end end diff --git a/spec/features/members/following_spec.rb b/spec/features/members/following_spec.rb index ef5b179f8..60579bcb7 100644 --- a/spec/features/members/following_spec.rb +++ b/spec/features/members/following_spec.rb @@ -8,8 +8,8 @@ describe "follows", :js do it "follow buttons on member profile page" do visit member_path(member) - expect(page).not_to have_link "Follow" - expect(page).not_to have_link "Unfollow" + expect(page).to have_no_link "Follow" + expect(page).to have_no_link "Unfollow" end end @@ -19,8 +19,8 @@ describe "follows", :js do it "your profile doesn't have a follow button" do visit member_path(member) - expect(page).not_to have_link "Follow" - expect(page).not_to have_link "Unfollow" + expect(page).to have_no_link "Follow" + expect(page).to have_no_link "Unfollow" end context "following another member" do @@ -66,7 +66,7 @@ describe "follows", :js do click_link 'Follow' click_link 'Unfollow' visit member_follows_path(member) - expect(page).not_to have_content other_member.login_name + expect(page).to have_no_content other_member.login_name visit member_followers_path(other_member) expect(page).to have_content member.login_name end diff --git a/spec/features/members/profile_spec.rb b/spec/features/members/profile_spec.rb index 9e126f5e1..2da6340ac 100644 --- a/spec/features/members/profile_spec.rb +++ b/spec/features/members/profile_spec.rb @@ -32,9 +32,9 @@ describe "member profile", :js do it "member has not set location" do visit member_path(member) - expect(page).not_to have_css("h1>small") - expect(page).not_to have_css("#membermap") - expect(page).not_to have_content "See other members" + expect(page).to have_no_css("h1>small") + expect(page).to have_no_css("#membermap") + expect(page).to have_no_content "See other members" end end @@ -47,7 +47,7 @@ describe "member profile", :js do it "private email address" do visit member_path(member) - expect(page).not_to have_content member.email + expect(page).to have_no_content member.email end end @@ -55,10 +55,10 @@ describe "member profile", :js do it "with no activity" do visit member_path(member) expect(page).to have_content "Stats" - expect(page).not_to have_content "0 plantings" - expect(page).not_to have_content "0 harvests" - expect(page).not_to have_content "0 seeds" - expect(page).not_to have_content "0 posts" + expect(page).to have_no_content "0 plantings" + expect(page).to have_no_content "0 harvests" + expect(page).to have_no_content "0 seeds" + expect(page).to have_no_content "0 posts" end context "with some activity" do @@ -102,8 +102,8 @@ describe "member profile", :js do it "ordinary user's page" do visit member_path(other_member) - expect(page).not_to have_text "Crop Wrangler" - expect(page).not_to have_text "Admin" + expect(page).to have_no_text "Crop Wrangler" + expect(page).to have_no_text "Admin" end end end @@ -120,7 +120,7 @@ describe "member profile", :js do it { expect(page).to have_link href: planting_path(new_planting) } it { expect(page).to have_link href: planting_path(old_planting) } it { expect(page).to have_link href: planting_path(finished_planting) } - it { expect(page).not_to have_link href: planting_path(no_planted_at_planting) } + it { expect(page).to have_no_link href: planting_path(no_planted_at_planting) } end context 'member has activities' do @@ -257,7 +257,7 @@ describe "member profile", :js do expect(page).to have_link "Send message", href: new_message_path(recipient_id: other_member.id) end - it { expect(page).not_to have_link "Edit profile", href: edit_member_registration_path } + it { expect(page).to have_no_link "Edit profile", href: edit_member_registration_path } end end end diff --git a/spec/features/places/searching_a_place_spec.rb b/spec/features/places/searching_a_place_spec.rb index 16a059f1a..1896068cd 100644 --- a/spec/features/places/searching_a_place_spec.rb +++ b/spec/features/places/searching_a_place_spec.rb @@ -18,7 +18,7 @@ describe "User searches" do it { expect(page).to have_content "community near Philippines" } it { expect(page).to have_button "search_button" } it { expect(page).to have_content "Nearby members" } - it { expect(page).not_to have_content "No results found" } + it { expect(page).to have_no_content "No results found" } end it "with a blank search string" do diff --git a/spec/features/planting_reminder_spec.rb b/spec/features/planting_reminder_spec.rb index 7b2a5bec0..947c9ca66 100644 --- a/spec/features/planting_reminder_spec.rb +++ b/spec/features/planting_reminder_spec.rb @@ -23,7 +23,7 @@ describe "Planting reminder email", :js do end it "doesn't list plantings" do - expect(mail).not_to have_content "Progress report" + expect(mail).to have_no_content "Progress report" end end @@ -43,7 +43,7 @@ describe "Planting reminder email", :js do context "when member has no harvests" do it "doesn't list plantings" do - expect(mail).not_to have_content "Ready to harvest" + expect(mail).to have_no_content "Ready to harvest" end end diff --git a/spec/features/plantings/planting_a_crop_spec.rb b/spec/features/plantings/planting_a_crop_spec.rb index 2e17252cf..c563e6f54 100644 --- a/spec/features/plantings/planting_a_crop_spec.rb +++ b/spec/features/plantings/planting_a_crop_spec.rb @@ -102,8 +102,8 @@ describe "Planting a crop", :js, :search do end expect(page).to have_content "planting was successfully created" - expect(page).not_to have_content "Finished" - expect(page).not_to have_content "Finishes" + expect(page).to have_no_content "Finished" + expect(page).to have_no_content "Finishes" end it "shows that planting is in progress" do @@ -122,9 +122,9 @@ describe "Planting a crop", :js, :search do end expect(page).to have_content "planting was successfully created" - expect(page).not_to have_content "0%" - expect(page).not_to have_content "Finish expected" - expect(page).not_to have_content "Finishes" + expect(page).to have_no_content "0%" + expect(page).to have_no_content "Finish expected" + expect(page).to have_no_content "Finishes" end it "shows that planting is 100% complete (no date specified)" do @@ -184,7 +184,7 @@ describe "Planting a crop", :js, :search do it "Editing a planting to fill in the finished date" do visit planting_path(planting) - expect(page).not_to have_content "Finishes" + expect(page).to have_no_content "Finishes" # click_link(id: 'planting-actions-button') click_link 'Actions' click_link "Edit" @@ -230,7 +230,7 @@ describe "Planting a crop", :js, :search do # shouldn't be on the page visit plantings_path - expect(page).not_to have_content "maize" + expect(page).to have_no_content "maize" # show all plantings to see this finished planting visit plantings_path(all: 1) diff --git a/spec/features/plantings/show_spec.rb b/spec/features/plantings/show_spec.rb index 8731d218b..e9c69c786 100644 --- a/spec/features/plantings/show_spec.rb +++ b/spec/features/plantings/show_spec.rb @@ -22,7 +22,7 @@ describe "Display a planting", :js do context 'Annual no predictions' do let(:planting) { FactoryBot.create(:annual_planting) } - it { expect(page).not_to have_text 'Finish expected' } + it { expect(page).to have_no_text 'Finish expected' } end context 'Annual with predicted finish' do diff --git a/spec/features/shared_examples/crop_suggest.rb b/spec/features/shared_examples/crop_suggest.rb index 702d9cc65..17012c6a2 100644 --- a/spec/features/shared_examples/crop_suggest.rb +++ b/spec/features/shared_examples/crop_suggest.rb @@ -17,8 +17,8 @@ shared_examples "crop suggest" do |resource| fill_autocomplete "crop", with: "pe" end - expect(page).not_to have_content("pear") - expect(page).not_to have_content("pea") + expect(page).to have_no_content("pear") + expect(page).to have_no_content("pea") within "form#new_#{resource}" do fill_autocomplete "crop", with: "pea" diff --git a/spec/features/timeline/index_spec.rb b/spec/features/timeline/index_spec.rb index b7db4d4d5..3135bf65a 100644 --- a/spec/features/timeline/index_spec.rb +++ b/spec/features/timeline/index_spec.rb @@ -27,7 +27,7 @@ describe "timeline", :js do it { expect(page).to have_link href: planting_path(friend_planting) } it { expect(page).to have_link href: planting_path(friend_harvest) } it { expect(page).to have_link href: planting_path(finished_planting) } - it { expect(page).not_to have_link href: planting_path(no_planted_at_planting) } + it { expect(page).to have_no_link href: planting_path(no_planted_at_planting) } end describe 'shows the friends you follow' do diff --git a/spec/views/crops/show.html.haml_spec.rb b/spec/views/crops/show.html.haml_spec.rb index 39240e528..f65f0621e 100644 --- a/spec/views/crops/show.html.haml_spec.rb +++ b/spec/views/crops/show.html.haml_spec.rb @@ -16,7 +16,7 @@ describe "crops/show" do it "hides sunniness block if no sunniness" do render - expect(rendered).not_to have_content "Sunniness" + expect(rendered).to have_no_content "Sunniness" end it "has sunniness block if sunny planting" do @@ -27,7 +27,7 @@ describe "crops/show" do it "hides planted from block if no planted_from" do render - expect(rendered).not_to have_content "Planted from" + expect(rendered).to have_no_content "Planted from" end it "has planted from block if seed planting" do @@ -38,7 +38,7 @@ describe "crops/show" do it "hides harvested block if no harvests" do render - expect(rendered).not_to have_content "Harvested for" + expect(rendered).to have_no_content "Harvested for" end it "has harvested block if harvest" do diff --git a/spec/views/plantings/show.html.haml_spec.rb b/spec/views/plantings/show.html.haml_spec.rb index fb1228f64..293f90de2 100644 --- a/spec/views/plantings/show.html.haml_spec.rb +++ b/spec/views/plantings/show.html.haml_spec.rb @@ -46,7 +46,7 @@ describe "plantings/show" do render end - it { expect(rendered).not_to have_content 'Planted from' } + it { expect(rendered).to have_no_content 'Planted from' } end end @@ -82,7 +82,7 @@ describe "plantings/show" do end it "doesn't contain a () if no location is set" do - expect(rendered).not_to have_content "()" + expect(rendered).to have_no_content "()" end end diff --git a/spec/views/posts/new.html.haml_spec.rb b/spec/views/posts/new.html.haml_spec.rb index 663cf5ead..824bd44d3 100644 --- a/spec/views/posts/new.html.haml_spec.rb +++ b/spec/views/posts/new.html.haml_spec.rb @@ -25,7 +25,7 @@ describe "posts/new" do end it 'no forum mentioned' do - expect(rendered).not_to have_content "This post will be posted in the forum" + expect(rendered).to have_no_content "This post will be posted in the forum" end it "asks what's going on in your garden" do diff --git a/spec/views/posts/show.html.haml_spec.rb b/spec/views/posts/show.html.haml_spec.rb index 5bfc31eff..d11189799 100644 --- a/spec/views/posts/show.html.haml_spec.rb +++ b/spec/views/posts/show.html.haml_spec.rb @@ -24,7 +24,7 @@ describe "posts/show" do it { is_expected.to have_text('hello there') } # shouldn't show the subject on a single post page # (it appears in the title/h1 via the layout, not via this view) - it { is_expected.not_to have_text('An Update') } + it { is_expected.to have_no_text('An Update') } end describe "should parse markdown into html" do @@ -37,19 +37,19 @@ describe "posts/show" do let(:post) { FactoryBot.create(:post, author:, body: 'EVIL') } it { is_expected.to have_content('EVIL') } - it { is_expected.not_to have_link("http://evil.com") } + it { is_expected.to have_no_link("http://evil.com") } end describe 'script tag in post body' do let(:post) { FactoryBot.create(:post, author:, body: "") } - it { is_expected.not_to have_selector('script') } + it { is_expected.to have_no_selector('script') } end describe 'script tag in post title' do let(:post) { FactoryBot.create(:post, author:, subject: "") } - it { is_expected.not_to have_selector('script') } + it { is_expected.to have_no_selector('script') } end describe 'has an anchor to the comments' do diff --git a/spec/views/seeds/index.rss.haml_spec.rb b/spec/views/seeds/index.rss.haml_spec.rb index a641d4f02..e68c2c62b 100644 --- a/spec/views/seeds/index.rss.haml_spec.rb +++ b/spec/views/seeds/index.rss.haml_spec.rb @@ -42,7 +42,7 @@ describe 'seeds/index.rss.haml', :search do end it "does not offer untradable seed as tradeable" do - expect(rendered).not_to have_content "Will trade #{seed.tradable_to} from #{seed.owner.location}" + expect(rendered).to have_no_content "Will trade #{seed.tradable_to} from #{seed.owner.location}" end end From 81060cccf7552af7a48915588c545e21b8438736 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 13 Jul 2024 15:38:37 +0930 Subject: [PATCH 009/203] Ruby 3.2: Rubocop - Lint/* and Style/* (#3786) * Rubocop - Layout/* * Rubocop - Lint and Style --- .rubocop_todo.yml | 91 +------------------ app/controllers/activities_controller.rb | 6 +- app/controllers/application_controller.rb | 4 +- app/controllers/members_controller.rb | 2 +- app/controllers/messages_controller.rb | 2 +- .../omniauth_callbacks_controller.rb | 2 +- app/helpers/crops_helper.rb | 6 +- app/mailers/notifier_mailer.rb | 6 +- app/models/concerns/member_flickr.rb | 4 +- app/models/csv_importer.rb | 2 +- app/models/follow.rb | 2 +- app/models/seed.rb | 2 +- bin/setup | 8 +- config.ru | 2 +- config/application.rb | 4 +- config/environments/production.rb | 16 ++-- config/initializers/devise.rb | 4 +- config/initializers/omniauth.rb | 4 +- db/migrate/20191119030244_cms_tags.rb | 6 +- db/seeds.rb | 2 +- lib/haml/filters/escaped_markdown.rb | 2 +- lib/tasks/growstuff.rake | 6 +- script/check_contributors_md.rb | 4 +- script/heroku_maintenance.rb | 4 +- spec/controllers/crops_controller_spec.rb | 4 +- spec/features/home/home_spec.rb | 2 +- spec/features/rss/comments_spec.rb | 2 +- spec/features/rss/crops_spec.rb | 2 +- spec/features/rss/members_spec.rb | 2 +- spec/features/rss/plantings_spec.rb | 2 +- spec/features/rss/posts_spec.rb | 2 +- spec/features/rss/seeds_spec.rb | 2 +- spec/features/seeds/adding_seeds_spec.rb | 2 +- spec/features/shared_examples/crop_suggest.rb | 4 +- spec/helpers/gardens_helper_spec.rb | 2 +- spec/helpers/seeds_helper_spec.rb | 2 +- spec/requests/api/v1/gardens_request_spec.rb | 4 +- .../requests/api/v1/plantings_request_spec.rb | 4 +- 38 files changed, 66 insertions(+), 161 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 1b0d00f49..336d1041b 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -90,14 +90,6 @@ Layout/LineLength: - 'app/helpers/crops_helper.rb' - 'db/seeds.rb' -# Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). -Lint/AmbiguousOperatorPrecedence: - Exclude: - - 'db/seeds.rb' - - 'spec/helpers/gardens_helper_spec.rb' - - 'spec/helpers/seeds_helper_spec.rb' - # Offense count: 3 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: RequireParenthesesForMethodChains. @@ -613,14 +605,6 @@ Style/ClassAndModuleChildren: - 'lib/haml/filters/escaped_markdown.rb' - 'lib/haml/filters/growstuff_markdown.rb' -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: Keywords, RequireColon. -# Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE -Style/CommentAnnotation: - Exclude: - - 'spec/features/seeds/adding_seeds_spec.rb' - # Offense count: 6 # This cop supports unsafe autocorrection (--autocorrect-all). Style/CommentedKeyword: @@ -630,12 +614,6 @@ Style/CommentedKeyword: - 'spec/models/photo_spec.rb' - 'spec/models/planting_spec.rb' -# Offense count: 37 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowedVars. -Style/FetchEnvVar: - Enabled: false - # Offense count: 3 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. @@ -654,33 +632,6 @@ Style/GlobalStdStream: - 'lib/tasks/gbif.rake' - 'lib/tasks/openfarm.rake' -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals. -Style/GuardClause: - Exclude: - - 'app/controllers/activities_controller.rb' - -# Offense count: 5 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. -# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys -# SupportedShorthandSyntax: always, never, either, consistent, either_consistent -Style/HashSyntax: - Exclude: - - 'app/models/csv_importer.rb' - - 'spec/requests/api/v1/gardens_request_spec.rb' - - 'spec/requests/api/v1/plantings_request_spec.rb' - -# Offense count: 5 -# This cop supports safe autocorrection (--autocorrect). -Style/IfUnlessModifier: - Exclude: - - 'app/controllers/activities_controller.rb' - - 'app/controllers/application_controller.rb' - - 'bin/setup' - - 'spec/features/shared_examples/crop_suggest.rb' - # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AllowedMethods. @@ -709,18 +660,13 @@ Style/MutableConstant: Exclude: - 'app/models/activity.rb' -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Style/NegatedIfElseCondition: - Exclude: - - 'app/helpers/crops_helper.rb' - -# Offense count: 4 +# Offense count: 5 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns. # SupportedStyles: predicate, comparison Style/NumericPredicate: Exclude: + - 'app/helpers/crops_helper.rb' - 'app/helpers/harvests_helper.rb' - 'app/helpers/plantings_helper.rb' - 'app/models/concerns/predict_planting.rb' @@ -737,13 +683,6 @@ Style/OptionalBooleanParameter: Exclude: - 'app/models/concerns/member_newsletter.rb' -# Offense count: 5 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: . -# SupportedStyles: same_as_string_literals, single_quotes, double_quotes -Style/QuotedSymbols: - EnforcedStyle: double_quotes - # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Methods. @@ -751,12 +690,6 @@ Style/RedundantArgument: Exclude: - 'app/helpers/application_helper.rb' -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Style/RedundantConstantBase: - Exclude: - - 'config.ru' - # Offense count: 4 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: SafeForConstants. @@ -764,19 +697,6 @@ Style/RedundantFetchBlock: Exclude: - 'config/puma.rb' -# Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). -Style/RedundantRegexpArgument: - Exclude: - - 'db/migrate/20191119030244_cms_tags.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowMultipleReturnValues. -Style/RedundantReturn: - Exclude: - - 'app/controllers/messages_controller.rb' - # Offense count: 2 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowModifier. @@ -796,13 +716,6 @@ Style/StringConcatenation: - 'spec/helpers/gardens_helper_spec.rb' - 'spec/helpers/seeds_helper_spec.rb' -# Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). -Style/SuperArguments: - Exclude: - - 'app/controllers/omniauth_callbacks_controller.rb' - - 'lib/haml/filters/escaped_markdown.rb' - # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments. diff --git a/app/controllers/activities_controller.rb b/app/controllers/activities_controller.rb index f4e236e3a..e7e95d1d7 100644 --- a/app/controllers/activities_controller.rb +++ b/app/controllers/activities_controller.rb @@ -81,8 +81,8 @@ class ActivitiesController < DataController end def specifics - if @owner.present? - "#{@owner.to_param}-" - end + return unless @owner.present? + + "#{@owner.to_param}-" end end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 43bf8f694..7db3be745 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -3,9 +3,7 @@ class ApplicationController < ActionController::Base protect_from_forgery # Working from codespaces, we want to turn off validation - if Rails.env.development? && ENV['CODESPACE_NAME'] - skip_before_action :verify_authenticity_token - end + skip_before_action :verify_authenticity_token if Rails.env.development? && ENV['CODESPACE_NAME'] include ApplicationHelper diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index 1211e870e..2099ffd46 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -61,7 +61,7 @@ class MembersController < ApplicationController end def unsubscribe - verifier = ActiveSupport::MessageVerifier.new(ENV['RAILS_SECRET_TOKEN']) + verifier = ActiveSupport::MessageVerifier.new(ENV.fetch('RAILS_SECRET_TOKEN', nil)) decrypted_message = verifier.verify(params[:message]) @member = Member.find(decrypted_message[:member_id]) diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 9efc7ae42..bd34e3ce1 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -21,7 +21,7 @@ class MessagesController < ApplicationController return if params[:recipient_id].blank? @recipient = Member.find_by(id: params[:recipient_id]) - return if @recipient.nil? + nil if @recipient.nil? end def create diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index e19114b88..e8e54befb 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -41,7 +41,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController def after_sign_in_path_for(resource) if resource.tos_agreement - super(resource) + super else finish_signup_path(resource) end diff --git a/app/helpers/crops_helper.rb b/app/helpers/crops_helper.rb index 39d6ba52c..451aafd5b 100644 --- a/app/helpers/crops_helper.rb +++ b/app/helpers/crops_helper.rb @@ -7,10 +7,10 @@ module CropsHelper return "You don't have any seeds of this crop." if seeds.none? - if total_quantity != 0 - "You have #{total_quantity} #{Seed.model_name.human(count: total_quantity)} of this crop." - else + if total_quantity == 0 "You have an unknown quantity of seeds of this crop." + else + "You have #{total_quantity} #{Seed.model_name.human(count: total_quantity)} of this crop." end end diff --git a/app/mailers/notifier_mailer.rb b/app/mailers/notifier_mailer.rb index 86ac948a5..4a85ea0f4 100644 --- a/app/mailers/notifier_mailer.rb +++ b/app/mailers/notifier_mailer.rb @@ -2,7 +2,7 @@ class NotifierMailer < ApplicationMailer # include NotificationsHelper - default from: "Growstuff <#{ENV['GROWSTUFF_EMAIL']}>" + default from: "Growstuff <#{ENV.fetch('GROWSTUFF_EMAIL', nil)}>" def verifier unless ENV['RAILS_SECRET_TOKEN'] @@ -10,7 +10,7 @@ class NotifierMailer < ApplicationMailer "not set - have you created config/application.yml?" end - ActiveSupport::MessageVerifier.new(ENV['RAILS_SECRET_TOKEN']) + ActiveSupport::MessageVerifier.new(ENV.fetch('RAILS_SECRET_TOKEN', nil)) end def notify(notification) @@ -27,7 +27,7 @@ class NotifierMailer < ApplicationMailer def planting_reminder(member) @member = member - @sitename = ENV['GROWSTUFF_SITE_NAME'] + @sitename = ENV.fetch('GROWSTUFF_SITE_NAME', nil) @late = [] @super_late = [] diff --git a/app/models/concerns/member_flickr.rb b/app/models/concerns/member_flickr.rb index 193e36ca4..fb13a94e9 100644 --- a/app/models/concerns/member_flickr.rb +++ b/app/models/concerns/member_flickr.rb @@ -9,8 +9,8 @@ module MemberFlickr if @flickr.nil? flickr_auth = auth('flickr') if flickr_auth - FlickRaw.api_key = ENV['GROWSTUFF_FLICKR_KEY'] - FlickRaw.shared_secret = ENV['GROWSTUFF_FLICKR_SECRET'] + FlickRaw.api_key = ENV.fetch('GROWSTUFF_FLICKR_KEY', nil) + FlickRaw.shared_secret = ENV.fetch('GROWSTUFF_FLICKR_SECRET', nil) @flickr = FlickRaw::Flickr.new @flickr.access_token = flickr_auth.token @flickr.access_secret = flickr_auth.secret diff --git a/app/models/csv_importer.rb b/app/models/csv_importer.rb index 6758b4a71..5331b5528 100644 --- a/app/models/csv_importer.rb +++ b/app/models/csv_importer.rb @@ -59,7 +59,7 @@ class CsvImporter alternate_names.split(/,\s*/).each do |name| altname = AlternateName.find_by(name:, crop: @crop) - altname ||= AlternateName.create! name: name, crop: @crop, creator: cropbot + altname ||= AlternateName.create! name:, crop: @crop, creator: cropbot @crop.alternate_names << altname end end diff --git a/app/models/follow.rb b/app/models/follow.rb index 1c7f56be1..aafe8ed3f 100644 --- a/app/models/follow.rb +++ b/app/models/follow.rb @@ -10,7 +10,7 @@ class Follow < ApplicationRecord recipient_id: followed_id, sender_id: follower_id, subject: "#{follower.login_name} is now following you", - body: "#{follower.login_name} just followed you on #{ENV['GROWSTUFF_SITE_NAME']}. " + body: "#{follower.login_name} just followed you on #{ENV.fetch('GROWSTUFF_SITE_NAME', nil)}. " ) end end diff --git a/app/models/seed.rb b/app/models/seed.rb index 9e1ce7527..3a8317435 100644 --- a/app/models/seed.rb +++ b/app/models/seed.rb @@ -56,7 +56,7 @@ class Seed < ApplicationRecord default_scope { joins(:owner).merge(Member.kept) } # Ensure owner exists scope :tradable, -> { where.not(tradable_to: 'nowhere') } scope :interesting, -> { tradable.has_location } - scope :has_location, -> { joins(:owner).where.not("members.location": nil) } + scope :has_location, -> { joins(:owner).where.not('members.location': nil) } scope :recent, -> { order(created_at: :desc) } scope :active, -> { where('finished <> true').where('finished_at IS NULL OR finished_at < ?', Time.zone.now) } diff --git a/bin/setup b/bin/setup index a593c68ec..9bc63d22a 100755 --- a/bin/setup +++ b/bin/setup @@ -23,12 +23,8 @@ FileUtils.chdir APP_ROOT do system('bin/yarn') puts "\n== Copying sample files ==" - unless File.exist?('config/database.yml') - FileUtils.cp 'config/database.yml.example', 'config/database.yml' - end - unless File.exist?('.env') - FileUtils.cp 'env-example', '.env' - end + FileUtils.cp 'config/database.yml.example', 'config/database.yml' unless File.exist?('config/database.yml') + FileUtils.cp 'env-example', '.env' unless File.exist?('.env') puts "\n== Checking for elastic search ==" system! 'script/check_elasticsearch.sh' diff --git a/config.ru b/config.ru index 667e328d5..afd13e211 100644 --- a/config.ru +++ b/config.ru @@ -2,5 +2,5 @@ # This file is used by Rack-based servers to start the application. -require ::File.expand_path('config/environment', __dir__) +require File.expand_path('config/environment', __dir__) run Rails.application diff --git a/config/application.rb b/config/application.rb index 208026060..ff16123ee 100644 --- a/config/application.rb +++ b/config/application.rb @@ -62,7 +62,7 @@ module Growstuff # Growstuff-specific configuration variables config.currency = 'AUD' - config.bot_email = ENV['GROWSTUFF_EMAIL'] + config.bot_email = ENV.fetch('GROWSTUFF_EMAIL', nil) config.user_agent = 'Growstuff' config.user_agent_email = "info@growstuff.org" @@ -70,7 +70,7 @@ module Growstuff # API key can't be blank or tests fail Gibbon::API.timeout = 10 Gibbon::API.throws_exceptions = false - config.newsletter_list_id = ENV['GROWSTUFF_MAILCHIMP_NEWSLETTER_ID'] + config.newsletter_list_id = ENV.fetch('GROWSTUFF_MAILCHIMP_NEWSLETTER_ID', nil) # config.active_record.raise_in_transactional_callbacks = true config.middleware.insert_before 0, Rack::Cors do diff --git a/config/environments/production.rb b/config/environments/production.rb index d846e020c..4cf5e164a 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -59,8 +59,8 @@ Rails.application.configure do # Use a different cache store in production. config.cache_store = :mem_cache_store, (ENV["MEMCACHIER_SERVERS"] || "").split(","), - { username: ENV["MEMCACHIER_USERNAME"], - password: ENV["MEMCACHIER_PASSWORD"], + { username: ENV.fetch("MEMCACHIER_USERNAME", nil), + password: ENV.fetch("MEMCACHIER_PASSWORD", nil), failover: true, socket_timeout: 1.5, socket_failure_delay: 0.2, @@ -89,20 +89,20 @@ Rails.application.configure do config.active_record.dump_schema_after_migration = false # Growstuff configuration - config.action_mailer.default_url_options = { host: ENV['HOST'] } + config.action_mailer.default_url_options = { host: ENV.fetch('HOST', nil) } config.action_mailer.smtp_settings = { - user_name: ENV['MAILGUN_SMTP_LOGIN'], - password: ENV['MAILGUN_SMTP_PASSWORD'], - domain: ENV['GROWSTUFF_EMAIL_DOMAIN'], - address: ENV['MAILGUN_SMTP_SERVER'], + user_name: ENV.fetch('MAILGUN_SMTP_LOGIN', nil), + password: ENV.fetch('MAILGUN_SMTP_PASSWORD', nil), + domain: ENV.fetch('GROWSTUFF_EMAIL_DOMAIN', nil), + address: ENV.fetch('MAILGUN_SMTP_SERVER', nil), port: 587, authentication: :plain, enable_starttls_auto: true } ActionMailer::Base.delivery_method = :smtp - config.host = ENV['HOST'] + config.host = ENV.fetch('HOST', nil) config.analytics_code = <<-GET_CLICKY_SCRIPT diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 4990573d1..18c21d5f9 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -6,9 +6,9 @@ Devise.setup do |config| # ==> Mailer Configuration # Configure the e-mail address which will be shown in Devise::Mailer, # note that it will be overwritten if you use your own mailer class with default "from" parameter. - config.mailer_sender = "Growstuff <#{ENV['GROWSTUFF_EMAIL']}>" + config.mailer_sender = "Growstuff <#{ENV.fetch('GROWSTUFF_EMAIL', nil)}>" - config.secret_key = ENV['RAILS_SECRET_TOKEN'] + config.secret_key = ENV.fetch('RAILS_SECRET_TOKEN', nil) # Configure the class responsible to send e-mails. # config.mailer = "Devise::Mailer" diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index 985ed96c6..56af5eafb 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true Rails.application.config.middleware.use OmniAuth::Builder do - provider :twitter, ENV['GROWSTUFF_TWITTER_KEY'], ENV['GROWSTUFF_TWITTER_SECRET'] - provider :flickr, ENV['GROWSTUFF_FLICKR_KEY'], ENV['GROWSTUFF_FLICKR_SECRET'], scope: 'read' + provider :twitter, ENV.fetch('GROWSTUFF_TWITTER_KEY', nil), ENV.fetch('GROWSTUFF_TWITTER_SECRET', nil) + provider :flickr, ENV.fetch('GROWSTUFF_FLICKR_KEY', nil), ENV.fetch('GROWSTUFF_FLICKR_SECRET', nil), scope: 'read' end diff --git a/db/migrate/20191119030244_cms_tags.rb b/db/migrate/20191119030244_cms_tags.rb index 87dd06933..103d81777 100644 --- a/db/migrate/20191119030244_cms_tags.rb +++ b/db/migrate/20191119030244_cms_tags.rb @@ -28,10 +28,10 @@ class CmsTags < ActiveRecord::Migration[5.2] layout.content = layout.content.gsub(%r{\{\{ ?cms:(\w+):([\w/-]+):([\w/-]+):([\w/-]+) ?\}\}}, '{{ cms:\1 \2 \3 \4}}') end layout.content = layout.content.gsub(/\{\{ ?cms:(\w+):(\w+):([^:]*) ?}}/, '{{ cms:\1 \2, "\3" }}') if layout.content.is_a? String - layout.content = layout.content.gsub(/cms:rich_text/, 'cms:wysiwyg') if layout.content.is_a? String - layout.content = layout.content.gsub(/cms:integer/, 'cms:number') if layout.content.is_a? String + layout.content = layout.content.gsub("cms:rich_text", 'cms:wysiwyg') if layout.content.is_a? String + layout.content = layout.content.gsub("cms:integer", 'cms:number') if layout.content.is_a? String if layout.content.is_a? String - layout.content = layout.content.gsub(/cms: string/, 'cms:text') + layout.content = layout.content.gsub("cms: string", 'cms:text') end # probably a result of goofing one of the more general regexps if layout.content.is_a? String layout.content = layout.content.gsub(%r{\{\{ ?cms:page_file ([\w/]+) ?\}\}}, '{{ cms:file \1, render: false }}') diff --git a/db/seeds.rb b/db/seeds.rb index 3c34783f9..62ea7b4ba 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -86,7 +86,7 @@ def load_test_users owner_id: @user.id, garden_id: @user.gardens.first.id, planted_at: (n * 7).days.ago, - crop_id: Crop.find((i + n) % Crop.all.size + 1).id, + crop_id: Crop.find(((i + n) % Crop.all.size) + 1).id, sunniness: select_random_item(Planting::SUNNINESS_VALUES), planted_from: select_random_item(Planting::PLANTED_FROM_VALUES) ) diff --git a/lib/haml/filters/escaped_markdown.rb b/lib/haml/filters/escaped_markdown.rb index 527fca544..09468bcfb 100644 --- a/lib/haml/filters/escaped_markdown.rb +++ b/lib/haml/filters/escaped_markdown.rb @@ -6,7 +6,7 @@ require 'haml/filters/growstuff_markdown' class Haml::Filters class EscapedMarkdown < Haml::Filters::Markdown def compile(node) - [:escape, true, super(node)] + [:escape, true, super] end end diff --git a/lib/tasks/growstuff.rake b/lib/tasks/growstuff.rake index 70fd11898..ae4097b45 100644 --- a/lib/tasks/growstuff.rake +++ b/lib/tasks/growstuff.rake @@ -5,14 +5,14 @@ namespace :growstuff do # usage: rake growstuff:admin_user name=skud task admin_user: :environment do - add_role_to_member! ENV['name'], 'Admin' + add_role_to_member! ENV.fetch('name', nil), 'Admin' end desc "Add a crop wrangler user, by name" # usage: rake growstuff:cropwrangler_user name=skud task cropwrangler_user: :environment do - add_role_to_member! ENV['name'], 'Crop Wrangler' + add_role_to_member! ENV.fetch('name', nil), 'Crop Wrangler' end def add_role_to_member!(login_name, role_name) @@ -31,7 +31,7 @@ namespace :growstuff do task import_crops: :environment do require 'csv' - (@file = ENV['file']) || raise("Usage: rake growstuff:import_crops file=file.csv") + (@file = ENV.fetch('file', nil)) || raise("Usage: rake growstuff:import_crops file=file.csv") puts "Loading crops from #{@file}..." CSV.foreach(@file) do |row| diff --git a/script/check_contributors_md.rb b/script/check_contributors_md.rb index 317c73fe6..f5660da5c 100755 --- a/script/check_contributors_md.rb +++ b/script/check_contributors_md.rb @@ -5,12 +5,12 @@ require "English" if ENV['CI'] if ENV['GITHUB_EVENT_NAME'] == 'pull_request' - author = ENV['GITHUB_ACTOR'] + author = ENV.fetch('GITHUB_ACTOR', nil) exit 1 unless author elsif ENV['TRAVIS_PULL_REQUEST'] require 'httparty' - repo = ENV['TRAVIS_REPO_SLUG'] + repo = ENV.fetch('TRAVIS_REPO_SLUG', nil) pr = ENV['TRAVIS_PULL_REQUEST'] url = "https://api.github.com/repos/#{repo}/pulls/#{pr}" response = HTTParty.get(url).parsed_response diff --git a/script/heroku_maintenance.rb b/script/heroku_maintenance.rb index 1c285a288..14b8fe496 100755 --- a/script/heroku_maintenance.rb +++ b/script/heroku_maintenance.rb @@ -4,8 +4,8 @@ require 'platform-api' require 'yaml' -heroku = PlatformAPI.connect(ENV['HEROKU_API_KEY']) -branch = ENV['TRAVIS_BRANCH'] +heroku = PlatformAPI.connect(ENV.fetch('HEROKU_API_KEY', nil)) +branch = ENV.fetch('TRAVIS_BRANCH', nil) travis_config = YAML.load_file('.travis.yml') if travis_config['deploy']['app'].key? branch app = travis_config['deploy']['app'][branch] diff --git a/spec/controllers/crops_controller_spec.rb b/spec/controllers/crops_controller_spec.rb index 718da23bb..2dec49ae7 100644 --- a/spec/controllers/crops_controller_spec.rb +++ b/spec/controllers/crops_controller_spec.rb @@ -82,8 +82,8 @@ describe CropsController do name: 'aubergine', en_wikipedia_url: "https://en.wikipedia.org/wiki/Eggplant" }, - alt_name: { "1": "egg plant", "2": "purple apple" }, - sci_name: { "1": "fancy sci name", "2": "" } + alt_name: { '1': "egg plant", '2': "purple apple" }, + sci_name: { '1': "fancy sci name", '2': "" } } end diff --git a/spec/features/home/home_spec.rb b/spec/features/home/home_spec.rb index f6e6a9d46..b73d247dd 100644 --- a/spec/features/home/home_spec.rb +++ b/spec/features/home/home_spec.rb @@ -104,7 +104,7 @@ describe "home page", :search do describe 'should say welcome' do before { visit root_path } - it { expect(page).to have_content "Welcome to #{ENV['GROWSTUFF_SITE_NAME']}, #{member.login_name}" } + it { expect(page).to have_content "Welcome to #{ENV.fetch('GROWSTUFF_SITE_NAME', nil)}, #{member.login_name}" } end end end diff --git a/spec/features/rss/comments_spec.rb b/spec/features/rss/comments_spec.rb index 5b6783300..3268fd106 100644 --- a/spec/features/rss/comments_spec.rb +++ b/spec/features/rss/comments_spec.rb @@ -10,6 +10,6 @@ describe 'Comments RSS feed' do it 'The index title is what we expect' do visit comments_path(format: 'rss') - expect(page).to have_content "Recent comments on all posts (#{ENV['GROWSTUFF_SITE_NAME']})" + expect(page).to have_content "Recent comments on all posts (#{ENV.fetch('GROWSTUFF_SITE_NAME', nil)})" end end diff --git a/spec/features/rss/crops_spec.rb b/spec/features/rss/crops_spec.rb index 7e26d30e9..c0b81a36a 100644 --- a/spec/features/rss/crops_spec.rb +++ b/spec/features/rss/crops_spec.rb @@ -12,6 +12,6 @@ describe 'Crops RSS feed' do it 'The index title is what we expect' do Crop.reindex visit crops_path(format: 'rss') - expect(page).to have_content "Recently added crops (#{ENV['GROWSTUFF_SITE_NAME']})" + expect(page).to have_content "Recently added crops (#{ENV.fetch('GROWSTUFF_SITE_NAME', nil)})" end end diff --git a/spec/features/rss/members_spec.rb b/spec/features/rss/members_spec.rb index d5e2546f7..0069b97ed 100644 --- a/spec/features/rss/members_spec.rb +++ b/spec/features/rss/members_spec.rb @@ -8,6 +8,6 @@ describe 'Members RSS feed' do before { visit member_path(member, format: 'rss') } it 'The show action title is what we expect' do - expect(page).to have_content "#{member.login_name}'s recent posts (#{ENV['GROWSTUFF_SITE_NAME']})" + expect(page).to have_content "#{member.login_name}'s recent posts (#{ENV.fetch('GROWSTUFF_SITE_NAME', nil)})" end end diff --git a/spec/features/rss/plantings_spec.rb b/spec/features/rss/plantings_spec.rb index 69b46a075..06f19fb6d 100644 --- a/spec/features/rss/plantings_spec.rb +++ b/spec/features/rss/plantings_spec.rb @@ -12,6 +12,6 @@ describe 'Plantings RSS feed' do Planting.reindex visit plantings_path(format: 'rss') expect(page).to have_content "Recent plantings from " \ - "#{@owner || 'all members'} (#{ENV['GROWSTUFF_SITE_NAME']})" + "#{@owner || 'all members'} (#{ENV.fetch('GROWSTUFF_SITE_NAME', nil)})" end end diff --git a/spec/features/rss/posts_spec.rb b/spec/features/rss/posts_spec.rb index d2b27cb8c..eb89db819 100644 --- a/spec/features/rss/posts_spec.rb +++ b/spec/features/rss/posts_spec.rb @@ -11,6 +11,6 @@ describe 'Posts RSS feed' do it 'The index title is what we expect' do visit posts_path(format: 'rss') expect(page).to have_content "Recent posts from " \ - "#{@author || 'all members'} (#{ENV['GROWSTUFF_SITE_NAME']})" + "#{@author || 'all members'} (#{ENV.fetch('GROWSTUFF_SITE_NAME', nil)})" end end diff --git a/spec/features/rss/seeds_spec.rb b/spec/features/rss/seeds_spec.rb index 35c4a5498..44966c17c 100644 --- a/spec/features/rss/seeds_spec.rb +++ b/spec/features/rss/seeds_spec.rb @@ -11,6 +11,6 @@ describe 'Seeds RSS feed' do it 'The index title is what we expect' do visit seeds_path(format: 'rss') expect(page).to have_content "Recent seeds from " \ - "#{@owner || 'all members'} (#{ENV['GROWSTUFF_SITE_NAME']})" + "#{@owner || 'all members'} (#{ENV.fetch('GROWSTUFF_SITE_NAME', nil)})" end end diff --git a/spec/features/seeds/adding_seeds_spec.rb b/spec/features/seeds/adding_seeds_spec.rb index 7dc8967d2..7f072aace 100644 --- a/spec/features/seeds/adding_seeds_spec.rb +++ b/spec/features/seeds/adding_seeds_spec.rb @@ -17,7 +17,7 @@ describe "Seeds", :js, :search do end describe "displays required and optional fields properly" do - # Note: The required behaviour is pushed down to the control itself, not the form-group as of rails 7.1. + # NOTE: The required behaviour is pushed down to the control itself, not the form-group as of rails 7.1. # Modern browsers enforce the required behaviour better than us doing it ourselves. it { expect(page).to have_selector "label", text: "Crop" } it { expect(page).to have_selector 'input#seed_quantity' } diff --git a/spec/features/shared_examples/crop_suggest.rb b/spec/features/shared_examples/crop_suggest.rb index 17012c6a2..7abb21202 100644 --- a/spec/features/shared_examples/crop_suggest.rb +++ b/spec/features/shared_examples/crop_suggest.rb @@ -66,9 +66,7 @@ shared_examples "crop suggest" do |resource| within "form#new_#{resource}" do fill_autocomplete "crop", with: "Ryan Gosling" # Some forms require additional selections before submission. - if resource == "harvest" - choose plant_part.name - end + choose plant_part.name if resource == "harvest" click_button "Save" end diff --git a/spec/helpers/gardens_helper_spec.rb b/spec/helpers/gardens_helper_spec.rb index 50033069b..eb4d1b9c7 100644 --- a/spec/helpers/gardens_helper_spec.rb +++ b/spec/helpers/gardens_helper_spec.rb @@ -29,7 +29,7 @@ describe GardensHelper do garden = FactoryBot.create(:garden, description: 'a' * 140) result = helper.display_garden_description(garden) - expect(result).to eq 'a' * 126 + '...' + ' ' + link_to("Read more", garden_path(garden)) + expect(result).to eq ('a' * 126) + '...' + ' ' + link_to("Read more", garden_path(garden)) end end diff --git a/spec/helpers/seeds_helper_spec.rb b/spec/helpers/seeds_helper_spec.rb index 593527fa2..e30c3b551 100644 --- a/spec/helpers/seeds_helper_spec.rb +++ b/spec/helpers/seeds_helper_spec.rb @@ -29,7 +29,7 @@ describe SeedsHelper do seed = FactoryBot.create(:seed, description: 'a' * 140) result = helper.display_seed_description(seed) - expect(result).to eq 'a' * 126 + '...' + ' ' + link_to("Read more", seed_path(seed)) + expect(result).to eq ('a' * 126) + '...' + ' ' + link_to("Read more", seed_path(seed)) end end end diff --git a/spec/requests/api/v1/gardens_request_spec.rb b/spec/requests/api/v1/gardens_request_spec.rb index 3d141907b..601d835d9 100644 --- a/spec/requests/api/v1/gardens_request_spec.rb +++ b/spec/requests/api/v1/gardens_request_spec.rb @@ -41,12 +41,12 @@ RSpec.describe 'Gardens', type: :request do end it '#index' do - get '/api/v1/gardens', params: {}, headers: headers + get('/api/v1/gardens', params: {}, headers:) expect(subject['data']).to include(garden_encoded_as_json_api) end it '#show' do - get "/api/v1/gardens/#{garden.id}", params: {}, headers: headers + get("/api/v1/gardens/#{garden.id}", params: {}, headers:) expect(subject['data']).to include(garden_encoded_as_json_api) end diff --git a/spec/requests/api/v1/plantings_request_spec.rb b/spec/requests/api/v1/plantings_request_spec.rb index 9cb0e8b78..a004621cd 100644 --- a/spec/requests/api/v1/plantings_request_spec.rb +++ b/spec/requests/api/v1/plantings_request_spec.rb @@ -78,14 +78,14 @@ RSpec.describe 'Plantings', type: :request do end it '#index' do - get '/api/v1/plantings', params: {}, headers: headers + get('/api/v1/plantings', params: {}, headers:) expect(subject['data'][0].keys).to eq(planting_encoded_as_json_api.keys) expect(subject['data'][0]['attributes'].keys.sort!).to eq(planting_encoded_as_json_api['attributes'].keys.sort!) expect(subject['data']).to include(planting_encoded_as_json_api) end it '#show' do - get "/api/v1/plantings/#{planting.id}", params: {}, headers: headers + get("/api/v1/plantings/#{planting.id}", params: {}, headers:) expect(subject['data']['relationships']).to include("garden" => garden_as_json_api) expect(subject['data']['relationships']).to include("crop" => crop_as_json_api) expect(subject['data']['relationships']).to include("owner" => owner_as_json_api) From 826f92691a6329bc6b8a6632860c87ca80097a42 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 13 Jul 2024 15:42:51 +0930 Subject: [PATCH 010/203] Trial Ruby 3.3.* (#3778) * Ruby 3.3 * Upgrade. --- .devcontainer/.env | 2 +- .devcontainer/Dockerfile | 2 +- .ruby-version | 2 +- Gemfile.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.devcontainer/.env b/.devcontainer/.env index 92615121e..56866db42 100644 --- a/.devcontainer/.env +++ b/.devcontainer/.env @@ -1,2 +1,2 @@ # Ruby version -VARIANT=3.2.4 +VARIANT=3.3.4 diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index d09387907..32e2e2655 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/devcontainers/ruby:0-3.2-bullseye +FROM mcr.microsoft.com/devcontainers/ruby:1-3.3-bullseye # Install Rails RUN gem install rails:7.0.8 diff --git a/.ruby-version b/.ruby-version index be94e6f53..a0891f563 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.2.2 +3.3.4 diff --git a/Gemfile.lock b/Gemfile.lock index b94ab9127..2a9d0fd96 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -804,7 +804,7 @@ DEPENDENCIES xmlrpc RUBY VERSION - ruby 3.2.2p53 + ruby 3.3.4p94 BUNDLED WITH 2.4.22 From 5ba25b8e76d63408a87e0dbefea8ffe1cdd63618 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 13 Jul 2024 06:28:30 +0000 Subject: [PATCH 011/203] Rubocop Rails 7.1 --- .rubocop.yml | 2 +- config/factory_bot.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 629f585a9..c2370187b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -11,7 +11,7 @@ AllCops: Exclude: - 'db/schema.rb' - 'vendor/**/*' - TargetRailsVersion: 7.0 + TargetRailsVersion: 7.1 Rails: Enabled: true diff --git a/config/factory_bot.rb b/config/factory_bot.rb index e4925f2a3..8dfdcd20b 100644 --- a/config/factory_bot.rb +++ b/config/factory_bot.rb @@ -2,7 +2,7 @@ ActionDispatch::Callbacks.after do # Reload the factories - return unless Rails.env.development? || Rails.env.test? + return unless Rails.env.local? if FactoryBot.factories.present? # first init will load factories, this should only run on subsequent reloads FactoryBot.factories.clear From 7e2be8efd97b92fdf88db98621e9f9a8d1c06e4d Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 13 Jul 2024 06:29:08 +0000 Subject: [PATCH 012/203] Rubocop Rails 7.1 --- app/controllers/activities_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/activities_controller.rb b/app/controllers/activities_controller.rb index e7e95d1d7..7d1c3299f 100644 --- a/app/controllers/activities_controller.rb +++ b/app/controllers/activities_controller.rb @@ -81,7 +81,7 @@ class ActivitiesController < DataController end def specifics - return unless @owner.present? + return if @owner.blank? "#{@owner.to_param}-" end From 10e456a18d02f2faf8449ce0e8ad9eba6593c43f Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 13 Jul 2024 06:44:10 +0000 Subject: [PATCH 013/203] Bump websocket --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2a9d0fd96..e78e7fda9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -677,7 +677,7 @@ GEM rack (>= 1.0) rack-test (>= 0.5.3) webrick (1.8.1) - websocket (1.2.10) + websocket (1.2.11) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) From f04f8a92019c95fd39d93a81a7e24519528104b9 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 13 Jul 2024 06:48:09 +0000 Subject: [PATCH 014/203] Bump bullet --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2a9d0fd96..2bb8ee3f3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -156,7 +156,7 @@ GEM actionpack (>= 6.1) activemodel (>= 6.1) builder (3.3.0) - bullet (7.1.6) + bullet (7.2.0) activesupport (>= 3.0.0) uniform_notifier (~> 1.11) byebug (11.1.3) @@ -650,7 +650,7 @@ GEM execjs (>= 0.3.0, < 3) thor (1.3.1) thread_safe (0.3.6) - tilt (2.3.0) + tilt (2.4.0) timecop (0.9.10) timeout (0.4.1) trollop (1.16.2) From e46b3f8d192870ebf95e1c09e86c1d456d85d590 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 13 Jul 2024 16:22:45 +0930 Subject: [PATCH 015/203] Update dependabot.yml --- .github/dependabot.yml | 44 ------------------------------------------ 1 file changed, 44 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9bc93941c..4d73c4002 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,50 +7,6 @@ updates: time: "07:00" open-pull-requests-limit: 20 versioning-strategy: lockfile-only - ignore: - - dependency-name: active_median - versions: - - "< 0.2.2, >= 0.2.1.a" - - dependency-name: rubocop - versions: - - "< 0.63, >= 0.62.a" - - dependency-name: rubocop - versions: - - "< 0.64, >= 0.63.a" - - dependency-name: sidekiq - versions: - - 5.2.4 - - dependency-name: oj - versions: - - 3.11.4 - - dependency-name: listen - versions: - - 3.5.0 - - dependency-name: rspec-rails - versions: - - 4.1.0 - - 5.0.0 - - dependency-name: searchkick - versions: - - 4.4.3 - - dependency-name: rswag-api - versions: - - 2.3.3 - - dependency-name: rswag-specs - versions: - - 2.3.3 - - dependency-name: rswag-ui - versions: - - 2.3.3 - - dependency-name: timecop - versions: - - 0.9.3 - - dependency-name: puma - versions: - - 5.2.0 - - dependency-name: capybara - versions: - - 3.35.1 - package-ecosystem: github-actions directory: "/" schedule: From 6a2d21d80b16455e77d2babc19fb75b1a66d6c2a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 13 Jul 2024 07:07:52 +0000 Subject: [PATCH 016/203] Bump rubocop-rspec from 3.0.2 to 3.0.3 Bumps [rubocop-rspec](https://github.com/rubocop/rubocop-rspec) from 3.0.2 to 3.0.3. - [Release notes](https://github.com/rubocop/rubocop-rspec/releases) - [Changelog](https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-rspec/compare/v3.0.2...v3.0.3) --- updated-dependencies: - dependency-name: rubocop-rspec dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index e6e0ba7ab..8b6ae45f1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -586,7 +586,7 @@ GEM rubocop-ast (>= 1.31.1, < 2.0) rubocop-rake (0.6.0) rubocop (~> 1.0) - rubocop-rspec (3.0.2) + rubocop-rspec (3.0.3) rubocop (~> 1.61) rubocop-rspec_rails (2.30.0) rubocop (~> 1.61) From 961d36c57d4af234ad9654fd1c9db1de1bcf27f8 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 13 Jul 2024 07:19:43 +0000 Subject: [PATCH 017/203] Bump --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2a9d0fd96..bc04bcc20 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -248,7 +248,7 @@ GEM erubis (2.7.0) excon (0.110.0) execjs (2.9.1) - factory_bot (6.4.5) + factory_bot (6.4.6) activesupport (>= 5.0.0) factory_bot_rails (6.4.3) factory_bot (~> 6.4) From 3d3f97f0bfb7a3c52cb7a2f1481ba65b7dc9f9b9 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 13 Jul 2024 07:22:24 +0000 Subject: [PATCH 018/203] Bump launchy --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e6e0ba7ab..648f3ab95 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -117,8 +117,8 @@ GEM minitest (>= 5.1) mutex_m tzinfo (~> 2.0) - addressable (2.8.6) - public_suffix (>= 2.0.2, < 6.0) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) ast (2.4.2) autoprefixer-rails (10.4.16.0) execjs (~> 2) @@ -349,7 +349,7 @@ GEM kramdown (2.4.0) rexml language_server-protocol (3.17.0.3) - launchy (3.0.0) + launchy (3.0.1) addressable (~> 2.8) childprocess (~> 5.0) leaflet-rails (1.9.4) @@ -443,7 +443,7 @@ GEM method_source (~> 1.0) psych (5.1.2) stringio - public_suffix (5.0.5) + public_suffix (6.0.0) puma (6.4.2) nio4r (~> 2.0) query_diet (0.7.1) From ee1c4fc79ccfac5af2184bfb4bada371b7507ff2 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 13 Jul 2024 07:32:00 +0000 Subject: [PATCH 019/203] Bump http party --- Gemfile.lock | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8b6ae45f1..f81540f79 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -307,7 +307,8 @@ GEM multi_json (>= 1.9.2) webrick highline (3.0.1) - httparty (0.21.0) + httparty (0.22.0) + csv mini_mime (>= 1.0.0) multi_xml (>= 0.5.2) i18n (1.14.5) @@ -391,7 +392,8 @@ GEM moneta (1.0.0) msgpack (1.7.2) multi_json (1.15.0) - multi_xml (0.6.0) + multi_xml (0.7.1) + bigdecimal (~> 3.1) mutex_m (0.2.0) net-http (0.4.1) uri From 8fe65768d0ad129e2584570ef189cc4fedf41c01 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 13 Jul 2024 07:48:56 +0000 Subject: [PATCH 020/203] Bump raindrops, fix permissions on container start --- .devcontainer/Dockerfile | 3 ++- Gemfile.lock | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 32e2e2655..2c7c2fad6 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -29,4 +29,5 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ # Make sure this is writable as https://github.com/rubygems/rubygems/issues/6272 was removed RUN su root -c "mkdir -p /usr/local/rvm/gems/default/cache/bundler/" RUN su root -c "mkdir -p /usr/local/rvm/gems/default/bundler/gems/" -RUN su root -c "chmod -R 777 /usr/local/rvm/gems/" +RUN su root -c "chown -R vscode:rvm /usr/local/rvm/gems/" +RUN su root -c "chmod -R 0755 /usr/local/rvm/gems/" diff --git a/Gemfile.lock b/Gemfile.lock index 4d7e911e3..1d48879e1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -503,7 +503,7 @@ GEM thor (~> 1.0, >= 1.2.2) zeitwerk (~> 2.6) rainbow (3.1.1) - raindrops (0.20.0) + raindrops (0.20.1) rake (13.2.1) rate_throttle_client (0.1.2) rb-fsevent (0.11.2) From 8ba7eef6bef16a484fa26a057db4a59731eef316 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 13 Jul 2024 11:56:24 +0000 Subject: [PATCH 021/203] Simplify link --- app/helpers/crops_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/crops_helper.rb b/app/helpers/crops_helper.rb index 451aafd5b..a7f19a60d 100644 --- a/app/helpers/crops_helper.rb +++ b/app/helpers/crops_helper.rb @@ -15,6 +15,6 @@ module CropsHelper end def crop_ebay_seeds_url(crop) - "https://rover.ebay.com/rover/1/705-53470-19255-0/1?icep_ff3=9&pub=5575213277&toolid=10001&campid=5337940151&customid=&icep_uq=#{CGI.escape crop.name}&icep_sellerId=&icep_ex_kw=&icep_sortBy=12&icep_catId=181003&icep_minPrice=&icep_maxPrice=&ipn=psmain&icep_vectorid=229515&kwid=902099&mtid=824&kw=lg" + "https://www.ebay.com/sch/i.html?_nkw=#{CGI.escape crop.name}" end end From 8f0dff1e96ef04a1f8a3e467e7bc6b992016e89d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 13:26:59 +0000 Subject: [PATCH 022/203] Bump leaflet-rails from 1.9.4 to 1.9.5 Bumps [leaflet-rails](https://github.com/axyjo/leaflet-rails) from 1.9.4 to 1.9.5. - [Commits](https://github.com/axyjo/leaflet-rails/compare/v1.9.4...v1.9.5) --- updated-dependencies: - dependency-name: leaflet-rails dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 66e1ca364..eef6a95b0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -331,7 +331,7 @@ GEM mini_magick (>= 4.9.5, < 5) ruby-vips (>= 2.0.17, < 3) io-console (0.7.2) - irb (1.13.2) + irb (1.14.0) rdoc (>= 4.0.0) reline (>= 0.4.2) jquery-rails (4.6.0) @@ -353,7 +353,7 @@ GEM launchy (3.0.1) addressable (~> 2.8) childprocess (~> 5.0) - leaflet-rails (1.9.4) + leaflet-rails (1.9.5) actionpack (>= 4.2.0) railties (>= 4.2.0) letter_opener (1.10.0) From d45b51f85c4ab3d136e743042bd8bc880db60036 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jul 2024 07:33:55 +0000 Subject: [PATCH 023/203] Bump faker from 3.4.1 to 3.4.2 Bumps [faker](https://github.com/faker-ruby/faker) from 3.4.1 to 3.4.2. - [Release notes](https://github.com/faker-ruby/faker/releases) - [Changelog](https://github.com/faker-ruby/faker/blob/main/CHANGELOG.md) - [Commits](https://github.com/faker-ruby/faker/compare/v3.4.1...v3.4.2) --- updated-dependencies: - dependency-name: faker dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index eef6a95b0..4c0b2281c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -253,7 +253,7 @@ GEM factory_bot_rails (6.4.3) factory_bot (~> 6.4) railties (>= 5.0.0) - faker (3.4.1) + faker (3.4.2) i18n (>= 1.8.11, < 2) faraday (2.10.0) faraday-net_http (>= 2.0, < 3.2) From e7a0d0276f276746e1654622d5732ed2d0fcbe60 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Wed, 17 Jul 2024 20:06:32 +0930 Subject: [PATCH 024/203] Photos > Show crop link (#3803) * Fix #3802 Show crop link * Fix #3802 Show crop link * Fix missing arg * Fix missing arg * Translations --- app/views/photos/_associations.html.haml | 6 ++++++ app/views/timeline/_photos.html.haml | 7 ++++++- config/locales/en.yml | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/views/photos/_associations.html.haml b/app/views/photos/_associations.html.haml index f036c0851..590507a8f 100644 --- a/app/views/photos/_associations.html.haml +++ b/app/views/photos/_associations.html.haml @@ -30,3 +30,9 @@ = seed_icon = link_to t('photos.show.seed', seed: seed.to_s, owner: seed.owner.to_s), seed_path(seed) = render "association_delete_button", photo: @photo, type: 'seed', thing: seed + + - @photo.crops.each do |crop| + %li + = crop_icon(crop) + = link_to t('photos.show.crop', crop: crop.to_s), crop_path(crop) + = render "association_delete_button", photo: @photo, type: 'crop', thing: crop \ No newline at end of file diff --git a/app/views/timeline/_photos.html.haml b/app/views/timeline/_photos.html.haml index a9aae9389..9e844faba 100644 --- a/app/views/timeline/_photos.html.haml +++ b/app/views/timeline/_photos.html.haml @@ -24,4 +24,9 @@ - photo.seeds.each do |seed| %li = seed_icon - = link_to t('photos.show.seed', seed: seed.to_s, owner: seed.owner.to_s), seed_path(seed) \ No newline at end of file + = link_to t('photos.show.seed', seed: seed.to_s, owner: seed.owner.to_s), seed_path(seed) + + - photo.crops.each do |crop| + %li + = crop_icon(crop) + = link_to t('photos.show.crop', crop: crop.to_s), crop_path(crop) \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index c4d3b7399..35486e522 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -267,6 +267,7 @@ en: planting: "%{planting}" seed: "%{seed}" thing_by: A %{thing} by %{owner} + crop: "%{crop}" places: index: title: "%{site_name} Community Map" From becd846022640d5b1d9e3e7642f1a49d8413d1dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 07:10:18 +0000 Subject: [PATCH 025/203] Bump icalendar from 2.10.1 to 2.10.2 Bumps [icalendar](https://github.com/icalendar/icalendar) from 2.10.1 to 2.10.2. - [Changelog](https://github.com/icalendar/icalendar/blob/main/CHANGELOG.md) - [Commits](https://github.com/icalendar/icalendar/compare/v2.10.1...v2.10.2) --- updated-dependencies: - dependency-name: icalendar dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 4c0b2281c..5bdc9b25e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -323,9 +323,9 @@ GEM rails-i18n rainbow (>= 2.2.2, < 4.0) terminal-table (>= 1.5.1) - icalendar (2.10.1) + icalendar (2.10.2) ice_cube (~> 0.16) - ice_cube (0.16.4) + ice_cube (0.17.0) ice_nine (0.11.2) image_processing (1.12.2) mini_magick (>= 4.9.5, < 5) From 946b780b4ef8187aa67dbc016c34da1cae3f9a06 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 09:25:45 +0000 Subject: [PATCH 026/203] Bump rexml from 3.3.1 to 3.3.2 Bumps [rexml](https://github.com/ruby/rexml) from 3.3.1 to 3.3.2. - [Release notes](https://github.com/ruby/rexml/releases) - [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md) - [Commits](https://github.com/ruby/rexml/compare/v3.3.1...v3.3.2) --- updated-dependencies: - dependency-name: rexml dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5bdc9b25e..70320e673 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -522,7 +522,7 @@ GEM responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.3.1) + rexml (3.3.2) strscan rouge (4.1.2) rspec (3.13.0) From cb9afd00c62f2e24b84d2707b16c513cdabd055b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 09:25:56 +0000 Subject: [PATCH 027/203] Bump selenium-webdriver from 4.22.0 to 4.23.0 Bumps [selenium-webdriver](https://github.com/SeleniumHQ/selenium) from 4.22.0 to 4.23.0. - [Release notes](https://github.com/SeleniumHQ/selenium/releases) - [Changelog](https://github.com/SeleniumHQ/selenium/blob/trunk/rb/CHANGES) - [Commits](https://github.com/SeleniumHQ/selenium/compare/selenium-4.22.0...selenium-4.23.0) --- updated-dependencies: - dependency-name: selenium-webdriver dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5bdc9b25e..20de7715f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -522,7 +522,7 @@ GEM responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.3.1) + rexml (3.3.2) strscan rouge (4.1.2) rspec (3.13.0) @@ -616,7 +616,7 @@ GEM searchkick (5.3.1) activemodel (>= 6.1) hashie - selenium-webdriver (4.22.0) + selenium-webdriver (4.23.0) base64 (~> 0.2) logger (~> 1.4) rexml (~> 3.2, >= 3.2.5) From 83f2cf4a3cb2624e298155da839dc36f3114d812 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Tue, 23 Jul 2024 19:44:21 +0930 Subject: [PATCH 028/203] Require name, handle errors on crop create (#3799) * Fix #3278 by ensuring we rebuild names on error * Require a URL * Require a name * 'Only required for wrangers, and only when approving * Re-add expectation --- app/controllers/crops_controller.rb | 7 ++++++- app/views/crops/_form.html.haml | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index 490a0076b..a80234bfb 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -113,7 +113,12 @@ class CropsController < ApplicationController @crop.approval_status = "pending" end - notify_wranglers if Crop.transaction { @crop.save && save_crop_names } + if Crop.transaction { @crop.save && save_crop_names } + notify_wranglers + else + @crop.alternate_names.build + @crop.scientific_names.build + end respond_with @crop end diff --git a/app/views/crops/_form.html.haml b/app/views/crops/_form.html.haml index e3ea3b344..18d082172 100644 --- a/app/views/crops/_form.html.haml +++ b/app/views/crops/_form.html.haml @@ -26,7 +26,7 @@ %h2 Basic information .form-group#new_crop - = f.text_field :name + = f.text_field :name, required: true %span.help-block The common name for the crop, in English (required). - if can? :wrangle, @crop @@ -43,7 +43,7 @@ - unless @crop.approved? = link_to 'Search wikipedia', "https://en.wikipedia.org/w/index.php?search=#{@crop.name}", target: '_blank' - = f.text_field :en_wikipedia_url, id: "en_wikipedia_url", label: 'Wikipedia URL' + = f.url_field :en_wikipedia_url, id: "en_wikipedia_url", label: 'Wikipedia URL' %span.help-block Link to the crop's page on the English language Wikipedia (required). From c28b2c0c38940f16513788a5f6622f185ffbb559 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Wed, 24 Jul 2024 17:07:56 +0930 Subject: [PATCH 029/203] Likes: Add capability to Activities, Plantings, Harvests (#3805) * Ability to like activities * Ability to like activities * Add likeable everywhere * Refactor * Remove extra newline * Typo * Use classes, not IDs * Explicitly wait for ajax * Fix tests * Move likes under owner * Add separation * Move harvest likes near actions * Rearrange harvests * Render likes under owner * Make harvest consistent with other views * Move planting detail into header * Move detail into header * Move detail into header * Revert * Fix header * Move likes into jumotrons * Fix name * Change all actions to be after likes and a span * Cleanup * Cleanup * Cleanup * Cleanup * i18n and accessibility * Fix name * Temporarily make ack into a div * Update app/views/photos/_actions.html.haml --- app/assets/javascripts/likes.js | 33 ++++- app/models/activity.rb | 1 + app/models/harvest.rb | 1 + app/models/planting.rb | 1 + app/views/activities/_actions.haml | 2 +- app/views/activities/show.html.haml | 15 +-- app/views/harvests/_actions.html.haml | 2 +- app/views/harvests/show.html.haml | 34 +++--- app/views/likes/_count.haml | 2 +- app/views/likes/_likes.html.haml | 18 +++ app/views/photos/_actions.html.haml | 4 +- app/views/photos/show.html.haml | 2 +- app/views/plantings/_actions.html.haml | 2 +- app/views/plantings/show.html.haml | 4 +- app/views/posts/_likes.html.haml | 10 -- app/views/posts/show.html.haml | 2 +- config/locales/en.yml | 3 + db/migrate/20240714024918_like_everything.rb | 17 +++ db/schema.rb | 56 ++++++++- spec/features/likeable_spec.rb | 121 +++++++++---------- 20 files changed, 217 insertions(+), 113 deletions(-) create mode 100644 app/views/likes/_likes.html.haml delete mode 100644 app/views/posts/_likes.html.haml create mode 100644 db/migrate/20240714024918_like_everything.rb diff --git a/app/assets/javascripts/likes.js b/app/assets/javascripts/likes.js index 801617ff9..768d54c34 100644 --- a/app/assets/javascripts/likes.js +++ b/app/assets/javascripts/likes.js @@ -1,11 +1,19 @@ $(document).ready(function() { $('.like-btn').show(); - $('.post-like').on('ajax:success', function(event, data) { - var likeButton = $('#post-' + data.id + ' .post-like'); - var likeBadge = $('#post-'+ data.id + ' .like-badge'); + /** + * Handles the result of an ajax call and updates UI + * + * @param {object} data JSON data from ajax response + * @param {string} type object type (ie: post, activity, etc) + */ + var likeableSuccess = function(data, type) { + var target = '.' + type + '-' + data.id; + var objectClass = type.charAt(0).toUpperCase() + type.slice(1); + var likeButton = $(target + ' .' + type + '-like'); + var likeBadge = $(target + ' .like-badge'); - $('#post-' + data.id + ' .like-count').text(data.like_count); + $(target + ' .like-count').text(data.like_count); if (data.liked_by_member) { likeBadge.addClass('liked'); likeButton.data('method', 'delete'); @@ -14,11 +22,26 @@ $(document).ready(function() { } else { likeBadge.removeClass('liked'); likeButton.data('method', 'post'); - likeButton.attr('href', '/likes.json?type=Post&id=' + data.id); + likeButton.attr('href', '/likes.json?type=' + objectClass + '&id=' + data.id); likeButton.text('Like'); } + }; + + $('.post-like').on('ajax:success', function(event, data) { + likeableSuccess(data, 'post'); }); + $('.activity-like').on('ajax:success', function(event, data) { + likeableSuccess(data, 'activity'); + }); + + $('.planting-like').on('ajax:success', function(event, data) { + likeableSuccess(data, 'planting'); + }); + + $('.harvest-like').on('ajax:success', function(event, data) { + likeableSuccess(data, 'harvest'); + }); $('.photo-like').on('ajax:success', function(event, data) { var likeBadge = $('#photo-'+ data.id + ' .like-badge'); diff --git a/app/models/activity.rb b/app/models/activity.rb index b8eac89b1..cbdfbbf89 100644 --- a/app/models/activity.rb +++ b/app/models/activity.rb @@ -5,6 +5,7 @@ class Activity < ApplicationRecord include Ownable include Finishable include SearchActivities + include Likeable belongs_to :garden, optional: true belongs_to :planting, optional: true diff --git a/app/models/harvest.rb b/app/models/harvest.rb index 399194610..29069c75f 100644 --- a/app/models/harvest.rb +++ b/app/models/harvest.rb @@ -6,6 +6,7 @@ class Harvest < ApplicationRecord include PhotoCapable include Ownable include SearchHarvests + include Likeable friendly_id :harvest_slug, use: %i(slugged finders) diff --git a/app/models/planting.rb b/app/models/planting.rb index 373a45679..9955a4345 100644 --- a/app/models/planting.rb +++ b/app/models/planting.rb @@ -8,6 +8,7 @@ class Planting < ApplicationRecord include PredictPlanting include PredictHarvest include SearchPlantings + include Likeable friendly_id :planting_slug, use: %i(slugged finders) diff --git a/app/views/activities/_actions.haml b/app/views/activities/_actions.haml index 6645220ab..1631b7042 100644 --- a/app/views/activities/_actions.haml +++ b/app/views/activities/_actions.haml @@ -1,5 +1,5 @@ - if can?(:edit, activity) - .dropdown.activity-actions + %span.dropdown.activity-actions %a#activity-actions-button.btn.btn-info.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", type: "button", href: '#'} Actions .dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "planting-actions-button"} = activity_edit_button(activity, classes: 'dropdown-item') diff --git a/app/views/activities/show.html.haml b/app/views/activities/show.html.haml index 05191069f..982daa1d8 100644 --- a/app/views/activities/show.html.haml +++ b/app/views/activities/show.html.haml @@ -22,19 +22,17 @@ %small.text-muted= @activity.category %tt = @activity.due_date + - if @activity.description.present? + :markdown + #{strip_tags markdownify(@activity.description)} + = render 'likes/likes', object: @activity + = render 'activities/actions', activity: @activity .col-md-4.col-xs-12 = render 'activities/owner', planting: @activity .col-md-8.col-xs-12 - - if @activity.description.present? - = cute_icon - .card - .card-header - %h2 Description - .card-body - :markdown - #{strip_tags markdownify(@activity.description)} + - if @activity.garden %section.gardens @@ -48,4 +46,3 @@ .col-md-4.col-xs-12 - = render 'activities/actions', activity: @activity diff --git a/app/views/harvests/_actions.html.haml b/app/views/harvests/_actions.html.haml index c3dbfa836..1239f8bb6 100644 --- a/app/views/harvests/_actions.html.haml +++ b/app/views/harvests/_actions.html.haml @@ -1,5 +1,5 @@ - if can?(:edit, harvest) - .dropdown.harvest-actions + %span.dropdown.harvest-actions %a#harvest-actions-button.btn.btn-info.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", type: "button", href: '#'} Actions .dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "harvest-actions-button"} = harvest_edit_button(harvest, classes: 'dropdown-item') diff --git a/app/views/harvests/show.html.haml b/app/views/harvests/show.html.haml index f0d721971..88d55664a 100644 --- a/app/views/harvests/show.html.haml +++ b/app/views/harvests/show.html.haml @@ -15,13 +15,26 @@ .harvest .row .col-md-8.col-xs-12 - %h1 - = harvest_icon - #{@harvest.crop} harvested by #{@harvest.owner} - .col-md-4.col-xs-12 - = render 'harvests/actions', harvest: @harvest - .col-md-8.col-xs-12 + .jumbotron + .d-flex.justify-content-between + %h1.display-3 + = harvest_icon + %strong= @harvest.crop + %small.text-muted + harvested by + = @harvest.owner + + - if @harvest.description.present? + :markdown + #{strip_tags markdownify(@harvest.description)} + = render partial: 'planting' + = render 'likes/likes', object: @harvest + = render 'harvests/actions', harvest: @harvest + + .col-md-4.col-xs-12 + = render 'harvests/owner', harvest: @harvest + .col-md-8.col-xs-12 .index-cards.facts - if @harvest.plant_part .card @@ -53,14 +66,5 @@ Havested from = link_to @harvest.planting, @harvest.planting - - if @harvest.description.present? - .card - .card-header - %h2 Notes - .card-body - :markdown - #{strip_tags markdownify(@harvest.description)} - .col-md-4.col-xs-12 - = render 'harvests/owner', harvest: @harvest = render @harvest.crop diff --git a/app/views/likes/_count.haml b/app/views/likes/_count.haml index 61920e259..8d74b11c3 100644 --- a/app/views/likes/_count.haml +++ b/app/views/likes/_count.haml @@ -1,4 +1,4 @@ %span.badge.like-badge{class: liked ? 'liked' : ''} = like_icon   - %span.like-count= likeable.likes_count + %span.like-count{title: t('buttons.total_likes')}= likeable.likes_count diff --git a/app/views/likes/_likes.html.haml b/app/views/likes/_likes.html.haml new file mode 100644 index 000000000..5f44298e8 --- /dev/null +++ b/app/views/likes/_likes.html.haml @@ -0,0 +1,18 @@ +%span.likes + - if member_signed_in? && can?(:new, Like) + - if !object.liked_by?(current_member) + = link_to likes_path(type: object.class.name, id: object.id, format: :json), + title: t('buttons.like'), + method: :post, + remote: true, + class: "#{object.class.name.downcase}-#{object.id} #{object.class.name.downcase}-like like-btn btn" do + = render 'likes/count', likeable: object, liked: false + - else + = link_to likes_path(type: object.class.name, id: object.id, format: :json), + title: t('buttons.unlike'), + method: :delete, + remote: true, + class: "#{object.class.name.downcase}-#{object.id} #{object.class.name.downcase}-like like-btn btn" do + = render 'likes/count', likeable: object, liked: true + - else + = render 'likes/count', likeable: object, liked: member_signed_in? && object.liked_by?(current_member) diff --git a/app/views/photos/_actions.html.haml b/app/views/photos/_actions.html.haml index 1ab3e14bd..a26bb779d 100644 --- a/app/views/photos/_actions.html.haml +++ b/app/views/photos/_actions.html.haml @@ -1,7 +1,7 @@ - if can?(:edit, @photo) && can?(:destroy, @photo) .dropdown.float-right.photo-actions - %a#harvest-actions-button.btn.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", type: "button", href: '#'} Actions - .dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "harvest-actions-button"} + %a#photo-actions-button.btn.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", type: "button", href: '#'} Actions + .dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "photo-actions-button"} = edit_button(edit_photo_path(@photo), classes: 'dropdown-item') .dropdown-divider = delete_button(@photo, classes: 'dropdown-item text-danger') diff --git a/app/views/photos/show.html.haml b/app/views/photos/show.html.haml index c286d8afc..59d503f4f 100644 --- a/app/views/photos/show.html.haml +++ b/app/views/photos/show.html.haml @@ -28,12 +28,12 @@ = render 'crops/thumbnail', crop: crop .col-md-3 %p + %span.btn= render 'photos/likes', photo: @photo = render 'photos/actions', photo: @photo = link_to @photo.link_url, class: 'btn btn-info' do - if @photo.source == 'flickr' = icon 'fab', 'flickr' View on #{@photo.source.titleize} - %span.btn= render 'photos/likes', photo: @photo - if @photo.date_taken.present? %h3 Taken on #{I18n.l @photo.date_taken.to_date} diff --git a/app/views/plantings/_actions.html.haml b/app/views/plantings/_actions.html.haml index ef852088a..d903d00d9 100644 --- a/app/views/plantings/_actions.html.haml +++ b/app/views/plantings/_actions.html.haml @@ -1,5 +1,5 @@ - if can?(:edit, planting) - .dropdown.planting-actions + %span.dropdown.planting-actions %a#planting-actions-button.btn.btn-info.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", type: "button", href: '#'} Actions .dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "planting-actions-button"} = planting_edit_button(planting, classes: 'dropdown-item') diff --git a/app/views/plantings/show.html.haml b/app/views/plantings/show.html.haml index 3678f1216..f050d1a4c 100644 --- a/app/views/plantings/show.html.haml +++ b/app/views/plantings/show.html.haml @@ -43,6 +43,8 @@ %strong #{@planting.age_in_days}/#{@planting.expected_lifespan} days = render 'timeline', planting: @planting + = render 'likes/likes', object: @planting + = render 'plantings/actions', planting: @planting .col-md-4.col-xs-12 = render 'plantings/owner', planting: @planting @@ -79,8 +81,6 @@ .col-md-4.col-xs-12 - = render 'plantings/actions', planting: @planting - %hr/ = render @planting.crop - if @planting.location diff --git a/app/views/posts/_likes.html.haml b/app/views/posts/_likes.html.haml deleted file mode 100644 index 7c00d1bfd..000000000 --- a/app/views/posts/_likes.html.haml +++ /dev/null @@ -1,10 +0,0 @@ - -- if member_signed_in? && can?(:new, Like) - - if !post.liked_by?(current_member) - = link_to 'Like', likes_path(type: 'Post', id: post.id, format: :json), - method: :post, remote: true, class: 'post-like btn like-btn' - - else - = link_to 'Unlike', likes_path(type: 'Post', id: post.id, format: :json), - method: :delete, remote: true, class: 'post-like btn like-btn' - -= render 'likes/count', likeable: post, liked: member_signed_in? && post.liked_by?(current_member) diff --git a/app/views/posts/show.html.haml b/app/views/posts/show.html.haml index 99d6c5743..8d04db983 100644 --- a/app/views/posts/show.html.haml +++ b/app/views/posts/show.html.haml @@ -45,7 +45,7 @@ = render 'photos/thumbnail', photo: photo .card-footer - = render 'posts/likes', post: @post + = render 'likes/likes', object: @post .float-right - if can? :create, Comment = link_to new_comment_path(post_id: @post.id), class: 'btn' do diff --git a/config/locales/en.yml b/config/locales/en.yml index 35486e522..66edc8835 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -92,6 +92,9 @@ en: save_seeds: Save seeds timeline: Timeline write_blog_post: Write blog post + like: Like + unlike: Remove like + total_likes: Total likes crops: search: Search crops index: diff --git a/db/migrate/20240714024918_like_everything.rb b/db/migrate/20240714024918_like_everything.rb new file mode 100644 index 000000000..38d145f32 --- /dev/null +++ b/db/migrate/20240714024918_like_everything.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class LikeEverything < ActiveRecord::Migration[7.1] + def change + change_table :activities do |t| + t.integer :likes_count, default: 0 + end + + change_table :plantings do |t| + t.integer :likes_count, default: 0 + end + + change_table :harvests do |t| + t.integer :likes_count, default: 0 + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 03b05f98f..81cdec75f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.1].define(version: 2024_02_18_053122) do +ActiveRecord::Schema[7.1].define(version: 2024_07_14_024918) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -54,6 +54,14 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_18_053122) do t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "slug" + t.integer "cached_votes_total", default: 0 + t.integer "cached_votes_score", default: 0 + t.integer "cached_votes_up", default: 0 + t.integer "cached_votes_down", default: 0 + t.integer "cached_weighted_score", default: 0 + t.integer "cached_weighted_total", default: 0 + t.float "cached_weighted_average", default: 0.0 + t.integer "likes_count", default: 0 t.index ["garden_id"], name: "index_activities_on_garden_id" t.index ["owner_id"], name: "index_activities_on_owner_id" t.index ["planting_id"], name: "index_activities_on_planting_id" @@ -206,6 +214,13 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_18_053122) do t.text "body", null: false t.datetime "created_at", precision: nil t.datetime "updated_at", precision: nil + t.integer "cached_votes_total", default: 0 + t.integer "cached_votes_score", default: 0 + t.integer "cached_votes_up", default: 0 + t.integer "cached_votes_down", default: 0 + t.integer "cached_weighted_score", default: 0 + t.integer "cached_weighted_total", default: 0 + t.float "cached_weighted_average", default: 0.0 end create_table "crop_companions", force: :cascade do |t| @@ -314,6 +329,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_18_053122) do t.integer "plant_part_id" t.float "si_weight" t.integer "planting_id" + t.integer "likes_count", default: 0 t.index ["planting_id"], name: "index_harvests_on_planting_id" end @@ -488,6 +504,13 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_18_053122) do t.datetime "date_taken", precision: nil t.integer "likes_count", default: 0 t.string "source" + t.integer "cached_votes_total", default: 0 + t.integer "cached_votes_score", default: 0 + t.integer "cached_votes_up", default: 0 + t.integer "cached_votes_down", default: 0 + t.integer "cached_weighted_score", default: 0 + t.integer "cached_weighted_total", default: 0 + t.float "cached_weighted_average", default: 0.0 t.index ["fullsize_url"], name: "index_photos_on_fullsize_url", unique: true t.index ["thumbnail_url"], name: "index_photos_on_thumbnail_url", unique: true end @@ -530,6 +553,14 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_18_053122) do t.integer "days_to_last_harvest" t.integer "parent_seed_id" t.integer "harvests_count", default: 0 + t.integer "cached_votes_total", default: 0 + t.integer "cached_votes_score", default: 0 + t.integer "cached_votes_up", default: 0 + t.integer "cached_votes_down", default: 0 + t.integer "cached_weighted_score", default: 0 + t.integer "cached_weighted_total", default: 0 + t.float "cached_weighted_average", default: 0.0 + t.integer "likes_count", default: 0 t.index ["slug"], name: "index_plantings_on_slug", unique: true end @@ -543,6 +574,13 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_18_053122) do t.integer "forum_id" t.integer "likes_count", default: 0 t.integer "comments_count", default: 0 + t.integer "cached_votes_total", default: 0 + t.integer "cached_votes_score", default: 0 + t.integer "cached_votes_up", default: 0 + t.integer "cached_votes_down", default: 0 + t.integer "cached_weighted_score", default: 0 + t.integer "cached_weighted_total", default: 0 + t.float "cached_weighted_average", default: 0.0 t.index ["created_at", "author_id"], name: "index_posts_on_created_at_and_author_id" t.index ["slug"], name: "index_posts_on_slug", unique: true end @@ -590,6 +628,22 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_18_053122) do t.index ["slug"], name: "index_seeds_on_slug", unique: true end + create_table "votes", force: :cascade do |t| + t.string "votable_type" + t.bigint "votable_id" + t.string "voter_type" + t.bigint "voter_id" + t.boolean "vote_flag" + t.string "vote_scope" + t.integer "vote_weight" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["votable_id", "votable_type", "vote_scope"], name: "index_votes_on_votable_id_and_votable_type_and_vote_scope" + t.index ["votable_type", "votable_id"], name: "index_votes_on_votable" + t.index ["voter_id", "voter_type", "vote_scope"], name: "index_votes_on_voter_id_and_voter_type_and_vote_scope" + t.index ["voter_type", "voter_id"], name: "index_votes_on_voter" + end + add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id" add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id" add_foreign_key "harvests", "plantings" diff --git a/spec/features/likeable_spec.rb b/spec/features/likeable_spec.rb index adf4397fe..95ee13f6f 100644 --- a/spec/features/likeable_spec.rb +++ b/spec/features/likeable_spec.rb @@ -5,7 +5,10 @@ require 'rails_helper' describe 'Likeable', :js, :search do let(:another_member) { FactoryBot.create(:london_member) } let!(:post) { FactoryBot.create(:post, :reindex, author: member) } + let!(:activity) { FactoryBot.create(:activity, :reindex, owner: member) } let!(:photo) { FactoryBot.create(:photo, :reindex, owner: member) } + let!(:harvest) { FactoryBot.create(:harvest, :reindex, owner: member) } + let!(:planting) { FactoryBot.create(:planting, :reindex, owner: member) } before do Photo.reindex @@ -13,55 +16,55 @@ describe 'Likeable', :js, :search do include_context 'signed in member' + shared_examples 'object can be liked' do + it 'can be liked' do + visit path + expect(page).to have_css(like_count_class, text: "0") + click_link '0', class: 'like-btn' + expect(page).to have_css(like_count_class, text: "1") + + # Reload page + visit path + expect(page).to have_css(like_count_class, text: "1") + expect(page).to have_link '1' + + click_link '1', class: 'like-btn' + expect(page).to have_css(like_count_class, text: "0") + end + + it 'displays correct number of likes' do + visit path + expect(page).to have_css(like_count_class, text: "0") + expect(page).to have_link '0' + click_link '0', class: 'like-btn' + expect(page).to have_css(like_count_class, text: "1") + + logout(member) + login_as(another_member) + visit path + + expect(page).to have_css(like_count_class, text: "1") + click_link '1', class: 'like-btn' + expect(page).to have_css(like_count_class, text: "2") + logout(another_member) + end + end + describe 'photos' do def like_count_class "#photo-#{photo.id} .like-count" end - shared_examples 'photo can be liked' do - it 'can be liked' do - visit path - expect(page).to have_css(like_count_class, text: "0") - click_link '0', class: 'like-btn' - expect(page).to have_css(like_count_class, text: "1") - - # Reload page - visit path - expect(page).to have_css(like_count_class, text: "1") - expect(page).to have_link '1' - - click_link '1', class: 'like-btn' - expect(page).to have_css(like_count_class, text: "0") - end - - it 'displays correct number of likes' do - visit path - expect(page).to have_css(like_count_class, text: "0") - expect(page).to have_link '0' - click_link '0', class: 'like-btn' - expect(page).to have_css(like_count_class, text: "1") - - logout(member) - login_as(another_member) - visit path - - expect(page).to have_css(like_count_class, text: "1") - click_link '1', class: 'like-btn' - expect(page).to have_css(like_count_class, text: "2") - logout(another_member) - end - end - describe 'photos#index' do let(:path) { photos_path } - include_examples 'photo can be liked' + include_examples 'object can be liked' end describe 'photos#show' do let(:path) { photo_path(photo) } - include_examples 'photo can be liked' + include_examples 'object can be liked' end describe 'crops#show' do @@ -71,43 +74,35 @@ describe 'Likeable', :js, :search do before { planting.photos << photo } - include_examples 'photo can be liked' + include_examples 'object can be liked' end end describe 'posts' do - let(:like_count_class) { "#post-#{post.id} .like-count" } + let(:like_count_class) { ".post-#{post.id} .like-count" } + let(:path) { post_path(post) } - before { visit post_path(post) } + include_examples 'object can be liked' + end - it 'can be liked' do - expect(page).to have_css(like_count_class, text: "0") - expect(page).to have_link 'Like' - click_link 'Like', class: 'like-btn' - expect(page).to have_css(like_count_class, text: "1") + describe 'activities' do + let(:like_count_class) { ".activity-#{activity.id} .like-count" } + let(:path) { activity_path(activity) } - # Reload page - visit post_path(post) - expect(page).to have_css(like_count_class, text: "1") - expect(page).to have_link 'Unlike' + include_examples 'object can be liked' + end - click_link 'Unlike', class: 'like-btn' - expect(page).to have_css(like_count_class, text: "0") - end + describe 'plantings' do + let(:like_count_class) { ".planting-#{planting.id} .like-count" } + let(:path) { planting_path(planting) } - it 'displays correct number of likes' do - expect(page).to have_link 'Like' - click_link 'Like', class: 'like-btn' - expect(page).to have_css(like_count_class, text: "1") + include_examples 'object can be liked' + end - logout(member) - login_as(another_member) - visit post_path(post) + describe 'harvests' do + let(:like_count_class) { ".harvest-#{harvest.id} .like-count" } + let(:path) { harvest_path(harvest) } - expect(page).to have_link 'Like' - click_link 'Like', class: 'like-btn' - expect(page).to have_css(like_count_class, text: "2") - logout(another_member) - end + include_examples 'object can be liked' end end From 4de547c24367d3ad40a0503c547a13d7b3751198 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 07:30:14 +0000 Subject: [PATCH 030/203] Bump pg from 1.5.6 to 1.5.7 Bumps [pg](https://github.com/ged/ruby-pg) from 1.5.6 to 1.5.7. - [Changelog](https://github.com/ged/ruby-pg/blob/master/History.md) - [Commits](https://github.com/ged/ruby-pg/compare/v1.5.6...v1.5.7) --- updated-dependencies: - dependency-name: pg dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 20de7715f..1bb7aa9e4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -434,7 +434,7 @@ GEM racc percy-capybara (5.0.0) capybara (>= 3) - pg (1.5.6) + pg (1.5.7) platform-api (3.7.0) heroics (~> 0.1.1) moneta (~> 1.0.0) From 1e623f657daa4a876205c22356173b2418d095d2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 07:39:31 +0000 Subject: [PATCH 031/203] Bump faraday from 2.10.0 to 2.10.1 Bumps [faraday](https://github.com/lostisland/faraday) from 2.10.0 to 2.10.1. - [Release notes](https://github.com/lostisland/faraday/releases) - [Changelog](https://github.com/lostisland/faraday/blob/main/CHANGELOG.md) - [Commits](https://github.com/lostisland/faraday/compare/v2.10.0...v2.10.1) --- updated-dependencies: - dependency-name: faraday dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1bb7aa9e4..de3a2bd3e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -255,10 +255,10 @@ GEM railties (>= 5.0.0) faker (3.4.2) i18n (>= 1.8.11, < 2) - faraday (2.10.0) + faraday (2.10.1) faraday-net_http (>= 2.0, < 3.2) logger - faraday-net_http (3.1.0) + faraday-net_http (3.1.1) net-http ffi (1.16.3) flickraw (0.9.10) From bab87682c5f846596d686841e235623a91424483 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 22:06:15 +0000 Subject: [PATCH 032/203] Bump rubocop from 1.65.0 to 1.65.1 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.65.0 to 1.65.1. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.65.0...v1.65.1) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index de3a2bd3e..df6db4e67 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -449,7 +449,7 @@ GEM puma (6.4.2) nio4r (~> 2.0) query_diet (0.7.1) - racc (1.8.0) + racc (1.8.1) rack (2.2.9) rack-cors (2.0.2) rack (>= 2.0.0) @@ -522,7 +522,7 @@ GEM responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.3.2) + rexml (3.3.4) strscan rouge (4.1.2) rspec (3.13.0) @@ -564,7 +564,7 @@ GEM rswag-ui (2.13.0) actionpack (>= 3.1, < 7.2) railties (>= 3.1, < 7.2) - rubocop (1.65.0) + rubocop (1.65.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) From a92f8a358bf4b833e5293b15e42c1beca2d42e6c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 07:57:16 +0000 Subject: [PATCH 033/203] Bump rubocop-rspec from 3.0.3 to 3.0.4 Bumps [rubocop-rspec](https://github.com/rubocop/rubocop-rspec) from 3.0.3 to 3.0.4. - [Release notes](https://github.com/rubocop/rubocop-rspec/releases) - [Changelog](https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-rspec/compare/v3.0.3...v3.0.4) --- updated-dependencies: - dependency-name: rubocop-rspec dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index df6db4e67..84bee1232 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -575,7 +575,7 @@ GEM rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.3) + rubocop-ast (1.32.0) parser (>= 3.3.1.0) rubocop-capybara (2.21.0) rubocop (~> 1.41) @@ -588,7 +588,7 @@ GEM rubocop-ast (>= 1.31.1, < 2.0) rubocop-rake (0.6.0) rubocop (~> 1.0) - rubocop-rspec (3.0.3) + rubocop-rspec (3.0.4) rubocop (~> 1.61) rubocop-rspec_rails (2.30.0) rubocop (~> 1.61) From ba3e3afe52ea9956455b799e944e2dd2645a08d6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2024 07:57:06 +0000 Subject: [PATCH 034/203] Bump oj from 3.16.4 to 3.16.5 Bumps [oj](https://github.com/ohler55/oj) from 3.16.4 to 3.16.5. - [Release notes](https://github.com/ohler55/oj/releases) - [Changelog](https://github.com/ohler55/oj/blob/develop/CHANGELOG.md) - [Commits](https://github.com/ohler55/oj/compare/v3.16.4...v3.16.5) --- updated-dependencies: - dependency-name: oj dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 84bee1232..bd07f825d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -413,8 +413,9 @@ GEM nokogiri (1.16.6-x86_64-linux) racc (~> 1.4) oauth (0.5.6) - oj (3.16.4) + oj (3.16.5) bigdecimal (>= 3.0) + ostruct (>= 0.2) omniauth (1.9.2) hashie (>= 3.4.6) rack (>= 1.6.2, < 3) @@ -428,6 +429,7 @@ GEM omniauth-oauth (~> 1.1) rack orm_adapter (0.5.0) + ostruct (0.6.0) parallel (1.25.1) parser (3.3.4.0) ast (~> 2.4.1) From c24b8b34705bbb598cd321541aa8552c77266946 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2024 07:18:41 +0000 Subject: [PATCH 035/203] Bump rswag-specs from 2.13.0 to 2.14.0 Bumps [rswag-specs](https://github.com/rswag/rswag) from 2.13.0 to 2.14.0. - [Release notes](https://github.com/rswag/rswag/releases) - [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md) - [Commits](https://github.com/rswag/rswag/compare/2.13.0...2.14.0) --- updated-dependencies: - dependency-name: rswag-specs dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index bd07f825d..31fb12557 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -199,7 +199,7 @@ GEM coffee-script-source (1.12.2) comfy_bootstrap_form (4.0.9) rails (>= 5.0.0) - concurrent-ruby (1.3.3) + concurrent-ruby (1.3.4) connection_pool (2.4.1) crass (1.0.6) csv (3.3.0) @@ -339,7 +339,7 @@ GEM railties (>= 4.2.0) thor (>= 0.14, < 2.0) json (2.7.2) - json-schema (4.1.1) + json-schema (4.3.1) addressable (>= 2.8) jsonapi-resources (0.10.7) activerecord (>= 4.1) @@ -388,7 +388,7 @@ GEM mini_magick (4.12.0) mini_mime (1.1.5) mini_portile2 (2.8.7) - minitest (5.24.1) + minitest (5.25.0) moneta (1.0.0) msgpack (1.7.2) multi_json (1.15.0) @@ -407,10 +407,10 @@ GEM net-smtp (0.5.0) net-protocol nio4r (2.7.3) - nokogiri (1.16.6) + nokogiri (1.16.7) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.16.6-x86_64-linux) + nokogiri (1.16.7-x86_64-linux) racc (~> 1.4) oauth (0.5.6) oj (3.16.5) @@ -447,7 +447,7 @@ GEM method_source (~> 1.0) psych (5.1.2) stringio - public_suffix (6.0.0) + public_suffix (6.0.1) puma (6.4.2) nio4r (~> 2.0) query_diet (0.7.1) @@ -558,10 +558,10 @@ GEM rswag-api (2.13.0) activesupport (>= 3.1, < 7.2) railties (>= 3.1, < 7.2) - rswag-specs (2.13.0) - activesupport (>= 3.1, < 7.2) + rswag-specs (2.14.0) + activesupport (>= 5.2, < 8.0) json-schema (>= 2.2, < 5.0) - railties (>= 3.1, < 7.2) + railties (>= 5.2, < 8.0) rspec-core (>= 2.14) rswag-ui (2.13.0) actionpack (>= 3.1, < 7.2) @@ -692,7 +692,7 @@ GEM webrick xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.16) + zeitwerk (2.6.17) PLATFORMS ruby From 6452e67cd745559f6f1636e1f7a46ae4568ea5d4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2024 07:39:01 +0000 Subject: [PATCH 036/203] Bump rswag-ui from 2.13.0 to 2.14.0 Bumps [rswag-ui](https://github.com/rswag/rswag) from 2.13.0 to 2.14.0. - [Release notes](https://github.com/rswag/rswag/releases) - [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md) - [Commits](https://github.com/rswag/rswag/compare/2.13.0...2.14.0) --- updated-dependencies: - dependency-name: rswag-ui dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 31fb12557..e6129661b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -563,9 +563,9 @@ GEM json-schema (>= 2.2, < 5.0) railties (>= 5.2, < 8.0) rspec-core (>= 2.14) - rswag-ui (2.13.0) - actionpack (>= 3.1, < 7.2) - railties (>= 3.1, < 7.2) + rswag-ui (2.14.0) + actionpack (>= 5.2, < 8.0) + railties (>= 5.2, < 8.0) rubocop (1.65.1) json (~> 2.3) language_server-protocol (>= 3.17.0) From dae435548794974d08ecc3ac7a0783210f867606 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2024 07:55:12 +0000 Subject: [PATCH 037/203] Bump rswag-api from 2.13.0 to 2.14.0 Bumps [rswag-api](https://github.com/rswag/rswag) from 2.13.0 to 2.14.0. - [Release notes](https://github.com/rswag/rswag/releases) - [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md) - [Commits](https://github.com/rswag/rswag/compare/2.13.0...2.14.0) --- updated-dependencies: - dependency-name: rswag-api dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e6129661b..1bbaea1a6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -555,9 +555,9 @@ GEM rspectre (0.1.0) parser (>= 3.2.2.1) rspec (~> 3.9) - rswag-api (2.13.0) - activesupport (>= 3.1, < 7.2) - railties (>= 3.1, < 7.2) + rswag-api (2.14.0) + activesupport (>= 5.2, < 8.0) + railties (>= 5.2, < 8.0) rswag-specs (2.14.0) activesupport (>= 5.2, < 8.0) json-schema (>= 2.2, < 5.0) From 4c8cc09fd56476449fb71f326f9d2f0897255d8d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Aug 2024 07:03:39 +0000 Subject: [PATCH 038/203] Bump rspec-rails from 6.1.3 to 6.1.4 Bumps [rspec-rails](https://github.com/rspec/rspec-rails) from 6.1.3 to 6.1.4. - [Changelog](https://github.com/rspec/rspec-rails/blob/main/Changelog.md) - [Commits](https://github.com/rspec/rspec-rails/compare/v6.1.3...v6.1.4) --- updated-dependencies: - dependency-name: rspec-rails dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1bbaea1a6..65f86acd2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -543,7 +543,7 @@ GEM rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-rails (6.1.3) + rspec-rails (6.1.4) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) From f47765642b28adf163e38b7afd578c5e6cab5fd6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Aug 2024 07:36:43 +0000 Subject: [PATCH 039/203] Bump axe-core-rspec from 4.9.1 to 4.10.0 Bumps [axe-core-rspec](https://github.com/dequelabs/axe-core-gems) from 4.9.1 to 4.10.0. - [Release notes](https://github.com/dequelabs/axe-core-gems/releases) - [Changelog](https://github.com/dequelabs/axe-core-gems/blob/v4.10.0/CHANGELOG.md) - [Commits](https://github.com/dequelabs/axe-core-gems/compare/v4.9.1...v4.10.0) --- updated-dependencies: - dependency-name: axe-core-rspec dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 65f86acd2..a30053be4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -122,14 +122,14 @@ GEM ast (2.4.2) autoprefixer-rails (10.4.16.0) execjs (~> 2) - axe-core-api (4.9.1) + axe-core-api (4.10.0) dumb_delegator virtus - axe-core-capybara (4.9.1) - axe-core-api (= 4.9.1) + axe-core-capybara (4.10.0) + axe-core-api (= 4.10.0) dumb_delegator - axe-core-rspec (4.9.1) - axe-core-api (= 4.9.1) + axe-core-rspec (4.10.0) + axe-core-api (= 4.10.0) dumb_delegator virtus axiom-types (0.1.1) From 9b44c649e747737af13419441ace9e4c6c559825 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Aug 2024 20:58:16 +0000 Subject: [PATCH 040/203] Bump rexml from 3.3.4 to 3.3.6 Bumps [rexml](https://github.com/ruby/rexml) from 3.3.4 to 3.3.6. - [Release notes](https://github.com/ruby/rexml/releases) - [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md) - [Commits](https://github.com/ruby/rexml/compare/v3.3.4...v3.3.6) --- updated-dependencies: - dependency-name: rexml dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index a30053be4..e72c9216b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -524,7 +524,7 @@ GEM responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.3.4) + rexml (3.3.6) strscan rouge (4.1.2) rspec (3.13.0) From 159f4558c3e6d6a6da79393af9419026bb9258c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Aug 2024 21:56:56 +0000 Subject: [PATCH 041/203] Bump vcr from 6.2.0 to 6.3.1 Bumps [vcr](https://github.com/vcr/vcr) from 6.2.0 to 6.3.1. - [Release notes](https://github.com/vcr/vcr/releases) - [Changelog](https://github.com/vcr/vcr/blob/master/CHANGELOG.md) - [Commits](https://github.com/vcr/vcr/compare/v6.2.0...v6.3.1) --- updated-dependencies: - dependency-name: vcr dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index e72c9216b..b08f6ba5a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -669,7 +669,8 @@ GEM validate_url (1.0.15) activemodel (>= 3.0.0) public_suffix - vcr (6.2.0) + vcr (6.3.1) + base64 virtus (2.0.0) axiom-types (~> 0.1) coercible (~> 1.0) From 3469ebf44e022fce14ac098defbcd10ca1933c28 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Aug 2024 22:16:19 +0000 Subject: [PATCH 042/203] Bump sidekiq from 7.3.0 to 7.3.1 Bumps [sidekiq](https://github.com/sidekiq/sidekiq) from 7.3.0 to 7.3.1. - [Changelog](https://github.com/sidekiq/sidekiq/blob/main/Changes.md) - [Commits](https://github.com/sidekiq/sidekiq/compare/v7.3.0...v7.3.1) --- updated-dependencies: - dependency-name: sidekiq dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b08f6ba5a..281f5a446 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -624,7 +624,7 @@ GEM rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - sidekiq (7.3.0) + sidekiq (7.3.1) concurrent-ruby (< 2) connection_pool (>= 2.3.0) logger From b10054caebaf0231994bb988693d96d10e677d12 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Aug 2024 22:33:09 +0000 Subject: [PATCH 043/203] Bump chartkick from 5.0.7 to 5.1.0 Bumps [chartkick](https://github.com/ankane/chartkick) from 5.0.7 to 5.1.0. - [Changelog](https://github.com/ankane/chartkick/blob/master/CHANGELOG.md) - [Commits](https://github.com/ankane/chartkick/compare/v5.0.7...v5.1.0) --- updated-dependencies: - dependency-name: chartkick dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 281f5a446..f0a3bef75 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -183,7 +183,7 @@ GEM image_processing (~> 1.1) marcel (~> 1.0.0) ssrf_filter (~> 1.0) - chartkick (5.0.7) + chartkick (5.1.0) childprocess (5.0.0) codeclimate-test-reporter (1.0.9) simplecov (<= 0.13) From 64efea0a8a03abf96379bbe7255f8e2b279cdf0a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Aug 2024 23:22:24 +0000 Subject: [PATCH 044/203] Bump query_diet from 0.7.1 to 0.7.2 Bumps [query_diet](https://github.com/makandra/query_diet) from 0.7.1 to 0.7.2. - [Changelog](https://github.com/makandra/query_diet/blob/master/CHANGELOG.md) - [Commits](https://github.com/makandra/query_diet/compare/v0.7.1...v0.7.2) --- updated-dependencies: - dependency-name: query_diet dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index f0a3bef75..fb4736bbe 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -450,7 +450,7 @@ GEM public_suffix (6.0.1) puma (6.4.2) nio4r (~> 2.0) - query_diet (0.7.1) + query_diet (0.7.2) racc (1.8.1) rack (2.2.9) rack-cors (2.0.2) From 1d07fd8b6ed8fab32bb8c698e70bb6999919c225 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Aug 2024 07:29:08 +0000 Subject: [PATCH 045/203] Bump rails from 7.1.3.4 to 7.1.4 Bumps [rails](https://github.com/rails/rails) from 7.1.3.4 to 7.1.4. - [Release notes](https://github.com/rails/rails/releases) - [Commits](https://github.com/rails/rails/compare/v7.1.3.4...v7.1.4) --- updated-dependencies: - dependency-name: rails dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 110 +++++++++++++++++++++++++-------------------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index fb4736bbe..4437da2d0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -33,35 +33,35 @@ GEM GEM remote: https://rubygems.org/ specs: - actioncable (7.1.3.4) - actionpack (= 7.1.3.4) - activesupport (= 7.1.3.4) + actioncable (7.1.4) + actionpack (= 7.1.4) + activesupport (= 7.1.4) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.3.4) - actionpack (= 7.1.3.4) - activejob (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) + actionmailbox (7.1.4) + actionpack (= 7.1.4) + activejob (= 7.1.4) + activerecord (= 7.1.4) + activestorage (= 7.1.4) + activesupport (= 7.1.4) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.1.3.4) - actionpack (= 7.1.3.4) - actionview (= 7.1.3.4) - activejob (= 7.1.3.4) - activesupport (= 7.1.3.4) + actionmailer (7.1.4) + actionpack (= 7.1.4) + actionview (= 7.1.4) + activejob (= 7.1.4) + activesupport (= 7.1.4) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.2) - actionpack (7.1.3.4) - actionview (= 7.1.3.4) - activesupport (= 7.1.3.4) + actionpack (7.1.4) + actionview (= 7.1.4) + activesupport (= 7.1.4) nokogiri (>= 1.8.5) racc rack (>= 2.2.4) @@ -69,15 +69,15 @@ GEM rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.3.4) - actionpack (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) + actiontext (7.1.4) + actionpack (= 7.1.4) + activerecord (= 7.1.4) + activestorage (= 7.1.4) + activesupport (= 7.1.4) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.3.4) - activesupport (= 7.1.3.4) + actionview (7.1.4) + activesupport (= 7.1.4) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) @@ -92,22 +92,22 @@ GEM active_utils (3.4.1) activesupport (>= 4.2) i18n - activejob (7.1.3.4) - activesupport (= 7.1.3.4) + activejob (7.1.4) + activesupport (= 7.1.4) globalid (>= 0.3.6) - activemodel (7.1.3.4) - activesupport (= 7.1.3.4) - activerecord (7.1.3.4) - activemodel (= 7.1.3.4) - activesupport (= 7.1.3.4) + activemodel (7.1.4) + activesupport (= 7.1.4) + activerecord (7.1.4) + activemodel (= 7.1.4) + activesupport (= 7.1.4) timeout (>= 0.4.0) - activestorage (7.1.3.4) - actionpack (= 7.1.3.4) - activejob (= 7.1.3.4) - activerecord (= 7.1.3.4) - activesupport (= 7.1.3.4) + activestorage (7.1.4) + actionpack (= 7.1.4) + activejob (= 7.1.4) + activerecord (= 7.1.4) + activesupport (= 7.1.4) marcel (~> 1.0) - activesupport (7.1.3.4) + activesupport (7.1.4) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -388,7 +388,7 @@ GEM mini_magick (4.12.0) mini_mime (1.1.5) mini_portile2 (2.8.7) - minitest (5.25.0) + minitest (5.25.1) moneta (1.0.0) msgpack (1.7.2) multi_json (1.15.0) @@ -397,7 +397,7 @@ GEM mutex_m (0.2.0) net-http (0.4.1) uri - net-imap (0.4.11) + net-imap (0.4.14) date net-protocol net-pop (0.1.2) @@ -465,20 +465,20 @@ GEM rackup (1.0.0) rack (< 3) webrick - rails (7.1.3.4) - actioncable (= 7.1.3.4) - actionmailbox (= 7.1.3.4) - actionmailer (= 7.1.3.4) - actionpack (= 7.1.3.4) - actiontext (= 7.1.3.4) - actionview (= 7.1.3.4) - activejob (= 7.1.3.4) - activemodel (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) + rails (7.1.4) + actioncable (= 7.1.4) + actionmailbox (= 7.1.4) + actionmailer (= 7.1.4) + actionpack (= 7.1.4) + actiontext (= 7.1.4) + actionview (= 7.1.4) + activejob (= 7.1.4) + activemodel (= 7.1.4) + activerecord (= 7.1.4) + activestorage (= 7.1.4) + activesupport (= 7.1.4) bundler (>= 1.15.0) - railties (= 7.1.3.4) + railties (= 7.1.4) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -498,9 +498,9 @@ GEM rails_stdout_logging rails_serve_static_assets (0.0.5) rails_stdout_logging (0.0.5) - railties (7.1.3.4) - actionpack (= 7.1.3.4) - activesupport (= 7.1.3.4) + railties (7.1.4) + actionpack (= 7.1.4) + activesupport (= 7.1.4) irb rackup (>= 1.0.0) rake (>= 12.2) From cc2b723cd4aa28c133dcd9d9c27cd9b80ced2417 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 07:17:09 +0000 Subject: [PATCH 046/203] Bump rubocop-rails from 2.25.1 to 2.26.0 Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.25.1 to 2.26.0. - [Release notes](https://github.com/rubocop/rubocop-rails/releases) - [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.25.1...v2.26.0) --- updated-dependencies: - dependency-name: rubocop-rails dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 4437da2d0..219e51f2d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -430,8 +430,8 @@ GEM rack orm_adapter (0.5.0) ostruct (0.6.0) - parallel (1.25.1) - parser (3.3.4.0) + parallel (1.26.3) + parser (3.3.4.2) ast (~> 2.4.1) racc percy-capybara (5.0.0) @@ -577,16 +577,16 @@ GEM rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.32.0) + rubocop-ast (1.32.1) parser (>= 3.3.1.0) rubocop-capybara (2.21.0) rubocop (~> 1.41) rubocop-factory_bot (2.26.1) rubocop (~> 1.61) - rubocop-rails (2.25.1) + rubocop-rails (2.26.0) activesupport (>= 4.2.0) rack (>= 1.1) - rubocop (>= 1.33.0, < 2.0) + rubocop (>= 1.52.0, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) rubocop-rake (0.6.0) rubocop (~> 1.0) From 0046953f731c3d362c6e642ab2d1202a285ff7fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 10:42:18 +0000 Subject: [PATCH 047/203] Bump micromatch from 4.0.5 to 4.0.8 Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.5 to 4.0.8. - [Release notes](https://github.com/micromatch/micromatch/releases) - [Changelog](https://github.com/micromatch/micromatch/blob/4.0.8/CHANGELOG.md) - [Commits](https://github.com/micromatch/micromatch/compare/4.0.5...4.0.8) --- updated-dependencies: - dependency-name: micromatch dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index 3091ab7bb..3982272a8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -291,7 +291,7 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^3.0.2: +braces@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== @@ -1082,11 +1082,11 @@ merge2@^1.3.0, merge2@^1.4.1: integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== micromatch@^4.0.4: - version "4.0.5" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" - integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== + version "4.0.8" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" + integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== dependencies: - braces "^3.0.2" + braces "^3.0.3" picomatch "^2.3.1" mime-db@1.52.0: From 7d203de54d7ec847808f1d24190b45564816873d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2024 07:19:17 +0000 Subject: [PATCH 048/203] Bump faraday from 2.10.1 to 2.11.0 Bumps [faraday](https://github.com/lostisland/faraday) from 2.10.1 to 2.11.0. - [Release notes](https://github.com/lostisland/faraday/releases) - [Changelog](https://github.com/lostisland/faraday/blob/main/CHANGELOG.md) - [Commits](https://github.com/lostisland/faraday/compare/v2.10.1...v2.11.0) --- updated-dependencies: - dependency-name: faraday dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 219e51f2d..4cca20b77 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -255,10 +255,10 @@ GEM railties (>= 5.0.0) faker (3.4.2) i18n (>= 1.8.11, < 2) - faraday (2.10.1) - faraday-net_http (>= 2.0, < 3.2) + faraday (2.11.0) + faraday-net_http (>= 2.0, < 3.4) logger - faraday-net_http (3.1.1) + faraday-net_http (3.3.0) net-http ffi (1.16.3) flickraw (0.9.10) @@ -665,7 +665,7 @@ GEM kgio (~> 2.6) raindrops (~> 0.7) uniform_notifier (1.16.0) - uri (0.13.0) + uri (0.13.1) validate_url (1.0.15) activemodel (>= 3.0.0) public_suffix From 5c206896afb2c50702265132a304237edeba6c36 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 31 Aug 2024 17:43:35 +0930 Subject: [PATCH 049/203] Rails 7.2.1 (#3789) * Rails 7.2.0.beta3 * Rails 7.2.1 * Bump --- Gemfile | 4 +- Gemfile.lock | 137 +++++++++++++++++++++++++-------------------------- 2 files changed, 69 insertions(+), 72 deletions(-) diff --git a/Gemfile b/Gemfile index 5a19c18ae..fc0af803c 100644 --- a/Gemfile +++ b/Gemfile @@ -5,13 +5,13 @@ source 'https://rubygems.org' # Match ruby version in .ruby-version ruby File.read('.ruby-version') -gem 'rails', '~> 7.1.0' +gem 'rails', '~> 7.2.0' # Keeping old sprockets # https://github.com/rails/sprockets-rails/issues/444#issuecomment-637817050 gem "sprockets", "<4" -gem 'bundler', '>= 2.3.10' +gem 'bundler', '>= 2.4.22' gem 'coffee-rails' gem 'haml' diff --git a/Gemfile.lock b/Gemfile.lock index 4cca20b77..b81c1ab29 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -33,51 +33,46 @@ GEM GEM remote: https://rubygems.org/ specs: - actioncable (7.1.4) - actionpack (= 7.1.4) - activesupport (= 7.1.4) + actioncable (7.2.1) + actionpack (= 7.2.1) + activesupport (= 7.2.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.4) - actionpack (= 7.1.4) - activejob (= 7.1.4) - activerecord (= 7.1.4) - activestorage (= 7.1.4) - activesupport (= 7.1.4) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.1.4) - actionpack (= 7.1.4) - actionview (= 7.1.4) - activejob (= 7.1.4) - activesupport (= 7.1.4) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp + actionmailbox (7.2.1) + actionpack (= 7.2.1) + activejob (= 7.2.1) + activerecord (= 7.2.1) + activestorage (= 7.2.1) + activesupport (= 7.2.1) + mail (>= 2.8.0) + actionmailer (7.2.1) + actionpack (= 7.2.1) + actionview (= 7.2.1) + activejob (= 7.2.1) + activesupport (= 7.2.1) + mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (7.1.4) - actionview (= 7.1.4) - activesupport (= 7.1.4) + actionpack (7.2.1) + actionview (= 7.2.1) + activesupport (= 7.2.1) nokogiri (>= 1.8.5) racc - rack (>= 2.2.4) + rack (>= 2.2.4, < 3.2) rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.4) - actionpack (= 7.1.4) - activerecord (= 7.1.4) - activestorage (= 7.1.4) - activesupport (= 7.1.4) + useragent (~> 0.16) + actiontext (7.2.1) + actionpack (= 7.2.1) + activerecord (= 7.2.1) + activestorage (= 7.2.1) + activesupport (= 7.2.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.4) - activesupport (= 7.1.4) + actionview (7.2.1) + activesupport (= 7.2.1) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) @@ -92,31 +87,32 @@ GEM active_utils (3.4.1) activesupport (>= 4.2) i18n - activejob (7.1.4) - activesupport (= 7.1.4) + activejob (7.2.1) + activesupport (= 7.2.1) globalid (>= 0.3.6) - activemodel (7.1.4) - activesupport (= 7.1.4) - activerecord (7.1.4) - activemodel (= 7.1.4) - activesupport (= 7.1.4) + activemodel (7.2.1) + activesupport (= 7.2.1) + activerecord (7.2.1) + activemodel (= 7.2.1) + activesupport (= 7.2.1) timeout (>= 0.4.0) - activestorage (7.1.4) - actionpack (= 7.1.4) - activejob (= 7.1.4) - activerecord (= 7.1.4) - activesupport (= 7.1.4) + activestorage (7.2.1) + actionpack (= 7.2.1) + activejob (= 7.2.1) + activerecord (= 7.2.1) + activesupport (= 7.2.1) marcel (~> 1.0) - activesupport (7.1.4) + activesupport (7.2.1) base64 bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) + concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - mutex_m - tzinfo (~> 2.0) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) ast (2.4.2) @@ -208,7 +204,7 @@ GEM dalli (3.2.8) database_cleaner (2.0.2) database_cleaner-active_record (>= 2, < 3) - database_cleaner-active_record (2.1.0) + database_cleaner-active_record (2.2.0) activerecord (>= 5.a) database_cleaner-core (~> 2.0.0) database_cleaner-core (2.0.1) @@ -394,7 +390,6 @@ GEM multi_json (1.15.0) multi_xml (0.7.1) bigdecimal (~> 3.1) - mutex_m (0.2.0) net-http (0.4.1) uri net-imap (0.4.14) @@ -465,20 +460,20 @@ GEM rackup (1.0.0) rack (< 3) webrick - rails (7.1.4) - actioncable (= 7.1.4) - actionmailbox (= 7.1.4) - actionmailer (= 7.1.4) - actionpack (= 7.1.4) - actiontext (= 7.1.4) - actionview (= 7.1.4) - activejob (= 7.1.4) - activemodel (= 7.1.4) - activerecord (= 7.1.4) - activestorage (= 7.1.4) - activesupport (= 7.1.4) + rails (7.2.1) + actioncable (= 7.2.1) + actionmailbox (= 7.2.1) + actionmailer (= 7.2.1) + actionpack (= 7.2.1) + actiontext (= 7.2.1) + actionview (= 7.2.1) + activejob (= 7.2.1) + activemodel (= 7.2.1) + activerecord (= 7.2.1) + activestorage (= 7.2.1) + activesupport (= 7.2.1) bundler (>= 1.15.0) - railties (= 7.1.4) + railties (= 7.2.1) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -498,10 +493,10 @@ GEM rails_stdout_logging rails_serve_static_assets (0.0.5) rails_stdout_logging (0.0.5) - railties (7.1.4) - actionpack (= 7.1.4) - activesupport (= 7.1.4) - irb + railties (7.2.1) + actionpack (= 7.2.1) + activesupport (= 7.2.1) + irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) @@ -618,6 +613,7 @@ GEM searchkick (5.3.1) activemodel (>= 6.1) hashie + securerandom (0.3.1) selenium-webdriver (4.23.0) base64 (~> 0.2) logger (~> 1.4) @@ -666,6 +662,7 @@ GEM raindrops (~> 0.7) uniform_notifier (1.16.0) uri (0.13.1) + useragent (0.16.10) validate_url (1.0.15) activemodel (>= 3.0.0) public_suffix @@ -712,7 +709,7 @@ DEPENDENCIES bootstrap-datepicker-rails bootstrap_form (>= 4.5.0) bullet - bundler (>= 2.3.10) + bundler (>= 2.4.22) byebug cancancan capybara @@ -771,7 +768,7 @@ DEPENDENCIES query_diet rack-cors rack-protection (>= 2.0.1) - rails (~> 7.1.0) + rails (~> 7.2.0) rails-assets-leaflet.markercluster! rails-controller-testing rails_12factor From a5c5de414e725037fbb7fb38fd9a4dd8d88e505e Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sat, 31 Aug 2024 19:06:45 +0930 Subject: [PATCH 050/203] Update overrides.scss --- app/assets/stylesheets/overrides.scss | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/overrides.scss b/app/assets/stylesheets/overrides.scss index 4db01eb15..116db6012 100755 --- a/app/assets/stylesheets/overrides.scss +++ b/app/assets/stylesheets/overrides.scss @@ -8,6 +8,9 @@ body { font-family: $default-font; } +.navbar { + flex-wrap: nowrap; +} .navbar-brand { .site-name { font-family: "Modak", cursive; @@ -16,7 +19,7 @@ body { } img { - height: 60px; + height: 100%; } } From 3e6953093e4acd889e48dd86fd148456856ec57d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Sep 2024 07:10:05 +0000 Subject: [PATCH 051/203] Bump rspec-rails from 6.1.4 to 7.0.0 Bumps [rspec-rails](https://github.com/rspec/rspec-rails) from 6.1.4 to 7.0.0. - [Changelog](https://github.com/rspec/rspec-rails/blob/main/Changelog.md) - [Commits](https://github.com/rspec/rspec-rails/compare/v6.1.4...v7.0.0) --- updated-dependencies: - dependency-name: rspec-rails dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b81c1ab29..563703ec7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -357,7 +357,7 @@ GEM listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - logger (1.6.0) + logger (1.6.1) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -532,16 +532,16 @@ GEM rspec-mocks (>= 2.99, < 4.0) rspec-core (3.13.0) rspec-support (~> 3.13.0) - rspec-expectations (3.13.1) + rspec-expectations (3.13.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-rails (6.1.4) - actionpack (>= 6.1) - activesupport (>= 6.1) - railties (>= 6.1) + rspec-rails (7.0.0) + actionpack (>= 7.0) + activesupport (>= 7.0) + railties (>= 7.0) rspec-core (~> 3.13) rspec-expectations (~> 3.13) rspec-mocks (~> 3.13) @@ -648,7 +648,7 @@ GEM unicode-display_width (>= 1.1.1, < 3) terser (1.2.3) execjs (>= 0.3.0, < 3) - thor (1.3.1) + thor (1.3.2) thread_safe (0.3.6) tilt (2.4.0) timecop (0.9.10) @@ -690,7 +690,7 @@ GEM webrick xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.17) + zeitwerk (2.6.18) PLATFORMS ruby From 2058f3d73905e0f86c9e41d18253435d441047b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Sep 2024 08:47:49 +0000 Subject: [PATCH 052/203] Bump selenium-webdriver from 4.23.0 to 4.24.0 Bumps [selenium-webdriver](https://github.com/SeleniumHQ/selenium) from 4.23.0 to 4.24.0. - [Release notes](https://github.com/SeleniumHQ/selenium/releases) - [Changelog](https://github.com/SeleniumHQ/selenium/blob/trunk/rb/CHANGES) - [Commits](https://github.com/SeleniumHQ/selenium/compare/selenium-4.23.0...selenium-4.24.0) --- updated-dependencies: - dependency-name: selenium-webdriver dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 563703ec7..894dbebf7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -614,7 +614,7 @@ GEM activemodel (>= 6.1) hashie securerandom (0.3.1) - selenium-webdriver (4.23.0) + selenium-webdriver (4.24.0) base64 (~> 0.2) logger (~> 1.4) rexml (~> 3.2, >= 3.2.5) From 4473059cb144d47b6cd75098b21cc7ebd012a832 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Sep 2024 09:06:19 +0000 Subject: [PATCH 053/203] Bump ruby-units from 4.0.3 to 4.1.0 Bumps [ruby-units](https://github.com/olbrich/ruby-units) from 4.0.3 to 4.1.0. - [Release notes](https://github.com/olbrich/ruby-units/releases) - [Changelog](https://github.com/olbrich/ruby-units/blob/master/CHANGELOG.txt) - [Commits](https://github.com/olbrich/ruby-units/compare/v4.0.3...v4.1.0) --- updated-dependencies: - dependency-name: ruby-units dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 894dbebf7..6bf1fa428 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -591,7 +591,7 @@ GEM rubocop (~> 1.61) rubocop-rspec (~> 3, >= 3.0.1) ruby-progressbar (1.13.0) - ruby-units (4.0.3) + ruby-units (4.1.0) ruby-vips (2.2.1) ffi (~> 1.12) rubyzip (2.3.2) From 81ca9dc964bad744c380a8a8e4b6cc636ada7b3e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Sep 2024 09:24:58 +0000 Subject: [PATCH 054/203] Bump rubocop from 1.65.1 to 1.66.0 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.65.1 to 1.66.0. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.65.1...v1.66.0) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6bf1fa428..506366bae 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -561,18 +561,17 @@ GEM rswag-ui (2.14.0) actionpack (>= 5.2, < 8.0) railties (>= 5.2, < 8.0) - rubocop (1.65.1) + rubocop (1.66.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.4, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.31.1, < 2.0) + rubocop-ast (>= 1.32.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.32.1) + rubocop-ast (1.32.2) parser (>= 3.3.1.0) rubocop-capybara (2.21.0) rubocop (~> 1.41) From 049dd67968fa2a64fa0f8fae2f32fe24d31f2e1f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Sep 2024 08:12:31 +0000 Subject: [PATCH 055/203] Bump sidekiq from 7.3.1 to 7.3.2 Bumps [sidekiq](https://github.com/sidekiq/sidekiq) from 7.3.1 to 7.3.2. - [Changelog](https://github.com/sidekiq/sidekiq/blob/main/Changes.md) - [Commits](https://github.com/sidekiq/sidekiq/compare/v7.3.1...v7.3.2) --- updated-dependencies: - dependency-name: sidekiq dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 506366bae..e25e9f649 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -619,7 +619,7 @@ GEM rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - sidekiq (7.3.1) + sidekiq (7.3.2) concurrent-ruby (< 2) connection_pool (>= 2.3.0) logger From 7c329a4427545dcc5c23c5f175a7474da1882484 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Sep 2024 09:45:00 +0000 Subject: [PATCH 056/203] Bump rspec-rails from 7.0.0 to 7.0.1 Bumps [rspec-rails](https://github.com/rspec/rspec-rails) from 7.0.0 to 7.0.1. - [Changelog](https://github.com/rspec/rspec-rails/blob/main/Changelog.md) - [Commits](https://github.com/rspec/rspec-rails/compare/v7.0.0...v7.0.1) --- updated-dependencies: - dependency-name: rspec-rails dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e25e9f649..11db9f29c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -530,7 +530,7 @@ GEM activemodel (>= 3.0) activesupport (>= 3.0) rspec-mocks (>= 2.99, < 4.0) - rspec-core (3.13.0) + rspec-core (3.13.1) rspec-support (~> 3.13.0) rspec-expectations (3.13.2) diff-lcs (>= 1.2.0, < 2.0) @@ -538,7 +538,7 @@ GEM rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-rails (7.0.0) + rspec-rails (7.0.1) actionpack (>= 7.0) activesupport (>= 7.0) railties (>= 7.0) From 9a23b3a6bf84de877b772e2755933c63d259320b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Sep 2024 10:05:02 +0000 Subject: [PATCH 057/203] Bump rubocop from 1.66.0 to 1.66.1 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.66.0 to 1.66.1. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.66.0...v1.66.1) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 11db9f29c..131e8f509 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -426,7 +426,7 @@ GEM orm_adapter (0.5.0) ostruct (0.6.0) parallel (1.26.3) - parser (3.3.4.2) + parser (3.3.5.0) ast (~> 2.4.1) racc percy-capybara (5.0.0) @@ -561,17 +561,17 @@ GEM rswag-ui (2.14.0) actionpack (>= 5.2, < 8.0) railties (>= 5.2, < 8.0) - rubocop (1.66.0) + rubocop (1.66.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.4, < 3.0) - rubocop-ast (>= 1.32.1, < 2.0) + rubocop-ast (>= 1.32.2, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.32.2) + rubocop-ast (1.32.3) parser (>= 3.3.1.0) rubocop-capybara (2.21.0) rubocop (~> 1.41) From 79ef7347addd9a58aec43d0bd6efc076b0705848 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sun, 8 Sep 2024 02:26:11 +0000 Subject: [PATCH 058/203] Avoid showing plantings which are finished --- app/views/gardens/show.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/gardens/show.html.haml b/app/views/gardens/show.html.haml index 76e071367..56f437a0a 100644 --- a/app/views/gardens/show.html.haml +++ b/app/views/gardens/show.html.haml @@ -40,7 +40,7 @@ Why not = link_to 'tell us more.', edit_garden_path(@garden) - - if @garden.plantings.where.not(planted_at: nil).any? + - if @garden.plantings.active.any? %section.card %h2 Garden progress .card-body From 84edfd29034f115c40a5acda66706303d9a64065 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 07:48:35 +0000 Subject: [PATCH 059/203] Bump rubocop-rails from 2.26.0 to 2.26.1 Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.26.0 to 2.26.1. - [Release notes](https://github.com/rubocop/rubocop-rails/releases) - [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.26.0...v2.26.1) --- updated-dependencies: - dependency-name: rubocop-rails dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 131e8f509..e94e0f7f6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -577,7 +577,7 @@ GEM rubocop (~> 1.41) rubocop-factory_bot (2.26.1) rubocop (~> 1.61) - rubocop-rails (2.26.0) + rubocop-rails (2.26.1) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.52.0, < 2.0) From 8c3f6cb7b30c9476be8c421aef2cbe6a8cc90c31 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 08:14:43 +0000 Subject: [PATCH 060/203] Bump rubocop-rspec from 3.0.4 to 3.0.5 Bumps [rubocop-rspec](https://github.com/rubocop/rubocop-rspec) from 3.0.4 to 3.0.5. - [Release notes](https://github.com/rubocop/rubocop-rspec/releases) - [Changelog](https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-rspec/compare/v3.0.4...v3.0.5) --- updated-dependencies: - dependency-name: rubocop-rspec dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index e94e0f7f6..e5530f510 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -584,7 +584,7 @@ GEM rubocop-ast (>= 1.31.1, < 2.0) rubocop-rake (0.6.0) rubocop (~> 1.0) - rubocop-rspec (3.0.4) + rubocop-rspec (3.0.5) rubocop (~> 1.61) rubocop-rspec_rails (2.30.0) rubocop (~> 1.61) From 15dc687134874c3a2977822e5fa7377e0e9dfbec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 08:35:14 +0000 Subject: [PATCH 061/203] Bump pg from 1.5.7 to 1.5.8 Bumps [pg](https://github.com/ged/ruby-pg) from 1.5.7 to 1.5.8. - [Changelog](https://github.com/ged/ruby-pg/blob/master/History.md) - [Commits](https://github.com/ged/ruby-pg/compare/v1.5.7...v1.5.8) --- updated-dependencies: - dependency-name: pg dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index e5530f510..c997c518f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -431,7 +431,7 @@ GEM racc percy-capybara (5.0.0) capybara (>= 3) - pg (1.5.7) + pg (1.5.8) platform-api (3.7.0) heroics (~> 0.1.1) moneta (~> 1.0.0) From 37aa88790c41bb38411759c3ca994754be76132e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 08:01:37 +0000 Subject: [PATCH 062/203] Bump sprockets from 3.7.3 to 3.7.4 Bumps [sprockets](https://github.com/rails/sprockets) from 3.7.3 to 3.7.4. - [Release notes](https://github.com/rails/sprockets/releases) - [Changelog](https://github.com/rails/sprockets/blob/v3.7.4/CHANGELOG.md) - [Commits](https://github.com/rails/sprockets/compare/v3.7.3...v3.7.4) --- updated-dependencies: - dependency-name: sprockets dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index c997c518f..3bfc71d4a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -630,7 +630,7 @@ GEM json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.2) - sprockets (3.7.3) + sprockets (3.7.4) base64 concurrent-ruby (~> 1.0) rack (> 1, < 3) From 4adcaabf574dc418c5115567505ebb2058a1e421 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 08:43:47 +0000 Subject: [PATCH 063/203] Bump oj from 3.16.5 to 3.16.6 Bumps [oj](https://github.com/ohler55/oj) from 3.16.5 to 3.16.6. - [Release notes](https://github.com/ohler55/oj/releases) - [Changelog](https://github.com/ohler55/oj/blob/develop/CHANGELOG.md) - [Commits](https://github.com/ohler55/oj/compare/v3.16.5...v3.16.6) --- updated-dependencies: - dependency-name: oj dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3bfc71d4a..3c74bf56d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -408,7 +408,7 @@ GEM nokogiri (1.16.7-x86_64-linux) racc (~> 1.4) oauth (0.5.6) - oj (3.16.5) + oj (3.16.6) bigdecimal (>= 3.0) ostruct (>= 0.2) omniauth (1.9.2) From 05a89911f475d12cd95a5e3500619221b1e59bfa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 07:17:13 +0000 Subject: [PATCH 064/203] Bump scout_apm from 5.3.8 to 5.4.0 Bumps [scout_apm](https://github.com/scoutapp/scout_apm_ruby) from 5.3.8 to 5.4.0. - [Changelog](https://github.com/scoutapp/scout_apm_ruby/blob/master/CHANGELOG.markdown) - [Commits](https://github.com/scoutapp/scout_apm_ruby/compare/v5.3.8...v5.4.0) --- updated-dependencies: - dependency-name: scout_apm dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3c74bf56d..075697a46 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -607,7 +607,7 @@ GEM sprockets (> 3.0) sprockets-rails tilt - scout_apm (5.3.8) + scout_apm (5.4.0) parser searchkick (5.3.1) activemodel (>= 6.1) From 79d65c15c67db51110e00cc6ab93f4de99cef497 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2024 07:18:20 +0000 Subject: [PATCH 065/203] Bump puma from 6.4.2 to 6.4.3 Bumps [puma](https://github.com/puma/puma) from 6.4.2 to 6.4.3. - [Release notes](https://github.com/puma/puma/releases) - [Changelog](https://github.com/puma/puma/blob/master/History.md) - [Commits](https://github.com/puma/puma/compare/v6.4.2...v6.4.3) --- updated-dependencies: - dependency-name: puma dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 075697a46..fbfc88de1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -443,7 +443,7 @@ GEM psych (5.1.2) stringio public_suffix (6.0.1) - puma (6.4.2) + puma (6.4.3) nio4r (~> 2.0) query_diet (0.7.2) racc (1.8.1) From d9234e847ba5807e78103db3fb10089026ae0a40 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2024 09:08:39 +0000 Subject: [PATCH 066/203] Bump faraday from 2.11.0 to 2.12.0 Bumps [faraday](https://github.com/lostisland/faraday) from 2.11.0 to 2.12.0. - [Release notes](https://github.com/lostisland/faraday/releases) - [Changelog](https://github.com/lostisland/faraday/blob/main/CHANGELOG.md) - [Commits](https://github.com/lostisland/faraday/compare/v2.11.0...v2.12.0) --- updated-dependencies: - dependency-name: faraday dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index fbfc88de1..deaeaa0c7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -251,8 +251,9 @@ GEM railties (>= 5.0.0) faker (3.4.2) i18n (>= 1.8.11, < 2) - faraday (2.11.0) + faraday (2.12.0) faraday-net_http (>= 2.0, < 3.4) + json logger faraday-net_http (3.3.0) net-http From 373794214bc3a7e66baebdf2cb8e298069f1d3a5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2024 09:29:15 +0000 Subject: [PATCH 067/203] Bump dotenv-rails from 3.1.2 to 3.1.4 Bumps [dotenv-rails](https://github.com/bkeepers/dotenv) from 3.1.2 to 3.1.4. - [Release notes](https://github.com/bkeepers/dotenv/releases) - [Changelog](https://github.com/bkeepers/dotenv/blob/main/Changelog.md) - [Commits](https://github.com/bkeepers/dotenv/compare/v3.1.2...v3.1.4) --- updated-dependencies: - dependency-name: dotenv-rails dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index deaeaa0c7..cc4bc6870 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -221,9 +221,9 @@ GEM discard (1.3.0) activerecord (>= 4.2, < 8) docile (1.1.5) - dotenv (3.1.2) - dotenv-rails (3.1.2) - dotenv (= 3.1.2) + dotenv (3.1.4) + dotenv-rails (3.1.4) + dotenv (= 3.1.4) railties (>= 6.1) drb (2.2.1) dumb_delegator (1.0.0) @@ -308,7 +308,7 @@ GEM csv mini_mime (>= 1.0.0) multi_xml (>= 0.5.2) - i18n (1.14.5) + i18n (1.14.6) concurrent-ruby (~> 1.0) i18n-tasks (1.0.14) activesupport (>= 4.0.2) @@ -515,7 +515,7 @@ GEM redis-client (0.22.2) connection_pool regexp_parser (2.9.2) - reline (0.5.9) + reline (0.5.10) io-console (~> 0.5) responders (3.1.1) actionpack (>= 5.2) From 605605c8e30f423884386a7fad97cd66c6e951ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Sep 2024 07:31:42 +0000 Subject: [PATCH 068/203] Bump sprockets from 3.7.4 to 3.7.5 Bumps [sprockets](https://github.com/rails/sprockets) from 3.7.4 to 3.7.5. - [Release notes](https://github.com/rails/sprockets/releases) - [Changelog](https://github.com/rails/sprockets/blob/v3.7.5/CHANGELOG.md) - [Commits](https://github.com/rails/sprockets/compare/v3.7.4...v3.7.5) --- updated-dependencies: - dependency-name: sprockets dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index cc4bc6870..15b9fdc0d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -631,7 +631,7 @@ GEM json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.2) - sprockets (3.7.4) + sprockets (3.7.5) base64 concurrent-ruby (~> 1.0) rack (> 1, < 3) From 524b74193348e016828d54bb783ed70b6b986a9e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 07:35:49 +0000 Subject: [PATCH 069/203] Bump icalendar from 2.10.2 to 2.10.3 Bumps [icalendar](https://github.com/icalendar/icalendar) from 2.10.2 to 2.10.3. - [Changelog](https://github.com/icalendar/icalendar/blob/main/CHANGELOG.md) - [Commits](https://github.com/icalendar/icalendar/compare/v2.10.2...v2.10.3) --- updated-dependencies: - dependency-name: icalendar dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 15b9fdc0d..564bf9612 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -320,8 +320,9 @@ GEM rails-i18n rainbow (>= 2.2.2, < 4.0) terminal-table (>= 1.5.1) - icalendar (2.10.2) + icalendar (2.10.3) ice_cube (~> 0.16) + ostruct ice_cube (0.17.0) ice_nine (0.11.2) image_processing (1.12.2) From d514109bd6c6af2a21e5ab10a768e51301fb634a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 09:01:36 +0000 Subject: [PATCH 070/203] Bump rubocop-rails from 2.26.1 to 2.26.2 Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.26.1 to 2.26.2. - [Release notes](https://github.com/rubocop/rubocop-rails/releases) - [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.26.1...v2.26.2) --- updated-dependencies: - dependency-name: rubocop-rails dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 564bf9612..ed0055775 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -579,7 +579,7 @@ GEM rubocop (~> 1.41) rubocop-factory_bot (2.26.1) rubocop (~> 1.61) - rubocop-rails (2.26.1) + rubocop-rails (2.26.2) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.52.0, < 2.0) @@ -657,7 +657,7 @@ GEM trollop (1.16.2) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.5.0) + unicode-display_width (2.6.0) unicorn (6.1.0) kgio (~> 2.6) raindrops (~> 0.7) From e634fe76ea50cf99415940452e71e4319801d462 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 21:59:03 +0000 Subject: [PATCH 071/203] Bump selenium-webdriver from 4.24.0 to 4.25.0 Bumps [selenium-webdriver](https://github.com/SeleniumHQ/selenium) from 4.24.0 to 4.25.0. - [Release notes](https://github.com/SeleniumHQ/selenium/releases) - [Changelog](https://github.com/SeleniumHQ/selenium/blob/trunk/rb/CHANGES) - [Commits](https://github.com/SeleniumHQ/selenium/compare/selenium-4.24.0...selenium-4.25.0) --- updated-dependencies: - dependency-name: selenium-webdriver dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ed0055775..30849bf4e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -521,8 +521,7 @@ GEM responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.3.6) - strscan + rexml (3.3.7) rouge (4.1.2) rspec (3.13.0) rspec-core (~> 3.13.0) @@ -615,7 +614,7 @@ GEM activemodel (>= 6.1) hashie securerandom (0.3.1) - selenium-webdriver (4.24.0) + selenium-webdriver (4.25.0) base64 (~> 0.2) logger (~> 1.4) rexml (~> 3.2, >= 3.2.5) @@ -642,7 +641,6 @@ GEM sprockets (>= 3.0.0) ssrf_filter (1.1.2) stringio (3.1.1) - strscan (3.1.0) sysexits (1.2.0) temple (0.10.3) terminal-table (3.0.2) From a07c012051d062b28e849e86e66ec1d5583b382a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 29 Sep 2024 05:11:03 +0000 Subject: [PATCH 072/203] Bump webrick from 1.8.1 to 1.8.2 Bumps [webrick](https://github.com/ruby/webrick) from 1.8.1 to 1.8.2. - [Release notes](https://github.com/ruby/webrick/releases) - [Commits](https://github.com/ruby/webrick/compare/v1.8.1...v1.8.2) --- updated-dependencies: - dependency-name: webrick dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 30849bf4e..fa867332d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -677,7 +677,7 @@ GEM nokogiri (>= 1.2.0) rack (>= 1.0) rack-test (>= 0.5.3) - webrick (1.8.1) + webrick (1.8.2) websocket (1.2.11) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) From 5e8c1f92d112a4735f78347bbfe55a9a93901a0e Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sun, 29 Sep 2024 16:32:34 +0930 Subject: [PATCH 073/203] Delete .github/workflows/brakeman-analysis.yml --- .github/workflows/brakeman-analysis.yml | 40 ------------------------- 1 file changed, 40 deletions(-) delete mode 100644 .github/workflows/brakeman-analysis.yml diff --git a/.github/workflows/brakeman-analysis.yml b/.github/workflows/brakeman-analysis.yml deleted file mode 100644 index 191940f21..000000000 --- a/.github/workflows/brakeman-analysis.yml +++ /dev/null @@ -1,40 +0,0 @@ -# This workflow integrates Brakeman with GitHub's Code Scanning feature -# Brakeman is a static analysis security vulnerability scanner for Ruby on Rails applications - -name: Brakeman Scan - -# This section configures the trigger for the workflow. Feel free to customize depending on your convention -on: - pull_request: - branches: [ dev ] - -jobs: - brakeman-scan: - name: Brakeman Scan - runs-on: ubuntu-latest - steps: - # Checkout the repository to the GitHub Actions runner - - name: Checkout - uses: actions/checkout@v4 - - # Customize the ruby version depending on your needs - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - - - name: Setup Brakeman - env: - BRAKEMAN_VERSION: '5.1.1' # SARIF support is provided in Brakeman version 4.10+ - run: | - gem install brakeman --version $BRAKEMAN_VERSION - - # Execute Brakeman CLI and generate a SARIF output with the security issues identified during the analysis - - name: Scan - continue-on-error: true - run: | - brakeman -f sarif -o output.sarif.json . - - # Upload the SARIF file generated in the previous step - - name: Upload SARIF - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: output.sarif.json From 1113fc7c979425f9d4f8d061bb5081876d2fd4b7 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sun, 29 Sep 2024 16:36:02 +0930 Subject: [PATCH 074/203] Update dependabot.yml --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4d73c4002..ad3efeb5f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -13,3 +13,9 @@ updates: interval: daily time: "07:00" open-pull-requests-limit: 10 +- package-ecosystem: yarn + directory: "/" + schedule: + interval: daily + time: "07:00" + open-pull-requests-limit: 10 From 092920b5f83ae438c378c68cbe05c6061cd997f5 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sun, 29 Sep 2024 16:37:25 +0930 Subject: [PATCH 075/203] Update dependabot.yml Apparently, https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem is wrong --- .github/dependabot.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ad3efeb5f..9b538e89c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -13,9 +13,4 @@ updates: interval: daily time: "07:00" open-pull-requests-limit: 10 -- package-ecosystem: yarn - directory: "/" - schedule: - interval: daily - time: "07:00" - open-pull-requests-limit: 10 + From 5b9a59e2cdf544fcf123e1a9566839d5a04ebe68 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 29 Sep 2024 07:08:40 +0000 Subject: [PATCH 076/203] Bump haml_lint from 0.58.0 to 0.59.0 Bumps [haml_lint](https://github.com/sds/haml-lint) from 0.58.0 to 0.59.0. - [Release notes](https://github.com/sds/haml-lint/releases) - [Changelog](https://github.com/sds/haml-lint/blob/main/CHANGELOG.md) - [Commits](https://github.com/sds/haml-lint/compare/v0.58.0...v0.59.0) --- updated-dependencies: - dependency-name: haml_lint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index fa867332d..7a90ae62c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -290,7 +290,7 @@ GEM activesupport (>= 5.1) haml (>= 4.0.6) railties (>= 5.1) - haml_lint (0.58.0) + haml_lint (0.59.0) haml (>= 5.0) parallel (~> 1.10) rainbow From c063a33e8b3e5ae447bc4a6fb326a007c9a2fe12 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sun, 29 Sep 2024 18:28:42 +0930 Subject: [PATCH 077/203] Garden show and edit: encourage descriptions, add more calls to action (#3846) * Better edit links * Prompt for more detail * Better action links * Better action links * Update show.html.haml * Apply suggestions from code review * Apply suggestions from code review --- app/views/gardens/_form.html.haml | 2 +- app/views/gardens/show.html.haml | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/views/gardens/_form.html.haml b/app/views/gardens/_form.html.haml index 8ab82bc9b..9692ac4d0 100644 --- a/app/views/gardens/_form.html.haml +++ b/app/views/gardens/_form.html.haml @@ -16,7 +16,7 @@ %li= msg = f.text_field :name, maxlength: 255, required: true - = f.text_area :description, rows: 6 + = f.text_area :description, rows: 6, placeholder: "Tell us about this garden - where is it located? What does it look like? Do you have a link to a photo? Do you have irrigation? What are your plans?" = f.text_field :location, value: @garden.location || current_member.location, class: 'form-control', maxlength: 255 diff --git a/app/views/gardens/show.html.haml b/app/views/gardens/show.html.haml index 56f437a0a..dbe863356 100644 --- a/app/views/gardens/show.html.haml +++ b/app/views/gardens/show.html.haml @@ -31,7 +31,7 @@ %p :markdown #{strip_tags markdownify(@garden.description)} - - unless @garden.description + - unless @garden.description.present? .row-fluid %p No description available yet. @@ -39,6 +39,11 @@ %p Why not = link_to 'tell us more.', edit_garden_path(@garden) + - else + - if can? :edit, @garden + %p + Did you want to + = link_to 'update this description.', edit_garden_path(@garden) - if @garden.plantings.active.any? %section.card @@ -55,6 +60,14 @@ - else .col-md-12 %p Nothing is currently planted here. + - if can?(:edit, @garden) + .col-md-12 + = garden_plant_something_button(@garden) + + - if can?(:destroy, @garden) + .dropdown-divider + = delete_button(@garden, classes: 'dropdown-item text-danger', + message: 'All plantings associated with this garden will also be deleted. Are you sure?') %section %h2 Current activities in garden @@ -65,6 +78,9 @@ - else .col-md-12 %p Nothing is currently planned here. + - if can?(:edit, @garden) + .col-md-12 + = garden_plan_something_button(@garden) - if @suggested_companions.any? %section.companions From 1c97ba1495d9ef55b613750378bb758dbbef25d6 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sun, 29 Sep 2024 18:28:52 +0930 Subject: [PATCH 078/203] Garden collaboration (small part of community gardens) (#3862) * Add collaboration model * Permissions and garden show * List by owner, or where I am a collaborator * Add index * Add permissions * Typo * Typo * Add route * Update schema * Update schema * Add CRUD * Add CRUD * Add CRUD * Factory * Add validations * Rubocop * Rubocop * Rubocop * Unique index * Fix * Make CI more fine grained for faster feedback * Swap order * Fix path, fail-fast * Fix spec * Remove 'significant drop in coverage' as not everything runs in one giant run * Fix tests? --- .github/workflows/ci.yml | 28 +++++- .rubocop_todo.yml | 2 +- .../garden_collaborators_controller.rb | 87 +++++++++++++++++++ app/controllers/gardens_controller.rb | 5 +- app/models/ability.rb | 22 +++++ app/models/garden.rb | 1 + app/models/garden_collaborator.rb | 24 +++++ app/models/harvest.rb | 5 +- app/models/planting.rb | 5 +- .../garden_collaborators/_form.html.haml | 19 ++++ app/views/garden_collaborators/edit.html.haml | 3 + .../garden_collaborators/index.html.haml | 72 +++++++++++++++ app/views/garden_collaborators/new.html.haml | 3 + app/views/garden_collaborators/show.html.haml | 0 app/views/gardens/show.html.haml | 11 +++ config/routes.rb | 2 + ...40929041435_create_garden_collaborators.rb | 10 +++ db/schema.rb | 63 +++----------- spec/factories/garden_collaborators.rb | 6 ++ spec/rails_helper.rb | 3 - 20 files changed, 309 insertions(+), 62 deletions(-) create mode 100644 app/controllers/garden_collaborators_controller.rb create mode 100644 app/models/garden_collaborator.rb create mode 100644 app/views/garden_collaborators/_form.html.haml create mode 100644 app/views/garden_collaborators/edit.html.haml create mode 100644 app/views/garden_collaborators/index.html.haml create mode 100644 app/views/garden_collaborators/new.html.haml create mode 100644 app/views/garden_collaborators/show.html.haml create mode 100644 db/migrate/20240929041435_create_garden_collaborators.rb create mode 100644 spec/factories/garden_collaborators.rb diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 167bc6020..4b5f42866 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,15 +106,37 @@ jobs: - name: Prepare database for testing run: bundle exec rails db:prepare - + + + - name: Run rspec (lib) + run: bundle exec rspec spec/lib/ -fd --fail-fast + + - name: Run rspec (services) + run: bundle exec rspec spec/services/ -fd --fail-fast + + - name: Run rspec (models) + run: bundle exec rspec spec/models/ -fd --fail-fast + + - name: Run rspec (controllers) + run: bundle exec rspec spec/controllers/ -fd --fail-fast + + - name: Run rspec (views) + run: bundle exec rspec spec/views/ -fd --fail-fast + + - name: Run rspec (routing) + run: bundle exec rspec spec/routing/ -fd --fail-fast + + - name: Run rspec (request) + run: bundle exec rspec spec/requests/ -fd --fail-fast + - name: precompile assets run: bundle exec rails assets:precompile - + - name: index into elastic search run: bundle exec rails search:reindex - name: Run rspec (report results to Percy.io and CodeClimate) - run: bundle exec rspec spec -fd + run: bundle exec rspec spec/features/ -fd --fail-fast - name: Report to code climate run: | diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 336d1041b..3195873c1 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -158,7 +158,7 @@ Metrics/BlockLength: # Offense count: 7 # Configuration parameters: CountComments, CountAsOne. Metrics/ClassLength: - Max: 183 + Max: 188 # Offense count: 6 # Configuration parameters: AllowedMethods, AllowedPatterns. diff --git a/app/controllers/garden_collaborators_controller.rb b/app/controllers/garden_collaborators_controller.rb new file mode 100644 index 000000000..50804e288 --- /dev/null +++ b/app/controllers/garden_collaborators_controller.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +class GardenCollaboratorsController < ApplicationController + before_action :authenticate_member!, except: %i(index show) + before_action :load_garden + load_and_authorize_resource id_param: :slug + + respond_to :html + responders :flash + + def index + @garden_collaborators = @garden.garden_collaborators.paginate(page: params[:page]) + respond_with(@garden_collaborators) + end + + def show + @garden_collaborator = GardenCollaborator.find(params[:garden_collaborator_id]) + + respond_with(@garden_collaborator) + end + + def new + @garden_collaborator = GardenCollaborator.new(garden: @garden) + + authorize! :create, @garden_collaborator + + respond_with(@garden_collaborator) + end + + def edit + @garden_collaborator = GardenCollaborator.find(params[:id]) + + authorize! :update, @garden_collaborator + + respond_with(@garden_collaborator) + end + + def create + @garden_collaborator = GardenCollaborator.new(garden: @garden) + authorize! :create, @garden_collaborator + + @member = Member.find_by(slug: params[:garden_collaborator][:member_slug]) + + @garden_collaborator.member = @member + if @garden_collaborator.save + redirect_to garden_garden_collaborators_path(@garden) + else + respond_with(@garden_collaborator) + end + end + + def update + @garden_collaborator = GardenCollaborator.find(params[:id]) + authorize! :update, @garden_collaborator + + @member = Member.find_by(slug: params[:garden_collaborator][:member_slug]) + + @garden_collaborator.member = @member + @garden_collaborator.save + + respond_with(@garden_collaborator) + end + + def destroy + @garden_collaborator = GardenCollaborator.find(params[:id]) + + authorize! :destroy, @garden_collaborator + + if @garden_collaborator.destroy + redirect_to garden_garden_collaborators_path(@garden) + else + respond_with(@garden_collaborator) + end + end + + private + + def load_garden + @garden = Garden.find_by(slug: params[:garden_slug]) + end + + def garden_collaborator_params + params.require(:garden_collaborator).permit( + :member_slug + ) + end +end diff --git a/app/controllers/gardens_controller.rb b/app/controllers/gardens_controller.rb index 8fc3be890..cfca79acb 100644 --- a/app/controllers/gardens_controller.rb +++ b/app/controllers/gardens_controller.rb @@ -8,7 +8,10 @@ class GardensController < DataController @gardens = @gardens.includes(:owner) @gardens = @gardens.active unless @show_all - @gardens = @gardens.where(owner: @owner) if @owner.present? + if @owner.present? + @gardens = @gardens.left_joins(:garden_collaborators) + @gardens = @gardens.where(owner: @owner).or(@gardens.where(garden_collaborators: { member: @owner })) + end @gardens = @gardens.where.not(members: { confirmed_at: nil }) .order(:name).paginate(page: params[:page]) respond_with(@gardens) diff --git a/app/models/ability.rb b/app/models/ability.rb index c8118085e..7c32ea241 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -108,16 +108,38 @@ class Ability can :create, Planting can :update, Planting, garden: { owner_id: member.id }, crop: { approval_status: 'approved' } can :destroy, Planting, garden: { owner_id: member.id }, crop: { approval_status: 'approved' } + can :update, Planting do |planting| + planting.garden.garden_collaborators.where(member_id: member.id).any? + end + can :destroy, Planting do |planting| + planting.garden.garden_collaborators.where(member_id: member.id).any? + end + + can :create, GardenCollaborator, garden: { owner_id: member.id } + can :update, GardenCollaborator, garden: { owner_id: member.id } + can :destroy, GardenCollaborator, garden: { owner_id: member.id } can :create, Activity can :update, Activity, owner_id: member.id can :destroy, Activity, owner_id: member.id + can :update, Activity do |activity| + activity.garden&.garden_collaborators&.where(member_id: member.id)&.any? + end + can :destroy, Activity do |activity| + activity.garden&.garden_collaborators&.where(member_id: member.id)&.any? + end can :create, Harvest can :update, Harvest, owner_id: member.id can :destroy, Harvest, owner_id: member.id can :update, Harvest, owner_id: member.id, planting: { owner_id: member.id } can :destroy, Harvest, owner_id: member.id, planting: { owner_id: member.id } + can :update, Harvest do |harvest| + harvest.planting&.garden&.garden_collaborators&.where(member_id: member.id)&.any? + end + can :destroy, Harvest do |harvest| + harvest.planting&.garden&.garden_collaborators&.where(member_id: member.id)&.any? + end can :create, Photo can :update, Photo, owner_id: member.id diff --git a/app/models/garden.rb b/app/models/garden.rb index cb6c3c95f..5ef0adea3 100644 --- a/app/models/garden.rb +++ b/app/models/garden.rb @@ -10,6 +10,7 @@ class Garden < ApplicationRecord has_many :plantings, dependent: :destroy has_many :crops, through: :plantings has_many :activities, dependent: :destroy + has_many :garden_collaborators, dependent: :destroy belongs_to :garden_type, optional: true diff --git a/app/models/garden_collaborator.rb b/app/models/garden_collaborator.rb new file mode 100644 index 000000000..520303437 --- /dev/null +++ b/app/models/garden_collaborator.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class GardenCollaborator < ApplicationRecord + belongs_to :member + belongs_to :garden + + validates :member_id, uniqueness: { scope: :garden } + validate :not_garden_owner + + def not_garden_owner + return unless member + return unless garden + + errors.add(:member_id, "cannot be the garden owner") if garden.owner == member + end + + def member_slug + @member&.slug + end + + def member_slug=(_slug) + member_slug + end +end diff --git a/app/models/harvest.rb b/app/models/harvest.rb index 29069c75f..7fba64bc8 100644 --- a/app/models/harvest.rb +++ b/app/models/harvest.rb @@ -153,7 +153,10 @@ class Harvest < ApplicationRecord def owner_must_match_planting return if planting.blank? # only check if we are linked to a planting - errors.add(:owner, "of harvest must be the same as planting") unless owner == planting.owner + return if owner == planting.owner || planting.garden.garden_collaborators.where(member_id: owner).any? + + errors.add(:owner, + "of harvest must be the same as planting, or a collaborator on that garden") end def harvest_must_be_after_planting diff --git a/app/models/planting.rb b/app/models/planting.rb index 9955a4345..134908ad8 100644 --- a/app/models/planting.rb +++ b/app/models/planting.rb @@ -127,6 +127,9 @@ class Planting < ApplicationRecord end def owner_must_match_garden_owner - errors.add(:owner, "must be the same as garden") unless owner == garden.owner + return if owner == garden.owner || garden.garden_collaborators.where(member_id: owner).any? + + errors.add(:owner, + "must be the same as garden, or a collaborator on that garden") end end diff --git a/app/views/garden_collaborators/_form.html.haml b/app/views/garden_collaborators/_form.html.haml new file mode 100644 index 000000000..88483ecab --- /dev/null +++ b/app/views/garden_collaborators/_form.html.haml @@ -0,0 +1,19 @@ +.card.col-md-8.col-lg-7.mx-auto.float-none.white.z-depth-1.py-2.px-2 + = bootstrap_form_for(@garden_collaborator.new_record? ? [@garden, @garden_collaborator] : garden_garden_collaborator_path(@garden, @garden_collaborator)) do |f| + .card-body + = required_field_help_text + - if @garden_collaborator.errors.any? + #error_explanation.alert.alert-warning{:role => "alert"} + %h4.alert-heading + = pluralize(@garden_collaborator.errors.size, "error") + prohibited this garden collaborator from being saved + %ul + - @garden_collaborator.errors.full_messages.each do |msg| + %li= msg + + .alert.alert-info + Ask your friend, family member or community garden member for their growstuff username to add them as a collaborator on your garden. + = f.text_field :member_slug, maxlength: 255, required: true + .row + .card-footer + .text-right= f.submit 'Save Collaboator' diff --git a/app/views/garden_collaborators/edit.html.haml b/app/views/garden_collaborators/edit.html.haml new file mode 100644 index 000000000..8993e192b --- /dev/null +++ b/app/views/garden_collaborators/edit.html.haml @@ -0,0 +1,3 @@ +- content_for :title, "Edit garden collaborator" + += render 'form' \ No newline at end of file diff --git a/app/views/garden_collaborators/index.html.haml b/app/views/garden_collaborators/index.html.haml new file mode 100644 index 000000000..6f9fec3f2 --- /dev/null +++ b/app/views/garden_collaborators/index.html.haml @@ -0,0 +1,72 @@ +- content_for :title, "#{@garden} collaborators" + +%h1= "#{@garden} collaborators" + +- content_for :breadcrumbs do + %li.breadcrumb-item= link_to 'Gardens', gardens_path + %li.breadcrumb-item.active= link_to @garden, gardens_path(@garden) + +.row + .col-md-2 + - if current_member.present? + .flex-column.nav-pills.layout-nav{"role" => "tablist", "aria-orientation"=>"vertical"} + - if can?(:create, GardenCollaborator.new(garden: @garden)) + = link_to url_for([@garden, GardenCollaborator.new(garden: @garden), action: :new]), class: 'btn' do + Add a #{GardenCollaborator.new(garden: @garden).model_name.human} + - else + = render 'shared/signin_signup', to: "record your #{model.to_s.pluralize.downcase}" + + %hr/ + %p.text-center + #{ENV['GROWSTUFF_SITE_NAME']} helps you track what you're + harvesting from your home garden and see how productive it is. + + + .col-md-10 + - if @garden_collaborators.empty? + %p There are no collaborators to display. + - if can?(:create, GardenCollaborator) && @owner == current_member + = link_to 'Add a garden collaborator', new_garden_garden_collaborator_path, class: 'btn btn-primary' + + - else + %section + %h2= page_entries_info @garden_collaborators + = will_paginate @garden_collaborators + + - @garden_collaborators.each do |garden_collaborator| + - member = garden_collaborator.member + - cache member do + .card + .card-body + - if can?(:destroy, garden_collaborator) + %div{"style": "float: right"} + = link_to garden_garden_collaborator_path(@garden, garden_collaborator), method: :delete, class: "btn btn-danger" do + Remove access + + %h4.login-name= link_to member, member + %div + = render "members/avatar", member: member + %div + = link_to "view all #{member}'s gardens", member_gardens_path(member) + %p + %small + Joined + = distance_of_time_in_words(member.created_at, Time.zone.now) + ago. + - if member.location.present? + = link_to member.location, place_path(member.location) + .card-footer + %ul.nav.nav-justified.small + %li.nav-item.border-right + = link_to member_plantings_path(member) do + = localize_plural(member.plantings.active, Planting) + %li.nav-item.border-right + = link_to member_harvests_path(member) do + = localize_plural(member.harvests, Harvest) + %li.nav-item + = link_to member_seeds_path(member) do + = localize_plural(member.seeds.active, Seed) + + .row + .col-12= page_entries_info @garden_collaborators + .col-12= will_paginate @garden_collaborators diff --git a/app/views/garden_collaborators/new.html.haml b/app/views/garden_collaborators/new.html.haml new file mode 100644 index 000000000..9b5580903 --- /dev/null +++ b/app/views/garden_collaborators/new.html.haml @@ -0,0 +1,3 @@ +- content_for :title, "New garden collaborator" + += render 'form' diff --git a/app/views/garden_collaborators/show.html.haml b/app/views/garden_collaborators/show.html.haml new file mode 100644 index 000000000..e69de29bb diff --git a/app/views/gardens/show.html.haml b/app/views/gardens/show.html.haml index dbe863356..33934d87c 100644 --- a/app/views/gardens/show.html.haml +++ b/app/views/gardens/show.html.haml @@ -99,6 +99,17 @@ %p %strong Owner: = link_to @garden.owner, @garden.owner + %p + %strong Collaborators: + - if can?(:create, GardenCollaborator.new(garden: @garden)) + = link_to "Manage", garden_garden_collaborators_path(@garden) + - if @garden.garden_collaborators.any? + %ul + - @garden.garden_collaborators.each do |collabator| + %li= link_to collabator.member, collabator.member + - else + None + - if @garden.location.present? %p %strong Location: diff --git a/config/routes.rb b/config/routes.rb index 7b29b36e0..1e689a37c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -30,6 +30,8 @@ Rails.application.routes.draw do resources :gardens, concerns: :has_photos, param: :slug do get 'timeline' => 'charts/gardens#timeline', constraints: { format: 'json' } + + resources :garden_collaborators end resources :plantings, concerns: :has_photos, param: :slug do diff --git a/db/migrate/20240929041435_create_garden_collaborators.rb b/db/migrate/20240929041435_create_garden_collaborators.rb new file mode 100644 index 000000000..3b70b642a --- /dev/null +++ b/db/migrate/20240929041435_create_garden_collaborators.rb @@ -0,0 +1,10 @@ +class CreateGardenCollaborators < ActiveRecord::Migration[7.2] + def change + create_table :garden_collaborators do |t| + t.references :member + t.references :garden + t.timestamps + t.index [:member_id, :garden_id], unique: true + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 81cdec75f..44f298856 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.1].define(version: 2024_07_14_024918) do +ActiveRecord::Schema[7.2].define(version: 2024_09_29_041435) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -54,13 +54,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_07_14_024918) do t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "slug" - t.integer "cached_votes_total", default: 0 - t.integer "cached_votes_score", default: 0 - t.integer "cached_votes_up", default: 0 - t.integer "cached_votes_down", default: 0 - t.integer "cached_weighted_score", default: 0 - t.integer "cached_weighted_total", default: 0 - t.float "cached_weighted_average", default: 0.0 t.integer "likes_count", default: 0 t.index ["garden_id"], name: "index_activities_on_garden_id" t.index ["owner_id"], name: "index_activities_on_owner_id" @@ -214,13 +207,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_07_14_024918) do t.text "body", null: false t.datetime "created_at", precision: nil t.datetime "updated_at", precision: nil - t.integer "cached_votes_total", default: 0 - t.integer "cached_votes_score", default: 0 - t.integer "cached_votes_up", default: 0 - t.integer "cached_votes_down", default: 0 - t.integer "cached_weighted_score", default: 0 - t.integer "cached_weighted_total", default: 0 - t.float "cached_weighted_average", default: 0.0 end create_table "crop_companions", force: :cascade do |t| @@ -280,6 +266,16 @@ ActiveRecord::Schema[7.1].define(version: 2024_07_14_024918) do t.index ["slug"], name: "index_forums_on_slug", unique: true end + create_table "garden_collaborators", force: :cascade do |t| + t.bigint "member_id" + t.bigint "garden_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["garden_id"], name: "index_garden_collaborators_on_garden_id" + t.index ["member_id", "garden_id"], name: "index_garden_collaborators_on_member_id_and_garden_id", unique: true + t.index ["member_id"], name: "index_garden_collaborators_on_member_id" + end + create_table "garden_types", force: :cascade do |t| t.text "name", null: false t.text "slug", null: false @@ -504,13 +500,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_07_14_024918) do t.datetime "date_taken", precision: nil t.integer "likes_count", default: 0 t.string "source" - t.integer "cached_votes_total", default: 0 - t.integer "cached_votes_score", default: 0 - t.integer "cached_votes_up", default: 0 - t.integer "cached_votes_down", default: 0 - t.integer "cached_weighted_score", default: 0 - t.integer "cached_weighted_total", default: 0 - t.float "cached_weighted_average", default: 0.0 t.index ["fullsize_url"], name: "index_photos_on_fullsize_url", unique: true t.index ["thumbnail_url"], name: "index_photos_on_thumbnail_url", unique: true end @@ -553,13 +542,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_07_14_024918) do t.integer "days_to_last_harvest" t.integer "parent_seed_id" t.integer "harvests_count", default: 0 - t.integer "cached_votes_total", default: 0 - t.integer "cached_votes_score", default: 0 - t.integer "cached_votes_up", default: 0 - t.integer "cached_votes_down", default: 0 - t.integer "cached_weighted_score", default: 0 - t.integer "cached_weighted_total", default: 0 - t.float "cached_weighted_average", default: 0.0 t.integer "likes_count", default: 0 t.index ["slug"], name: "index_plantings_on_slug", unique: true end @@ -574,13 +556,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_07_14_024918) do t.integer "forum_id" t.integer "likes_count", default: 0 t.integer "comments_count", default: 0 - t.integer "cached_votes_total", default: 0 - t.integer "cached_votes_score", default: 0 - t.integer "cached_votes_up", default: 0 - t.integer "cached_votes_down", default: 0 - t.integer "cached_weighted_score", default: 0 - t.integer "cached_weighted_total", default: 0 - t.float "cached_weighted_average", default: 0.0 t.index ["created_at", "author_id"], name: "index_posts_on_created_at_and_author_id" t.index ["slug"], name: "index_posts_on_slug", unique: true end @@ -628,22 +603,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_07_14_024918) do t.index ["slug"], name: "index_seeds_on_slug", unique: true end - create_table "votes", force: :cascade do |t| - t.string "votable_type" - t.bigint "votable_id" - t.string "voter_type" - t.bigint "voter_id" - t.boolean "vote_flag" - t.string "vote_scope" - t.integer "vote_weight" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["votable_id", "votable_type", "vote_scope"], name: "index_votes_on_votable_id_and_votable_type_and_vote_scope" - t.index ["votable_type", "votable_id"], name: "index_votes_on_votable" - t.index ["voter_id", "voter_type", "vote_scope"], name: "index_votes_on_voter_id_and_voter_type_and_vote_scope" - t.index ["voter_type", "voter_id"], name: "index_votes_on_voter" - end - add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id" add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id" add_foreign_key "harvests", "plantings" diff --git a/spec/factories/garden_collaborators.rb b/spec/factories/garden_collaborators.rb new file mode 100644 index 000000000..20cabd2e9 --- /dev/null +++ b/spec/factories/garden_collaborators.rb @@ -0,0 +1,6 @@ +FactoryBot.define do + factory :garden_collaborator do + garden + member + end +end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 2dfc3a2e7..40b8bf001 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -7,9 +7,6 @@ require 'simplecov' # output coverage locally AND send it to coveralls SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([SimpleCov::Formatter::HTMLFormatter]) -# fail if there's a significant test coverage drop -SimpleCov.maximum_coverage_drop 1 - require 'spec_helper' require File.expand_path('../config/environment', __dir__) require 'rspec/rails' From 0bfa4e4c857b05728c1cc9ec887ea692703974e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Oct 2024 07:12:36 +0000 Subject: [PATCH 079/203] Bump rspec-activemodel-mocks from 1.2.0 to 1.2.1 Bumps [rspec-activemodel-mocks](https://github.com/rspec/rspec-activemodel-mocks) from 1.2.0 to 1.2.1. - [Changelog](https://github.com/rspec/rspec-activemodel-mocks/blob/main/CHANGELOG.md) - [Commits](https://github.com/rspec/rspec-activemodel-mocks/compare/v1.2.0...v1.2.1) --- updated-dependencies: - dependency-name: rspec-activemodel-mocks dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 7a90ae62c..0eb431300 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -527,7 +527,7 @@ GEM rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) - rspec-activemodel-mocks (1.2.0) + rspec-activemodel-mocks (1.2.1) activemodel (>= 3.0) activesupport (>= 3.0) rspec-mocks (>= 2.99, < 4.0) @@ -536,7 +536,7 @@ GEM rspec-expectations (3.13.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-mocks (3.13.1) + rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-rails (7.0.1) From 2c8d0c2d2ff0f1ccf3234bb929afb32cf98d3367 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Oct 2024 09:54:01 +0000 Subject: [PATCH 080/203] Bump rubocop-rspec from 3.0.5 to 3.1.0 Bumps [rubocop-rspec](https://github.com/rubocop/rubocop-rspec) from 3.0.5 to 3.1.0. - [Release notes](https://github.com/rubocop/rubocop-rspec/releases) - [Changelog](https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-rspec/compare/v3.0.5...v3.1.0) --- updated-dependencies: - dependency-name: rubocop-rspec dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0eb431300..163aadf7e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -585,7 +585,7 @@ GEM rubocop-ast (>= 1.31.1, < 2.0) rubocop-rake (0.6.0) rubocop (~> 1.0) - rubocop-rspec (3.0.5) + rubocop-rspec (3.1.0) rubocop (~> 1.61) rubocop-rspec_rails (2.30.0) rubocop (~> 1.61) From ac22af47183805c763771e1baf6d565adb216b56 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 07:11:41 +0000 Subject: [PATCH 081/203] Bump rswag-specs from 2.14.0 to 2.15.0 Bumps [rswag-specs](https://github.com/rswag/rswag) from 2.14.0 to 2.15.0. - [Release notes](https://github.com/rswag/rswag/releases) - [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md) - [Commits](https://github.com/rswag/rswag/compare/2.14.0...2.15.0) --- updated-dependencies: - dependency-name: rswag-specs dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 163aadf7e..74c07cd0a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -329,7 +329,7 @@ GEM mini_magick (>= 4.9.5, < 5) ruby-vips (>= 2.0.17, < 3) io-console (0.7.2) - irb (1.14.0) + irb (1.14.1) rdoc (>= 4.0.0) reline (>= 0.4.2) jquery-rails (4.6.0) @@ -337,8 +337,8 @@ GEM railties (>= 4.2.0) thor (>= 0.14, < 2.0) json (2.7.2) - json-schema (4.3.1) - addressable (>= 2.8) + json-schema (5.0.1) + addressable (~> 2.8) jsonapi-resources (0.10.7) activerecord (>= 4.1) concurrent-ruby @@ -554,9 +554,9 @@ GEM rswag-api (2.14.0) activesupport (>= 5.2, < 8.0) railties (>= 5.2, < 8.0) - rswag-specs (2.14.0) + rswag-specs (2.15.0) activesupport (>= 5.2, < 8.0) - json-schema (>= 2.2, < 5.0) + json-schema (>= 2.2, < 6.0) railties (>= 5.2, < 8.0) rspec-core (>= 2.14) rswag-ui (2.14.0) From 28fe8466458e176e7a40f6a2e5b814b1a8dd50a5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 10:36:51 +0000 Subject: [PATCH 082/203] Bump msgpack from 1.7.2 to 1.7.3 Bumps [msgpack](https://github.com/msgpack/msgpack-ruby) from 1.7.2 to 1.7.3. - [Changelog](https://github.com/msgpack/msgpack-ruby/blob/master/ChangeLog) - [Commits](https://github.com/msgpack/msgpack-ruby/compare/v1.7.2...v1.7.3) --- updated-dependencies: - dependency-name: msgpack dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 74c07cd0a..f1850bc37 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -388,7 +388,7 @@ GEM mini_portile2 (2.8.7) minitest (5.25.1) moneta (1.0.0) - msgpack (1.7.2) + msgpack (1.7.3) multi_json (1.15.0) multi_xml (0.7.1) bigdecimal (~> 3.1) From e6069168b96d3fbad58089f575bf4a22a903b385 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 10:55:47 +0000 Subject: [PATCH 083/203] Bump rswag-ui from 2.14.0 to 2.15.0 Bumps [rswag-ui](https://github.com/rswag/rswag) from 2.14.0 to 2.15.0. - [Release notes](https://github.com/rswag/rswag/releases) - [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md) - [Commits](https://github.com/rswag/rswag/compare/2.14.0...2.15.0) --- updated-dependencies: - dependency-name: rswag-ui dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index f1850bc37..3ed81acd6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -559,7 +559,7 @@ GEM json-schema (>= 2.2, < 6.0) railties (>= 5.2, < 8.0) rspec-core (>= 2.14) - rswag-ui (2.14.0) + rswag-ui (2.15.0) actionpack (>= 5.2, < 8.0) railties (>= 5.2, < 8.0) rubocop (1.66.1) From 3d9d89726eeeb513d4c3e27e9b06fb5396d5e85f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 11:15:07 +0000 Subject: [PATCH 084/203] Bump rswag-api from 2.14.0 to 2.15.0 Bumps [rswag-api](https://github.com/rswag/rswag) from 2.14.0 to 2.15.0. - [Release notes](https://github.com/rswag/rswag/releases) - [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md) - [Commits](https://github.com/rswag/rswag/compare/2.14.0...2.15.0) --- updated-dependencies: - dependency-name: rswag-api dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3ed81acd6..fa5e2d77c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -551,7 +551,7 @@ GEM rspectre (0.1.0) parser (>= 3.2.2.1) rspec (~> 3.9) - rswag-api (2.14.0) + rswag-api (2.15.0) activesupport (>= 5.2, < 8.0) railties (>= 5.2, < 8.0) rswag-specs (2.15.0) From 413b5969d6663f5c0a96a0a9e5177804ef54a77e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2024 07:45:51 +0000 Subject: [PATCH 085/203] Bump terser from 1.2.3 to 1.2.4 Bumps [terser](https://github.com/ahorek/terser-ruby) from 1.2.3 to 1.2.4. - [Release notes](https://github.com/ahorek/terser-ruby/releases) - [Changelog](https://github.com/ahorek/terser-ruby/blob/master/CHANGELOG.md) - [Commits](https://github.com/ahorek/terser-ruby/compare/1.2.3...1.2.4) --- updated-dependencies: - dependency-name: terser dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index fa5e2d77c..97c26001d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -645,7 +645,7 @@ GEM temple (0.10.3) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - terser (1.2.3) + terser (1.2.4) execjs (>= 0.3.0, < 3) thor (1.3.2) thread_safe (0.3.6) From 15537139e4607887035200f401e4eac9e9b75838 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 13 Oct 2024 02:11:25 +0000 Subject: [PATCH 086/203] Bump active_median from 0.4.1 to 0.5.0 Bumps [active_median](https://github.com/ankane/active_median) from 0.4.1 to 0.5.0. - [Changelog](https://github.com/ankane/active_median/blob/master/CHANGELOG.md) - [Commits](https://github.com/ankane/active_median/compare/v0.4.1...v0.5.0) --- updated-dependencies: - dependency-name: active_median dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 97c26001d..5da7c5b81 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -80,8 +80,8 @@ GEM active_link_to (1.0.5) actionpack addressable - active_median (0.4.1) - activesupport (>= 6.1) + active_median (0.5.0) + activesupport (>= 7) active_record_union (1.3.0) activerecord (>= 4.0) active_utils (3.4.1) From 681f3780ad0718381c78fa1481b7febad4056f65 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sun, 13 Oct 2024 12:41:59 +1030 Subject: [PATCH 087/203] Default a new activity as being done today --- app/controllers/activities_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/activities_controller.rb b/app/controllers/activities_controller.rb index 7d1c3299f..08e8aa4bd 100644 --- a/app/controllers/activities_controller.rb +++ b/app/controllers/activities_controller.rb @@ -29,7 +29,8 @@ class ActivitiesController < DataController def new @activity = Activity.new( - owner: current_member + owner: current_member, + due_date: Date.today ) if params[:garden_id] @activity.garden = Garden.find_by( From 2484bd39ed6e12d698e2fce2ed10b5b51e9631dc Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sun, 13 Oct 2024 14:25:46 +1030 Subject: [PATCH 088/203] Render where a planting is in card view (#3882) * Render where a planting is in card view * Update app/assets/stylesheets/_plantings.scss --- app/assets/stylesheets/_plantings.scss | 9 +++++++++ app/models/concerns/search_plantings.rb | 1 + app/models/planting.rb | 1 + app/views/plantings/_card.html.haml | 11 +++++++---- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/_plantings.scss b/app/assets/stylesheets/_plantings.scss index a65aeb75c..0b3d37874 100755 --- a/app/assets/stylesheets/_plantings.scss +++ b/app/assets/stylesheets/_plantings.scss @@ -47,4 +47,13 @@ margin-left: auto; } } + + .card-footer { + max-height: 2em; + -webkit-line-clamp: 1; + overflow: hidden; + text-overflow: ellipsis; + margin-bottom: 0.5em; + padding-top: 0; + } } diff --git a/app/models/concerns/search_plantings.rb b/app/models/concerns/search_plantings.rb index d8a0c135a..0900f7e9b 100644 --- a/app/models/concerns/search_plantings.rb +++ b/app/models/concerns/search_plantings.rb @@ -30,6 +30,7 @@ module SearchPlantings quantity:, sunniness:, garden_id:, + garden_slug: garden&.garden_slug, garden_name: garden&.name, description:, diff --git a/app/models/planting.rb b/app/models/planting.rb index 134908ad8..a1c469d69 100644 --- a/app/models/planting.rb +++ b/app/models/planting.rb @@ -61,6 +61,7 @@ class Planting < ApplicationRecord to: :crop, prefix: true delegate :login_name, :slug, :location, to: :owner, prefix: true delegate :slug, to: :planting, prefix: true + delegate :slug, :name, to: :garden, prefix: true delegate :annual?, :perennial?, :svg_icon, to: :crop delegate :location, :longitude, :latitude, to: :garden diff --git a/app/views/plantings/_card.html.haml b/app/views/plantings/_card.html.haml index ded3b6773..7555cb75a 100644 --- a/app/views/plantings/_card.html.haml +++ b/app/views/plantings/_card.html.haml @@ -31,7 +31,10 @@ .text-center= render 'plantings/badges', planting: planting = render 'plantings/progress', planting: planting .card-footer - .float-right - %span.chip.member-chip - = link_to member_path(slug: planting.owner_slug) do - = planting.owner_login_name \ No newline at end of file + %small + Planted by + = link_to member_path(slug: planting.owner_slug), class: "owner-link" do + = planting.owner_login_name + in + = link_to garden_path(slug: planting.garden_slug), class: "garden-link" do + = planting.garden_name \ No newline at end of file From 11321989316b5ac68497cd1fc4dea12037faf82c Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sun, 13 Oct 2024 21:48:13 +1030 Subject: [PATCH 089/203] Update _plantings.scss --- app/assets/stylesheets/_plantings.scss | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/_plantings.scss b/app/assets/stylesheets/_plantings.scss index 0b3d37874..98f6cf862 100755 --- a/app/assets/stylesheets/_plantings.scss +++ b/app/assets/stylesheets/_plantings.scss @@ -49,11 +49,11 @@ } .card-footer { - max-height: 2em; - -webkit-line-clamp: 1; - overflow: hidden; - text-overflow: ellipsis; - margin-bottom: 0.5em; - padding-top: 0; + max-height: 2em; + -webkit-line-clamp: 1; + overflow: hidden; + text-overflow: ellipsis; + margin-bottom: 0.5em; + padding-top: 0; } } From a8cd6ad10e59e29328b84b2792f48da70f0358c0 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sun, 13 Oct 2024 21:51:04 +1030 Subject: [PATCH 090/203] Update auto_suggest_helper.rb to support required --- app/helpers/auto_suggest_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/auto_suggest_helper.rb b/app/helpers/auto_suggest_helper.rb index 1b8521c82..ff0558ef2 100644 --- a/app/helpers/auto_suggest_helper.rb +++ b/app/helpers/auto_suggest_helper.rb @@ -13,7 +13,7 @@ module AutoSuggestHelper resource = resource.class.name.downcase source_path = Rails.application.routes.url_helpers.send("search_#{source}s_path", format: :json) %( -