Skip to content

Commit

Permalink
Refactor: Replace all usages of "protected" with "private" (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyshields authored Nov 7, 2023
1 parent 1b14690 commit 6de4dcb
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

* [#75](https://github.com/mongoid/mongoid_orderable/pull/75): Fix: Preserve position when creating new records.
* [#84](https://github.com/mongoid/mongoid_orderable/pull/84): Feature: Use Mongo::QueryCache if available.
* [#85](https://github.com/mongoid/mongoid_orderable/pull/85): Refactor: Replace all usages of "protected" with "private".

### 6.0.4 (2023/02/01)

Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/orderable/configs/field_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def global_config
lock_collection: cfg.lock_collection }
end

protected
private

def assign_options(options)
@options = global_config
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/orderable/generators/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def initialize(klass)
@klass = klass
end

protected
private

def generate_method(name, &block)
klass.send(:define_method, name, &block)
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/orderable/generators/listable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def generate(field_name)
generate_aliased_helpers(field_name)
end

protected
private

def generate_list_helpers(field_name)
generate_method("next_#{field_name}_item") do
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/orderable/generators/lock_collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class #{model_name}
KLASS
end

protected
private

def model_exists?(model_name)
base = ::Mongoid::Orderable::Models
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/orderable/generators/movable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def generate(field_name)
generate_shorthand_helpers(field_name)
end

protected
private

def generate_move_to_helpers(field_name)
generate_method("move_#{field_name}_to") do |target_position|
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/orderable/generators/scope.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def generate(field_name, order_scope)
end
end

protected
private

def criteria(order_scope)
case order_scope
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/orderable/handlers/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def initialize(doc)
reset_new_record
end

protected
private

delegate :orderable_keys,
:orderable_field,
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/orderable/handlers/document_transactional.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def after_create
super
end

protected
private

def apply_all_positions
with_transaction { super }
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/orderable/handlers/transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def with_transaction(&block)
end
end

protected
private

def do_transaction(&_block)
doc.class.with_session(session_opts) do |session|
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/orderable/installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def setup
generate_all_helpers
end

protected
private

def field_name
config[:field_options][:as] || config[:field]
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/orderable/mixins/callbacks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module Callbacks
to: :orderable_handler,
prefix: :orderable

protected
private

def orderable_handler
@orderable_handler ||= self.class.orderable_handler_class.new(self)
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/orderable/mixins/movable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def move_#{symbol}!(options = {})
KLASS
end

protected
private

def move_all
@move_all ||= {}
Expand Down

0 comments on commit 6de4dcb

Please sign in to comment.