Skip to content

Commit

Permalink
MONGOID-5809: remove ruby -w warnings (#5921)
Browse files Browse the repository at this point in the history
  • Loading branch information
DarshanaVenkatesh authored Dec 17, 2024
1 parent eff554b commit 3cefc7d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/mongoid/association/relatable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def validate?
# The associations above this one in the inclusion tree.
#
# @return [ Array<String> ] The associations.
attr_accessor :parent_inclusions
attr_writer :parent_inclusions

# The associations above this one in the inclusion tree.
#
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/contextual.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module Contextual

# The methods in the contexts themselves should all get delegated to,
# including destructive, modification, and optional methods.
def_delegators :context, *(Mongo.public_instance_methods(false) - [ :skip, :limit ])
def_delegators :context, *(Mongo.public_instance_methods(false) - [ :skip, :limit, :load_async ])

# This gets blank and empty included.
def_delegators :context, *Queryable.public_instance_methods(false)
Expand Down
3 changes: 1 addition & 2 deletions lib/mongoid/findable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,12 @@ module Findable
:take,
:take!,
:tally,
:text_search,
:third,
:third!,
:third_to_last,
:third_to_last!,
:update,
:update_all,
:update_all

# Returns a count of records in the database.
# If you want to specify conditions use where.
Expand Down
3 changes: 3 additions & 0 deletions lib/mongoid/serializable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ module Serializable
included do

class << self
# These methods are previously defined by ActiveModel which we override to include default behavior.
remove_method :include_root_in_json if method_defined?(:include_root_in_json)
remove_method :include_root_in_json= if method_defined?(:include_root_in_json=)
def include_root_in_json
@include_root_in_json.nil? ? ::Mongoid.include_root_in_json : @include_root_in_json
end
Expand Down
3 changes: 2 additions & 1 deletion lib/mongoid/traversable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,9 @@ def discriminator_value

included do
class_attribute :discriminator_key, instance_accessor: false

class << self
# The class attribute declaration above creates a default getter which we override with our custom method.
remove_method :discriminator_key
delegate :discriminator_key, to: ::Mongoid
prepend DiscriminatorAssignment
include DiscriminatorRetrieval
Expand Down

0 comments on commit 3cefc7d

Please sign in to comment.