Skip to content

Commit 3cefc7d

Browse files
MONGOID-5809: remove ruby -w warnings (#5921)
1 parent eff554b commit 3cefc7d

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

lib/mongoid/association/relatable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def validate?
303303
# The associations above this one in the inclusion tree.
304304
#
305305
# @return [ Array<String> ] The associations.
306-
attr_accessor :parent_inclusions
306+
attr_writer :parent_inclusions
307307

308308
# The associations above this one in the inclusion tree.
309309
#

lib/mongoid/contextual.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module Contextual
2323

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

2828
# This gets blank and empty included.
2929
def_delegators :context, *Queryable.public_instance_methods(false)

lib/mongoid/findable.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,12 @@ module Findable
5656
:take,
5757
:take!,
5858
:tally,
59-
:text_search,
6059
:third,
6160
:third!,
6261
:third_to_last,
6362
:third_to_last!,
6463
:update,
65-
:update_all,
64+
:update_all
6665

6766
# Returns a count of records in the database.
6867
# If you want to specify conditions use where.

lib/mongoid/serializable.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ module Serializable
1313
included do
1414

1515
class << self
16+
# These methods are previously defined by ActiveModel which we override to include default behavior.
17+
remove_method :include_root_in_json if method_defined?(:include_root_in_json)
18+
remove_method :include_root_in_json= if method_defined?(:include_root_in_json=)
1619
def include_root_in_json
1720
@include_root_in_json.nil? ? ::Mongoid.include_root_in_json : @include_root_in_json
1821
end

lib/mongoid/traversable.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,9 @@ def discriminator_value
179179

180180
included do
181181
class_attribute :discriminator_key, instance_accessor: false
182-
183182
class << self
183+
# The class attribute declaration above creates a default getter which we override with our custom method.
184+
remove_method :discriminator_key
184185
delegate :discriminator_key, to: ::Mongoid
185186
prepend DiscriminatorAssignment
186187
include DiscriminatorRetrieval

0 commit comments

Comments
 (0)