Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/APPEALS-44188-44282 - Deprecation fixes for Rails 6.1 (release) #21614

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions app/jobs/quarterly_notifications_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ class QuarterlyNotificationsJob < CaseflowJob
def perform # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/PerceivedComplexity
ensure_current_user_is_set

AppealState.where.not(
decision_mailed: true, appeal_cancelled: true
).find_in_batches(batch_size: QUERY_LIMIT.to_i) do |batched_appeal_states|
AppealState.where.not(decision_mailed: true).where.not(appeal_cancelled: true)
.find_in_batches(batch_size: QUERY_LIMIT.to_i) do |batched_appeal_states|
batched_appeal_states.each do |appeal_state|
# add_record_to_appeal_states_table(appeal_state.appeal)
if appeal_state.appeal_type == "Appeal"
Expand Down
2 changes: 1 addition & 1 deletion app/models/bgs_power_of_attorney.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def find_or_create_by_file_number(file_number)
end

def find_or_create_by_claimant_participant_id(claimant_participant_id)
poa = find_or_create_by!(claimant_participant_id: claimant_participant_id)
poa = default_scoped.find_or_create_by!(claimant_participant_id: claimant_participant_id)
if FeatureToggle.enabled?(:poa_auto_refresh, user: RequestStore.store[:current_user])
poa.save_with_updated_bgs_record! if poa&.expired?
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/dispatch/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def should_invalidate?
end

def no_open_tasks_for_appeal
if self.class.to_complete_task_for_appeal(appeal).any?
if self.class.default_scoped.to_complete_task_for_appeal(appeal).any?
errors.add(:appeal, "Uncompleted task already exists for this appeal")
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/team_quota.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ def most_recent_user_count

# Cap the search to the last month to avoid an infinite loop
def most_recent_user_counts
self.class.where(task_type: task_type).order(:date).limit(31).lazy.map(&:user_count)
self.class.default_scoped.where(task_type: task_type).order(:date).limit(31).lazy.map(&:user_count)
end
end
5 changes: 4 additions & 1 deletion app/models/vbms_uploaded_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ class VbmsUploadedDocument < CaseflowRecord
attribute :file, :string

scope :successfully_uploaded, lambda {
where(error: nil).where.not(uploaded_to_vbms_at: nil, attempted_at: nil, processed_at: nil)
where(error: nil)
.where.not(uploaded_to_vbms_at: nil)
.where.not(attempted_at: nil)
.where.not(processed_at: nil)
}

def cache_file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def appeal_ids_for_completed_root_tasks
def appeal_ids_for_open_child_tasks
ETL::Task.select(:appeal_id).distinct
.where(appeal_type: "Appeal")
.where.not(task_type: "RootTask", task_status: Task.closed_statuses)
.where.not(task_type: "RootTask")
.where.not(task_status: Task.closed_statuses)
end
end
3 changes: 2 additions & 1 deletion app/queries/etl/unknown_status_with_open_root_task_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def appeal_ids_for_open_root_tasks
def appeal_ids_for_open_child_tasks
ETL::Task.select(:appeal_id).distinct
.where(appeal_type: "Appeal")
.where.not(task_type: "RootTask", task_status: Task.closed_statuses)
.where.not(task_type: "RootTask")
.where.not(task_status: Task.closed_statuses)
end
end
3 changes: 2 additions & 1 deletion app/services/deprecation_warnings/disallowed_deprecations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class ::DisallowedDeprecationError < StandardError; end
/ActionView::Base instances should be constructed with a lookup context, assignments, and a controller./,
/ActionView::Base instances must implement `compiled_method_container`/,
/render file: should be given the absolute path to a file/,
/`ActiveRecord::Result#to_hash` has been renamed to `to_a`/
/`ActiveRecord::Result#to_hash` has been renamed to `to_a`/,
/Class level methods will no longer inherit scoping/
].freeze

# Regular expressions for deprecation warnings that should raise an exception on detection
Expand Down
Loading