Skip to content

Commit

Permalink
cp
Browse files Browse the repository at this point in the history
  • Loading branch information
rromanchuk committed Dec 31, 2023
1 parent 6813019 commit 7552015
Show file tree
Hide file tree
Showing 18 changed files with 570 additions and 980 deletions.
20 changes: 11 additions & 9 deletions personal/app/controllers/tds/batches_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,23 @@ def process_csv

private

def apply_filter(relation = Batch.all)
def apply_filter
relation = Batch.recent

case params[:filter]
when 'metars'
relation.metars
relation = relation.metars
when 'pireps'
relation.aircraftreports
relation = relation.aircraftreports
when 'tafs'
relation.tafs
relation = relation.tafs
when 'failed'
relation.failed
relation = relation.failed
when 'pending'
relation.pending
else
relation
end.recent
relation = relation.pending
end

relation
end

def apply_sort(relation)
Expand Down
2 changes: 1 addition & 1 deletion personal/app/models/attachment.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Attachment < LegacyRecord
class Attachment < ApplicationRecord
belongs_to :record, polymorphic: true, touch: true
belongs_to :blob, autosave: true

Expand Down
2 changes: 1 addition & 1 deletion personal/app/models/blob.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Blob < LegacyRecord
class Blob < ApplicationRecord
include Taggable
include Searchable
include Sluggable
Expand Down
9 changes: 0 additions & 9 deletions personal/app/models/legacy_record.rb

This file was deleted.

2 changes: 1 addition & 1 deletion personal/app/models/post.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

class Post < LegacyRecord
class Post < ApplicationRecord
SEARCH_AGAINST = %i[title description markdown_content]

include Sluggable
Expand Down
30 changes: 15 additions & 15 deletions personal/config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ default: &default


development:
primary:
<<: *default
database: personal_development
#username: postgres
host: localhost
ryan_romanchuk:
<<: *default
database: ryan_romanchuk_development
host: localhost
migrations_paths: db/ryan_romanchuk
legacy:
<<: *default
database: personal_development
#username: postgres
host: localhost
wx:
<<: *default
database: wx_development
Expand All @@ -30,17 +30,17 @@ development:
migrations_paths: db/ro

test:
ryan_romanchuk:
primary:
<<: *default
database: ryan_romanchuk_test
database: personal_test
username: postgres
host: localhost
migrations_paths: db/ryan_romanchuk
legacy:
ryan_romanchuk:
<<: *default
database: personal_test
database: ryan_romanchuk_test
username: postgres
host: localhost
migrations_paths: db/ryan_romanchuk
wx:
<<: *default
database: wx_test
Expand All @@ -55,18 +55,18 @@ test:
migrations_paths: db/ro

production:
primary:
<<: *default
database: personal_production
username: personal
#password: <%= ENV["PERSONAL_DATABASE_PASSWORD"] %>
ryan_romanchuk:
<<: *default
database: ryan_romanchuk_production
username: <%= ENV["DATABASE_USERNAME"] %>
password: <%= ENV["DATABASE_PASSWORD"] %>
host: <%= ENV['DATABASE_HOST'] %>
migrations_paths: db/ryan_romanchuk
legacy:
<<: *default
database: personal_production
username: personal
#password: <%= ENV["PERSONAL_DATABASE_PASSWORD"] %>
wx:
<<: *default
database: wx_production
Expand Down
Loading

0 comments on commit 7552015

Please sign in to comment.