Skip to content

Commit

Permalink
Improve comments and indentation [skip-log]
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Nov 18, 2024
1 parent 079fe81 commit 30d48c2
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 10 deletions.
8 changes: 4 additions & 4 deletions gem/bin/pagy
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ opts = Optimist.options do
pagy ~/my-repro.ru Develop ~/my-repro.ru at#{HOST}:#{PORT}
HEAD
text 'Rackup options'
opt :env, 'Environment', default: 'development'
opt :host, 'Host', default: HOST, short: :o
opt :port, 'Port', default: PORT
opt :install, 'Install bundle for users', default: true
opt :env, 'Environment', default: 'development'
opt :host, 'Host', default: HOST, short: :o
opt :port, 'Port', default: PORT
opt :install, 'Install bundle for users', default: true
if LINUX
text 'Rerun options'
opt :rerun, 'Enable rerun for development', default: true
Expand Down
2 changes: 1 addition & 1 deletion gem/lib/pagy/calendar/day.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Day < Unit

protected

# Setup the calendar variables
# Set up the calendar variables
def assign_unit_vars
super
@initial = @starting.beginning_of_day
Expand Down
2 changes: 1 addition & 1 deletion gem/lib/pagy/calendar/month.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Month < Unit

protected

# Setup the calendar variables
# Set up the calendar variables
def assign_unit_vars
super
@initial = @starting.beginning_of_month
Expand Down
2 changes: 1 addition & 1 deletion gem/lib/pagy/calendar/quarter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def label_for(page, opts = {})

protected

# Setup the calendar variables
# Set up the calendar variables
def assign_unit_vars
super
@initial = @starting.beginning_of_quarter
Expand Down
2 changes: 1 addition & 1 deletion gem/lib/pagy/calendar/week.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Week < Unit

protected

# Setup the calendar variables
# Set up the calendar variables
def assign_unit_vars
super
@initial = @starting.beginning_of_week
Expand Down
2 changes: 1 addition & 1 deletion gem/lib/pagy/calendar/year.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Year < Unit

protected

# Setup the calendar variables
# Set up the calendar variables
def assign_unit_vars
super
@initial = @starting.beginning_of_year
Expand Down
11 changes: 10 additions & 1 deletion gem/lib/pagy/keyset.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,16 @@ def records

protected

# Prepare the literal query to filter the newest records
# Prepare the literal query string (complete with the placeholders for value interpolation)
# used to filter the newest records.
# For example:
# With a set like Pet.order(animal: :asc, name: :desc, id: :asc) it returns the following string:
# ( animal = :animal AND name = :name AND id > :id ) OR
# ( animal = :animal AND name < :name ) OR
# ( animal > :animal )
# When :tuple_comparison is enabled, and if the order is all :asc or all :desc,
# with a set like Pet.order(:animal, :name, :id) it returns the following string:
# ( animal, name, id ) > ( :animal, :name, :id )
def filter_newest_query
operator = { asc: '>', desc: '<' }
directions = @keyset.values
Expand Down

0 comments on commit 30d48c2

Please sign in to comment.