Skip to content

Commit

Permalink
Merge branch 'master' into rubocop_rails_date
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyshields authored Aug 27, 2023
2 parents 0b7af01 + 31ed11e commit ce4cfa3
Show file tree
Hide file tree
Showing 79 changed files with 3,224 additions and 2,531 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ examples
.env
.env.private*
.tool-versions
build
64 changes: 31 additions & 33 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# This configuration was generated by
# `rubocop --auto-gen-config --exclude-limit 1000`
# on 2023-04-20 23:45:43 UTC using RuboCop version 1.50.0.
# on 2023-08-26 19:42:04 UTC using RuboCop version 1.49.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: 121
# Offense count: 108
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 154
Expand All @@ -25,14 +25,14 @@ Metrics/BlockNesting:
# Offense count: 17
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
Max: 329
Max: 327

# Offense count: 54
# Offense count: 50
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/CyclomaticComplexity:
Max: 33

# Offense count: 186
# Offense count: 182
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Max: 87
Expand All @@ -48,21 +48,20 @@ Metrics/ParameterLists:
MaxOptionalParameters: 4
Max: 6

# Offense count: 45
# Offense count: 40
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/PerceivedComplexity:
Max: 20

# Offense count: 7
# Offense count: 3
# Configuration parameters: EnforcedStyleForLeadingUnderscores.
# SupportedStylesForLeadingUnderscores: disallowed, required, optional
Naming/MemoizedInstanceVariableName:
Exclude:
- 'lib/mongoid/association/relatable.rb'
- 'lib/mongoid/document.rb'
- 'lib/mongoid/traversable.rb'

# Offense count: 25
# Offense count: 27
RSpec/AnyInstance:
Exclude:
- 'spec/mongoid/association/referenced/belongs_to/buildable_spec.rb'
Expand All @@ -81,7 +80,7 @@ RSpec/AnyInstance:
RSpec/BeforeAfterAll:
Enabled: false

# Offense count: 832
# Offense count: 833
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
RSpec/ContextWording:
Expand Down Expand Up @@ -204,10 +203,11 @@ RSpec/ContextWording:
- 'spec/support/immutable_ids.rb'
- 'spec/support/shared/time.rb'

# Offense count: 57
# Offense count: 58
# Configuration parameters: IgnoredMetadata.
RSpec/DescribeClass:
Exclude:
- 'spec/integration/active_job_spec.rb'
- 'spec/integration/app_spec.rb'
- 'spec/integration/associations/belongs_to_spec.rb'
- 'spec/integration/associations/embedded_dirty_spec.rb'
Expand Down Expand Up @@ -248,7 +248,7 @@ RSpec/DescribeClass:
- 'spec/mongoid/railties/console_sandbox_spec.rb'
- 'spec/mongoid/tasks/database_rake_spec.rb'

# Offense count: 133
# Offense count: 126
RSpec/ExpectInHook:
Exclude:
- 'spec/integration/associations/embedded_spec.rb'
Expand All @@ -264,7 +264,6 @@ RSpec/ExpectInHook:
- 'spec/mongoid/association/referenced/has_and_belongs_to_many/proxy_persistence_spec.rb'
- 'spec/mongoid/association/referenced/has_and_belongs_to_many/proxy_spec.rb'
- 'spec/mongoid/association/referenced/has_many/binding_spec.rb'
- 'spec/mongoid/association/referenced/has_many/proxy_spec.rb'
- 'spec/mongoid/association/referenced/has_one/binding_spec.rb'
- 'spec/mongoid/association/referenced/has_one/buildable_spec.rb'
- 'spec/mongoid/association/referenced/has_one/proxy_spec.rb'
Expand Down Expand Up @@ -292,7 +291,7 @@ RSpec/ExpectInHook:
- 'spec/mongoid/validatable/presence_spec.rb'
- 'spec/support/immutable_ids.rb'

# Offense count: 24
# Offense count: 25
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
# Include: **/*_spec*rb*, **/spec/**/*
RSpec/FilePath:
Expand All @@ -314,6 +313,7 @@ RSpec/FilePath:
- 'spec/mongoid/extensions/raw_value_spec.rb'
- 'spec/mongoid/extensions/stringified_symbol_spec.rb'
- 'spec/mongoid/loading_spec.rb'
- 'spec/mongoid/railties/bson_object_id_serializer_spec.rb'
- 'spec/mongoid/validatable/associated_spec.rb'
- 'spec/mongoid/validatable/format_spec.rb'
- 'spec/mongoid/validatable/length_spec.rb'
Expand All @@ -322,7 +322,7 @@ RSpec/FilePath:
- 'spec/mongoid/validatable/uniqueness_spec.rb'
- 'spec/mongoid/version_spec.rb'

# Offense count: 17
# Offense count: 18
RSpec/IteratedExpectation:
Exclude:
- 'spec/mongoid/association/referenced/belongs_to/eager_spec.rb'
Expand All @@ -333,10 +333,12 @@ RSpec/IteratedExpectation:
- 'spec/mongoid/contextual/mongo_spec.rb'
- 'spec/mongoid/criteria_spec.rb'
- 'spec/mongoid/findable_spec.rb'
- 'spec/mongoid_spec.rb'

# Offense count: 229
# Offense count: 230
RSpec/LeakyConstantDeclaration:
Exclude:
- 'spec/integration/active_job_spec.rb'
- 'spec/integration/app_spec.rb'
- 'spec/integration/callbacks_spec.rb'
- 'spec/integration/discriminator_key_spec.rb'
Expand Down Expand Up @@ -392,7 +394,7 @@ RSpec/LeakyConstantDeclaration:
- 'spec/mongoid/validatable/numericality_spec.rb'
- 'spec/mongoid/validatable/uniqueness_spec.rb'

# Offense count: 523
# Offense count: 499
RSpec/LetSetup:
Exclude:
- 'spec/integration/matcher_examples_spec.rb'
Expand All @@ -416,7 +418,6 @@ RSpec/LetSetup:
- 'spec/mongoid/association/referenced/has_and_belongs_to_many_spec.rb'
- 'spec/mongoid/association/referenced/has_many/eager_spec.rb'
- 'spec/mongoid/association/referenced/has_many/enumerable_spec.rb'
- 'spec/mongoid/association/referenced/has_many/proxy_spec.rb'
- 'spec/mongoid/association/referenced/has_many_spec.rb'
- 'spec/mongoid/association/referenced/has_one/buildable_spec.rb'
- 'spec/mongoid/association/referenced/has_one/eager_spec.rb'
Expand Down Expand Up @@ -467,8 +468,8 @@ RSpec/LetSetup:
- 'spec/mongoid/touchable_spec.rb'
- 'spec/mongoid/validatable/uniqueness_spec.rb'

# Offense count: 302
# Configuration parameters: .
# Offense count: 298
# Configuration parameters: EnforcedStyle.
# SupportedStyles: have_received, receive
RSpec/MessageSpies:
EnforcedStyle: receive
Expand Down Expand Up @@ -497,12 +498,12 @@ RSpec/NamedSubject:
- 'spec/mongoid/extensions/raw_value_spec.rb'
- 'spec/mongoid/matcher/expression_spec.rb'

# Offense count: 5010
# Offense count: 5025
# Configuration parameters: AllowedGroups.
RSpec/NestedGroups:
Max: 13

# Offense count: 33
# Offense count: 37
# Configuration parameters: AllowedPatterns.
# AllowedPatterns: ^expect_, ^assert_
RSpec/NoExpectationExample:
Expand All @@ -515,6 +516,7 @@ RSpec/NoExpectationExample:
- 'spec/mongoid/association/referenced/has_and_belongs_to_many/proxy_spec.rb'
- 'spec/mongoid/attributes_spec.rb'
- 'spec/mongoid/collection_configurable_spec.rb'
- 'spec/mongoid/criteria/queryable/storable_spec.rb'
- 'spec/mongoid/document_spec.rb'
- 'spec/mongoid/errors/mongoid_error_spec.rb'
- 'spec/mongoid/persistence_context_spec.rb'
Expand Down Expand Up @@ -563,7 +565,7 @@ RSpec/RepeatedExample:
- 'spec/mongoid/factory_spec.rb'
- 'spec/mongoid/persistable/savable_spec.rb'

# Offense count: 72
# Offense count: 68
RSpec/RepeatedExampleGroupBody:
Exclude:
- 'spec/mongoid/association/embedded/embedded_in_spec.rb'
Expand All @@ -574,7 +576,6 @@ RSpec/RepeatedExampleGroupBody:
- 'spec/mongoid/association/referenced/belongs_to_spec.rb'
- 'spec/mongoid/association/referenced/has_and_belongs_to_many/proxy_spec.rb'
- 'spec/mongoid/association/referenced/has_and_belongs_to_many_spec.rb'
- 'spec/mongoid/association/referenced/has_many/proxy_spec.rb'
- 'spec/mongoid/association/referenced/has_many_spec.rb'
- 'spec/mongoid/association/referenced/has_one_spec.rb'
- 'spec/mongoid/attributes/readonly_spec.rb'
Expand Down Expand Up @@ -625,20 +626,19 @@ RSpec/ScatteredLet:
- 'spec/mongoid/reloadable_spec.rb'
- 'spec/mongoid/scopable_spec.rb'

# Offense count: 69
# Offense count: 67
RSpec/ScatteredSetup:
Exclude:
- 'spec/integration/stringified_symbol_field_spec.rb'
- 'spec/mongoid/association/auto_save_spec.rb'
- 'spec/mongoid/association/referenced/belongs_to/proxy_spec.rb'
- 'spec/mongoid/association/referenced/has_and_belongs_to_many/proxy_spec.rb'
- 'spec/mongoid/association/referenced/has_many/proxy_spec.rb'
- 'spec/mongoid/attributes/nested_spec.rb'
- 'spec/mongoid/changeable_spec.rb'
- 'spec/mongoid/copyable_spec.rb'
- 'spec/mongoid/persistable/deletable_spec.rb'

# Offense count: 12
# Offense count: 14
RSpec/StubbedMock:
Exclude:
- 'spec/mongoid/clients_spec.rb'
Expand Down Expand Up @@ -676,7 +676,7 @@ RSpec/VerifiedDoubles:
- 'spec/mongoid/validatable/associated_spec.rb'
- 'spec/rails/mongoid_spec.rb'

# Offense count: 22
# Offense count: 21
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforceForPrefixed.
Rails/Delegate:
Expand All @@ -687,7 +687,6 @@ Rails/Delegate:
- 'lib/mongoid/clients.rb'
- 'lib/mongoid/clients/options.rb'
- 'lib/mongoid/contextual/memory.rb'
- 'lib/mongoid/contextual/mongo.rb'
- 'lib/mongoid/contextual/none.rb'
- 'lib/mongoid/criteria.rb'
- 'lib/mongoid/document.rb'
Expand Down Expand Up @@ -716,7 +715,7 @@ Rails/I18nLocaleAssignment:
- 'spec/mongoid/validatable/uniqueness_spec.rb'
- 'spec/support/macros.rb'

# Offense count: 126
# Offense count: 129
# Configuration parameters: ForbiddenMethods, AllowedMethods.
# ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all
Rails/SkipsModelValidations:
Expand Down Expand Up @@ -798,11 +797,10 @@ Rails/TimeZoneAssignment:
- 'spec/support/macros.rb'
- 'spec/support/shared/time.rb'

# Offense count: 6
# Offense count: 5
Style/MultilineBlockChain:
Exclude:
- 'lib/mongoid/association/eager.rb'
- 'lib/mongoid/association/referenced/has_many/proxy.rb'
- 'lib/mongoid/contextual/memory.rb'
- 'spec/mongoid/changeable_spec.rb'
- 'spec/mongoid/document_spec.rb'
Expand Down Expand Up @@ -833,7 +831,7 @@ Style/OptionalBooleanParameter:
- 'spec/support/models/address.rb'
- 'spec/support/models/name.rb'

# Offense count: 242
# Offense count: 240
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
# URISchemes: http, https
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/associations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@ The child may become orphaned if it is ordinarily only referenced via the parent
label.bands.push(Band.first)
label.delete # Raises an error since bands is not empty.

Band.first.delete # Will delete all associated albums.
Band.first.destroy # Will delete all associated albums.


Autosaving
Expand Down
15 changes: 10 additions & 5 deletions docs/reference/compatibility.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ specified Mongoid versions.
:class: compatibility-large no-padding

* - Mongoid
- Driver 2.18
- Driver 2.19-2.18
- Driver 2.17-2.10
- Driver 2.9-2.7

Expand Down Expand Up @@ -83,7 +83,7 @@ is deprecated.
- |checkmark|
- |checkmark|
- D
-
- D
-
-
-
Expand All @@ -97,13 +97,13 @@ is deprecated.
- |checkmark|
- |checkmark|
- |checkmark|
- D
- |checkmark|
-
-
-
-
-
- |checkmark|
- D
-

* - 8.0
Expand Down Expand Up @@ -250,6 +250,7 @@ and will be removed in a next version.
:class: compatibility-large no-padding

* - Mongoid
- MongoDB 7.0
- MongoDB 6.0
- MongoDB 5.0
- MongoDB 4.4
Expand All @@ -262,6 +263,7 @@ and will be removed in a next version.
- MongoDB 2.6

* - 9.0
- |checkmark|
- |checkmark|
- |checkmark|
- D
Expand Down Expand Up @@ -304,12 +306,15 @@ and will be removed in a next version.
- |checkmark|
- |checkmark|
- |checkmark|
- |checkmark|
- D
- D
- D
- D

* - 6.4 thru 7.3
-
-
-
- |checkmark|
- |checkmark|
Expand Down Expand Up @@ -353,7 +358,7 @@ are supported by Mongoid.
- |checkmark|
- |checkmark|
- |checkmark|
- D [#rails-5-ruby-3.0]_
- |checkmark| [#rails-5-ruby-3.0]_
-

* - 8.0
Expand Down
Loading

0 comments on commit ce4cfa3

Please sign in to comment.