Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
rromanchuk committed Dec 31, 2023
1 parent 3d36319 commit 88ed233
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def new
end

def index
authorize!
authorize! with: RyanRomanchuk::PostPolicy
end

def edit
Expand Down
4 changes: 2 additions & 2 deletions personal/app/controllers/tds/metars_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def show

private

def apply_filter(relation = Metar.recent(:observation_time))

def apply_filter
relation = Metar.recent(:observation_time)
relation = relation.search(params[:q]) if params[:q].present?

if params[:station_id]
Expand Down
2 changes: 1 addition & 1 deletion personal/app/controllers/tds/pireps_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def destroy
def apply_filter
relation = Pirep.recent(:observation_time)
#relation = relation.near(params[:location], 100) if params[:location].present?
#relation = relation.search(params[:q]) if params[:q].present?
relation = relation.search(params[:q]) if params[:q].present?

if params[:station_id]
add_breadcrumb(station.code, tds_station_pireps_url(station))
Expand Down
3 changes: 2 additions & 1 deletion personal/app/models/tds/metar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ class Metar < ApplicationRecord
include Searchable
SEARCH_AGAINST = %i[raw_text]
belongs_to :batch, counter_cache: :metars_count

pg_search_scope :search, against: SEARCH_AGAINST

# pg_search_scope :search, against: {
# station_id: 'A',
# wx_string: 'B',
Expand Down
2 changes: 1 addition & 1 deletion personal/app/models/tds/pirep.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Pirep < ApplicationRecord
# scope :msl_above, lambda { |feet_msl|
# where("ST_Z(wx_pireps.location::geometry) > #{feet_msl}")
# }

pg_search_scope :search, against: SEARCH_AGAINST
# pg_search_scope :search, against: {
# station: 'A',
# aircraft_ref: 'B',
Expand Down

0 comments on commit 88ed233

Please sign in to comment.