source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/controllers/providers/means/remove_vehicles_controller.rb | Ruby | mit | 19 | main | 1,131 | module Providers
module Means
class RemoveVehiclesController < ProviderBaseController
def show
vehicle
form
end
def update
vehicle
if form.valid?
vehicle&.destroy! if form.remove_vehicle?
if legal_aid_application.vehicles.none?
le... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/controllers/providers/means/identify_types_of_outgoings_controller.rb | Ruby | mit | 19 | main | 2,958 | module Providers
module Means
class IdentifyTypesOfOutgoingsController < ProviderBaseController
def show
@none_selected = legal_aid_application.no_debit_transaction_types_selected?
end
def update
synchronize_debit_transaction_types
validate
if legal_aid_applicat... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/controllers/providers/means/remove_dependants_controller.rb | Ruby | mit | 19 | main | 1,143 | module Providers
module Means
class RemoveDependantsController < ProviderBaseController
def show
dependant
form
end
def update
dependant
if form.valid?
dependant&.destroy! if form.remove_dependant?
if legal_aid_application.dependants.none?
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/controllers/providers/means/has_other_dependants_controller.rb | Ruby | mit | 19 | main | 935 | module Providers
module Means
class HasOtherDependantsController < ProviderBaseController
def show
form
end
def update
return continue_or_draft if draft_selected?
return go_forward(form.has_other_dependant?) if form.valid?
render :show
end
private
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/controllers/providers/means/has_dependants_controller.rb | Ruby | mit | 19 | main | 915 | module Providers
module Means
class HasDependantsController < ProviderBaseController
def show
@form = LegalAidApplications::HasDependantsForm.new(model: legal_aid_application)
end
def update
@form = LegalAidApplications::HasDependantsForm.new(form_params.merge(draft: params[:dra... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/controllers/providers/means/regular_incomes_controller.rb | Ruby | mit | 19 | main | 829 | module Providers
module Means
class RegularIncomesController < ProviderBaseController
def show
@form = RegularIncomeForm.new(legal_aid_application:)
end
def update
@form = RegularIncomeForm.new(regular_income_params)
if @form.save
go_forward
else
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/controllers/providers/means/cash_incomes_controller.rb | Ruby | mit | 19 | main | 1,592 | module Providers
module Means
class CashIncomesController < ProviderBaseController
before_action :setup_variables, only: %i[show update]
def show
@none_selected = legal_aid_application.no_cash_income?
end
def update
if aggregated_cash_income.update(form_params)
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/controllers/providers/means/state_benefits_controller.rb | Ruby | mit | 19 | main | 1,222 | module Providers
module Means
class StateBenefitsController < ProviderBaseController
def show
@form = StateBenefitForm.new(model: state_benefit_transaction)
end
def new
@form = StateBenefitForm.new(model: state_benefit_transaction)
end
def update
@form = Sta... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/controllers/providers/means/cash_outgoings_controller.rb | Ruby | mit | 19 | main | 1,646 | module Providers
module Means
class CashOutgoingsController < ProviderBaseController
before_action :setup_cash_outgoings, only: %i[show update]
def show
@none_selected = legal_aid_application.no_cash_outgoings?
end
def update
if aggregated_cash_outgoings.update(form_param... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/controllers/providers/means/dependants_controller.rb | Ruby | mit | 19 | main | 1,209 | module Providers
module Means
class DependantsController < ProviderBaseController
def show
@form = LegalAidApplications::DependantForm.new(model: dependant)
end
def new
@form = LegalAidApplications::DependantForm.new(model: dependant)
end
def update
@form = ... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/controllers/providers/means/remove_state_benefits_controller.rb | Ruby | mit | 19 | main | 1,126 | module Providers
module Means
class RemoveStateBenefitsController < ProviderBaseController
def show
form
regular_transaction
end
def update
if form.valid?
regular_transaction&.destroy! if form.remove_state_benefit?
if applicant_state_benefits.none?
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/controllers/providers/means/full_employment_details_controller.rb | Ruby | mit | 19 | main | 1,021 | module Providers
module Means
class FullEmploymentDetailsController < ProviderBaseController
delegate :hmrc_response_use_case_one, to: :legal_aid_application
def show
message_sentry if hmrc_still_pending?
@form = LegalAidApplications::FullEmploymentDetailsForm.new(model: legal_aid_app... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/controllers/providers/means/policy_disregards_controller.rb | Ruby | mit | 19 | main | 758 | module Providers
module Means
class PolicyDisregardsController < ProviderBaseController
def show
@form = Providers::PolicyDisregardsForm.new(model: policy_disregards)
end
def update
@form = Providers::PolicyDisregardsForm.new(form_params)
render :show unless save_continu... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/controllers/providers/means/capital_disregards/mandatory_controller.rb | Ruby | mit | 19 | main | 1,004 | module Providers
module Means
module CapitalDisregards
class MandatoryController < ProviderBaseController
prefix_step_with :capital_disregards
def show
@form = Providers::Means::CapitalDisregards::MandatoryForm.new(model: legal_aid_application)
end
def update
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/controllers/providers/means/capital_disregards/add_details_controller.rb | Ruby | mit | 19 | main | 1,196 | module Providers
module Means
module CapitalDisregards
class AddDetailsController < ProviderBaseController
prefix_step_with :capital_disregards
def show
@form = AddDetailsForm.new(model: capital_disregard)
end
def update
@form = AddDetailsForm.new(form_pa... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/controllers/providers/means/capital_disregards/discretionary_controller.rb | Ruby | mit | 19 | main | 873 | module Providers
module Means
module CapitalDisregards
class DiscretionaryController < ProviderBaseController
prefix_step_with :capital_disregards
def show
@form = DiscretionaryForm.new(model: legal_aid_application)
end
def update
@form = DiscretionaryFo... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/controllers/providers/dwp/partner_overrides_controller.rb | Ruby | mit | 19 | main | 1,326 | module Providers
module DWP
class PartnerOverridesController < ProviderBaseController
prefix_step_with :dwp
include DWPOutcomeHelper
def show
checking_dwp_status!(legal_aid_application)
@form = Providers::DWP::PartnerOverridesForm.new(model: partner)
end
def update... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/controllers/providers/dwp/results_controller.rb | Ruby | mit | 19 | main | 1,832 | module Providers
module DWP
class ResultsController < ProviderBaseController
prefix_step_with :dwp
include ApplicantDetailsCheckable
include BenefitCheckSkippable
include DWPOutcomeHelper
before_action :check_benefits, :benefit_check_status, only: :show
def show
deta... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/controllers/providers/dwp/fallback_controller.rb | Ruby | mit | 19 | main | 1,993 | module Providers
module DWP
class FallbackController < ProviderBaseController
prefix_step_with :dwp
include ApplicantDetailsCheckable
include DWPOutcomeHelper
def show
@form = Providers::DWP::FallbackForm.new(model: partner)
reset_confirm_dwp_status!(legal_aid_application... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/controllers/test/datastore_payloads_controller.rb | Ruby | mit | 19 | main | 1,382 | # :nocov:
module Test
# This controller is used to render the payload that would be sent to the datastore.
#
# The test_datastore_payloads_xxx_path(s) route are defined in development only
#
class DatastorePayloadsController < ApplicationController
before_action :authenticate_provider!
before_action ... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/controllers/test/generate_error_controller.rb | Ruby | mit | 19 | main | 515 | module Test
# This controller is used purely for generating an error so that we can
# see it being reported in Sentry or Slack, according to the value in the Setting
#
class GenerateErrorController < ApplicationController
def trapped_error
raise "Test Error Generated - to test the reporting of errors"... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/controllers/test/sessions_controller.rb | Ruby | mit | 19 | main | 518 | module Test
# This controller is used purely for setting session variables for RSpec request spec.
# Use with the #set_session method defined in spec/rails_helper.rb
#
# The test_session_path route is defined in test environment only
#
class SessionsController < ApplicationController
def create
js... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/base_employed_form.rb | Ruby | mit | 19 | main | 1,371 | class BaseEmployedForm < BaseForm
EMPLOYMENT_TYPES = %i[employed self_employed armed_forces].freeze
CHECK_BOXES_ATTRIBUTES = (EMPLOYMENT_TYPES + [:none_selected]).freeze
attr_accessor(*CHECK_BOXES_ATTRIBUTES)
validate :validate_any_checkbox_checked, unless: :draft?
validate :validate_none_and_another_checkb... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/base_file_uploader_form.rb | Ruby | mit | 19 | main | 3,315 | class BaseFileUploaderForm < BaseForm
include MalwareScanning
MAX_FILE_SIZE = 7.megabytes
ALLOWED_CONTENT_TYPES = %w[
application/pdf
application/msword
application/vnd.oasis.opendocument.text
text/rtf
text/plain
application/rtf
image/jpeg
image/png
image/tiff
image/bmp
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/base_address_lookup_form.rb | Ruby | mit | 19 | main | 389 | class BaseAddressLookupForm < BaseForm
before_validation :normalise_postcode
validates :postcode, presence: true, unless: :draft?
validates :postcode, format: { with: POSTCODE_REGEXP, allow_blank: true }
def save_as_draft
@draft = true
save!
end
private
def normalise_postcode
return if postc... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/base_bank_statement_form.rb | Ruby | mit | 19 | main | 3,712 | class BaseBankStatementForm
include ActiveModel::Model
include ActiveModel::Validations::Callbacks
include MalwareScanning
attr_reader :attachment_type, :attachment_type_capture
MAX_FILE_SIZE = 7.megabytes
ALLOWED_CONTENT_TYPES = %w[
application/pdf
application/msword
application/vnd.oasis.op... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/base_address_selection_form.rb | Ruby | mit | 19 | main | 902 | class BaseAddressSelectionForm < BaseForm
before_validation :deserialize_address
validate :lookup_id_present
def initialize(*args)
super
attributes[:lookup_used] = true
end
private
def deserialize_address
return if lookup_id.blank?
attributes[:address_line_one] = selected_address.address_... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/base_employment_income_form.rb | Ruby | mit | 19 | main | 845 | class BaseEmploymentIncomeForm < BaseForm
attr_accessor :extra_employment_information, :extra_employment_information_details
before_validation :clear_employment_info_details
validate :extra_employment_information_presence
validate :extra_employment_information_details_presence
private
def extra_employment... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/base_form.rb | Ruby | mit | 19 | main | 3,838 | class BaseForm
include ActiveModel::Model
include ActiveModel::Validations::Callbacks
include ActiveSupport::Callbacks
define_callbacks :save, :validation
attr_writer :model
class << self
def form_for(klass)
@model_class = klass
end
def model_class
# If there are any errors on th... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/incidents/when_contact_was_made_form.rb | Ruby | mit | 19 | main | 1,692 | module Incidents
class WhenContactWasMadeForm < BaseForm
form_for ApplicationMeritsTask::Incident
attr_accessor :first_contact_date_1i, :first_contact_date_2i, :first_contact_date_3i
attr_writer :first_contact_date
validates :first_contact_date, presence: true, unless: :draft_and_not_partially_compl... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/incidents/told_on_form.rb | Ruby | mit | 19 | main | 1,420 | module Incidents
class ToldOnForm < BaseForm
form_for ApplicationMeritsTask::Incident
DATE_OPTIONS = {
date: {
format: Date::DATE_FORMATS[:date_picker_parse_format],
strict_pattern: Date::DATE_PATTERNS[:date_picker_strict],
not_in_the_future: true,
},
}.freeze
att... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/proceedings/emergency_level_of_service_form.rb | Ruby | mit | 19 | main | 826 | module Proceedings
class EmergencyLevelOfServiceForm < BaseForm
form_for Proceeding
attr_accessor :emergency_level_of_service,
:levels_of_service
validates :emergency_level_of_service, presence: true, unless: :draft?
def exclude_from_model
[:levels_of_service]
end
d... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/proceedings/emergency_defaults_form.rb | Ruby | mit | 19 | main | 2,701 | module Proceedings
class EmergencyDefaultsForm < BaseForm
form_for Proceeding
attr_accessor :accepted_emergency_defaults,
:additional_params,
:hearing_date,
:limitation_note
validates :accepted_emergency_defaults, inclusion: ["true", "false", true, f... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/proceedings/scope_limitations_form.rb | Ruby | mit | 19 | main | 5,898 | module Proceedings
class ScopeLimitationsForm < BaseForm
include ActiveModel::Model
form_for Proceeding
attr_accessor :draft, :scopes, :scope_codes, :scope_type
validate :validate_scope_selected,
:validate_hearing_dates,
:validate_limitation_notes
def initialize(attri... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/proceedings/proceeding_loop_resettable.rb | Ruby | mit | 19 | main | 975 | module Proceedings
module ProceedingLoopResettable
extend ActiveSupport::Concern
included do
private
def reset_proceeding_loop
model.update!(
accepted_emergency_defaults: nil,
accepted_substantive_defaults: nil,
emergency_level_of_service: nil,
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/proceedings/client_involvement_type_form.rb | Ruby | mit | 19 | main | 1,335 | module Proceedings
class ClientInvolvementTypeForm < BaseForm
include ProceedingLoopResettable
form_for Proceeding
attr_accessor :client_involvement_type_ccms_code
before_validation :assign_client_involvement_type_description,
if: -> { client_involvement_type_ccms_code.present... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/proceedings/substantive_defaults_form.rb | Ruby | mit | 19 | main | 2,442 | module Proceedings
class SubstantiveDefaultsForm < BaseForm
form_for Proceeding
# TODO: dated 3 OCT 2022 @colinbruce Additional data requirements
# The full method of handling additional data was not implemented for substantive defaults
# this is because at the time of writing, no default substantive... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/proceedings/substantive_level_of_service_form.rb | Ruby | mit | 19 | main | 836 | module Proceedings
class SubstantiveLevelOfServiceForm < BaseForm
form_for Proceeding
attr_accessor :substantive_level_of_service,
:levels_of_service
validates :substantive_level_of_service, presence: { unless: :draft? }
def exclude_from_model
[:levels_of_service]
end
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/proceedings/delegated_functions_form.rb | Ruby | mit | 19 | main | 2,442 | module Proceedings
class DelegatedFunctionsForm < BaseForm
include ProceedingLoopResettable
form_for Proceeding
attr_accessor :used_delegated_functions, :used_delegated_functions_on
validates :used_delegated_functions, inclusion: [true, false, "true", "false"], unless: :draft?
validates :used_... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/proceedings/final_hearing_form.rb | Ruby | mit | 19 | main | 1,208 | module Proceedings
class FinalHearingForm < BaseForm
form_for FinalHearing
attr_accessor :work_type,
:listed,
:date,
:details,
:proceeding_id
validates :work_type, inclusion: { in: [:substantive, :emergency, "substantive", "emergenc... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/partners/employed_form.rb | Ruby | mit | 19 | main | 396 | module Partners
class EmployedForm < BaseEmployedForm
form_for Partner
private
def error_message_for_none_selected
I18n.t("activemodel.errors.models.partner.attributes.base.none_selected")
end
def error_message_for_none_and_another_option_selected
I18n.t("activemodel.errors.models.app... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/partners/client_has_partner_form.rb | Ruby | mit | 19 | main | 270 | module Partners
class ClientHasPartnerForm < BaseForm
form_for Applicant
attr_accessor :has_partner
validates :has_partner, inclusion: [true, false, "true", "false"], unless: :draft?
def has_partner?
has_partner.eql?("true")
end
end
end |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/partners/contrary_interests_form.rb | Ruby | mit | 19 | main | 343 | module Partners
class ContraryInterestsForm < BaseForm
form_for Applicant
attr_accessor :partner_has_contrary_interest
validates :partner_has_contrary_interest, inclusion: [true, false, "true", "false"], unless: :draft?
def partner_has_contrary_interest?
partner_has_contrary_interest.eql?("tr... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/partners/offline_accounts_form.rb | Ruby | mit | 19 | main | 2,133 | module Partners
class OfflineAccountsForm < BaseForm
form_for SavingsAmount
ATTRIBUTES = %i[
partner_offline_current_accounts
partner_offline_savings_accounts
].freeze
CHECK_BOXES_ATTRIBUTES = (ATTRIBUTES.map { |attribute| :"check_box_#{attribute}" } + %i[no_partner_account_selected]).fr... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/partners/details_form.rb | Ruby | mit | 19 | main | 1,457 | module Partners
class DetailsForm < BaseForm
include NationalInsuranceHandling
include DateOfBirthHandling
ATTRIBUTES = %i[first_name
last_name
has_national_insurance_number
national_insurance_number
date_of_birth_1i
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/partners/full_employment_details_form.rb | Ruby | mit | 19 | main | 209 | module Partners
class FullEmploymentDetailsForm < BaseForm
form_for Partner
attr_accessor :full_employment_details
validates :full_employment_details, presence: true, unless: :draft?
end
end |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/partners/employment_income_form.rb | Ruby | mit | 19 | main | 353 | module Partners
class EmploymentIncomeForm < BaseEmploymentIncomeForm
form_for Partner
attr_accessor :extra_employment_information, :extra_employment_information_details
private
def add_blank_error_for(attribute)
errors.add(attribute, I18n.t("activemodel.errors.models.partner.attributes.#{attri... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/partners/unexpected_employment_income_form.rb | Ruby | mit | 19 | main | 575 | module Partners
class UnexpectedEmploymentIncomeForm < BaseForm
form_for Partner
attr_accessor :extra_employment_information_details
validate :extra_employment_information_details_presence
private
def extra_employment_information_details_presence
return if draft?
add_blank_error_for... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/savings_amounts/offline_accounts_form.rb | Ruby | mit | 19 | main | 3,177 | module SavingsAmounts
class OfflineAccountsForm < BaseForm
form_for SavingsAmount
ATTRIBUTES = %i[
offline_current_accounts
offline_savings_accounts
partner_offline_current_accounts
partner_offline_savings_accounts
joint_offline_current_accounts
joint_offline_savings_accou... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/savings_amounts/savings_amounts_form.rb | Ruby | mit | 19 | main | 2,766 | module SavingsAmounts
class SavingsAmountsForm < BaseForm
form_for SavingsAmount
ATTRIBUTES = %i[
cash
other_person_account
national_savings
plc_shares
peps_unit_trusts_capital_bonds_gov_stocks
life_assurance_endowment_policy
].freeze
CHECK_BOXES_ATTRIBUTES = (ATT... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/savings_amounts/offline_savings_accounts_form.rb | Ruby | mit | 19 | main | 929 | module SavingsAmounts
class OfflineSavingsAccountsForm < BaseForm
form_for SavingsAmount
attr_accessor :offline_savings_accounts, :applicant_bank_account
before_validation :clear_savings_amount
validates(:offline_savings_accounts, presence: true, if: proc { |form| form.applicant_bank_account.to_s =... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/student_finances/base_student_finance_form.rb | Ruby | mit | 19 | main | 524 | module StudentFinances
class BaseStudentFinanceForm < BaseForm
validates :student_finance, inclusion: { in: %w[true false] }, unless: :draft?
validates :student_finance_amount, currency: { greater_than_or_equal_to: 0 }, if: :student_finance?, unless: :draft?
before_validation do
attributes[:student... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/opponents/individual_form.rb | Ruby | mit | 19 | main | 710 | module Opponents
class IndividualForm < BaseForm
form_for ApplicationMeritsTask::Opponent
attr_accessor :first_name, :last_name, :legal_aid_application
validates :first_name, :last_name, presence: true, unless: :draft?
def save
return false unless valid?
model.legal_aid_application = l... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/opponents/organisation_form.rb | Ruby | mit | 19 | main | 1,277 | module Opponents
class OrganisationForm < BaseForm
form_for ApplicationMeritsTask::Opponent
attr_accessor :name, :organisation_type_ccms_code, :description, :legal_aid_application
validates :name, :organisation_type_ccms_code, presence: true, unless: :draft?
def organisation_types
@organisati... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/opponents/mental_capacity_form.rb | Ruby | mit | 19 | main | 674 | module Opponents
class MentalCapacityForm < BaseForm
form_for ApplicationMeritsTask::PartiesMentalCapacity
attr_accessor :understands_terms_of_court_order, :understands_terms_of_court_order_details
validates :understands_terms_of_court_order, presence: true, unless: :draft?
validates(
:underst... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/settings/setting_form.rb | Ruby | mit | 19 | main | 766 | module Settings
class SettingForm < BaseForm
form_for Setting
attr_accessor :mock_true_layer_data,
:manually_review_all_cases,
:allow_welsh_translation,
:enable_ccms_submission,
:collect_hmrc_data,
:collect_dwp_data,
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/applicants/has_national_insurance_number_form.rb | Ruby | mit | 19 | main | 544 | module Applicants
class HasNationalInsuranceNumberForm < BaseForm
include NationalInsuranceHandling
form_for Applicant
attr_accessor :has_national_insurance_number, :national_insurance_number
before_validation :normalise_national_insurance_number
validates :has_national_insurance_number, inclu... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/applicants/basic_details_form.rb | Ruby | mit | 19 | main | 1,580 | module Applicants
class BasicDetailsForm < BaseForm
include DateOfBirthHandling
ATTRIBUTES = %i[first_name
last_name
date_of_birth_1i
date_of_birth_2i
date_of_birth_3i
changed_last_name
las... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/applicants/employment_income_form.rb | Ruby | mit | 19 | main | 359 | module Applicants
class EmploymentIncomeForm < BaseEmploymentIncomeForm
form_for Applicant
attr_accessor :extra_employment_information, :extra_employment_information_details
private
def add_blank_error_for(attribute)
errors.add(attribute, I18n.t("activemodel.errors.models.applicant.attributes.#... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/applicants/previous_reference_form.rb | Ruby | mit | 19 | main | 1,110 | module Applicants
class PreviousReferenceForm < BaseForm
form_for Applicant
CCMS_REFERENCE_REGEXP = /\A[13][0-9]{11}\z/
attr_accessor :applied_previously, :previous_reference
before_validation :normalise_previous_reference
validates :applied_previously, inclusion: [true, false, "true", "false"... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/applicants/open_banking_consent_form.rb | Ruby | mit | 19 | main | 456 | module Applicants
class OpenBankingConsentForm < BaseForm
form_for LegalAidApplication
attr_accessor :open_banking_consent
validate :open_banking_consent_presence
private
def open_banking_consent_presence
return if open_banking_consent.present?
errors.add(:open_banking_consent, I18n... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/applicants/unexpected_employment_income_form.rb | Ruby | mit | 19 | main | 581 | module Applicants
class UnexpectedEmploymentIncomeForm < BaseForm
form_for Applicant
attr_accessor :extra_employment_information_details
validate :extra_employment_information_details_presence
private
def extra_employment_information_details_presence
return if draft?
add_blank_error... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/applicants/email_form.rb | Ruby | mit | 19 | main | 330 | module Applicants
class EmailForm < BaseForm
form_for Applicant
attr_accessor :email
before_validation :strip_email
validates :email, format: { with: URI::MailTo::EMAIL_REGEXP }, allow_blank: true
validates :email, presence: true, unless: :draft?
def strip_email
email.strip!
end
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/applicants/employed_form.rb | Ruby | mit | 19 | main | 402 | module Applicants
class EmployedForm < BaseEmployedForm
form_for Applicant
private
def error_message_for_none_selected
I18n.t("activemodel.errors.models.applicant.attributes.base.none_selected")
end
def error_message_for_none_and_another_option_selected
I18n.t("activemodel.errors.mode... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/base_regular_outgoings_form.rb | Ruby | mit | 19 | main | 1,410 | module Providers
class BaseRegularOutgoingsForm < RegularTransactionForm
OUTGOING_TYPES = %w[
rent_or_mortgage
child_care
maintenance_out
legal_aid
].freeze
OUTGOING_TYPES.each do |outgoing_type|
attr_accessor :"#{outgoing_type}_amount",
:"#{outgoing_type... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/uploaded_evidence_collection_form.rb | Ruby | mit | 19 | main | 861 | module Providers
class UploadedEvidenceCollectionForm < BaseFileUploaderForm
form_for UploadedEvidenceCollection
attr_accessor :original_file, :provider_uploader, :upload_button_pressed, :attachment_type
validate :original_file_valid
validate :file_uploaded?
def save
return unless origina... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/base_regular_income_form.rb | Ruby | mit | 19 | main | 646 | module Providers
class BaseRegularIncomeForm < RegularTransactionForm
INCOME_TYPES = %w[
benefits
friends_or_family
maintenance_in
property_or_lodger
pension
].freeze
INCOME_TYPES.each do |income_type|
attr_accessor :"#{income_type}_amount",
:"#{inc... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/received_benefit_confirmation_form.rb | Ruby | mit | 19 | main | 761 | module Providers
class ReceivedBenefitConfirmationForm < BaseForm
RadioOption = Struct.new(:value, :label)
form_for DWPOverride
SINGLE_VALUE_ATTRIBUTES = %i[
universal_credit
guarantee_credit_element_of_pension_credit
income_based_job_seekers_allowance
income_related_employment_a... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/regular_transaction_form.rb | Ruby | mit | 19 | main | 5,497 | module Providers
class RegularTransactionForm
include ActiveModel::Model
attr_reader :transaction_type_ids, :legal_aid_application
validates :transaction_type_ids, presence: true, unless: :none_selected?
validate :none_and_another_checkbox_not_both_checked
validate :all_regular_transactions_vali... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/other_assets_form.rb | Ruby | mit | 19 | main | 5,118 | module Providers
class OtherAssetsForm < BaseForm
form_for OtherAssetsDeclaration
VALUABLE_ITEMS_VALUE_ATTRIBUTE = %i[valuable_items_value].freeze
SINGLE_VALUE_ATTRIBUTES = %i[
timeshare_property_value
land_value
inherited_assets_value
money_owed_value
trust_value
].fre... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/bank_statement_form.rb | Ruby | mit | 19 | main | 793 | module Providers
class BankStatementForm < BaseBankStatementForm
def initialize(bank_statement_form_params)
super
@attachment_type = "bank_statement_evidence"
@attachment_type_capture = /^#{@attachment_type}_(\d+)$/
end
private
def any_bank_statements_or_draft?
legal_aid_applic... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/policy_disregards_form.rb | Ruby | mit | 19 | main | 1,914 | module Providers
class PolicyDisregardsForm < BaseForm
form_for PolicyDisregards
SINGLE_VALUE_ATTRIBUTES = %i[
england_infected_blood_support
vaccine_damage_payments
variant_creutzfeldt_jakob_disease
criminal_injuries_compensation_scheme
national_emergencies_trust
we_love_... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/office_form.rb | Ruby | mit | 19 | main | 412 | module Providers
class OfficeForm < BaseForm
form_for Provider
attr_accessor :selected_office_code
validates :selected_office_code, presence: true
validate :selected_code_was_provided
private
def selected_code_was_provided
return if selected_office_code.nil?
errors.add(:selected... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/application_merits_task/domestic_abuse_summary_form.rb | Ruby | mit | 19 | main | 2,905 | module Providers
module ApplicationMeritsTask
class DomesticAbuseSummaryForm < BaseForm
form_for ::ApplicationMeritsTask::DomesticAbuseSummary
attr_accessor :warning_letter_sent, :warning_letter_sent_details,
:police_notified, :police_notified_details, :police_notified_details_tru... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/application_merits_task/first_appeal_court_type_form.rb | Ruby | mit | 19 | main | 380 | module Providers
module ApplicationMeritsTask
class FirstAppealCourtTypeForm < BaseAppealCourtTypeForm
form_for ::ApplicationMeritsTask::Appeal
attr_accessor :court_type
validates :court_type, presence: true, inclusion: { in: FIRST_APPEAL_COURT_TYPES }, unless: :draft?
def court_types
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/application_merits_task/biological_parent_form.rb | Ruby | mit | 19 | main | 850 | module Providers
module ApplicationMeritsTask
class BiologicalParentForm < BaseForm
form_for Applicant
attr_accessor :relationship_to_children
validates :relationship_to_children,
inclusion: {
in: %w[biological false],
message: I18n.t("provid... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/application_merits_task/statement_of_case_choice_form.rb | Ruby | mit | 19 | main | 1,496 | module Providers
module ApplicationMeritsTask
class StatementOfCaseChoiceForm < BaseForm
form_for ::ApplicationMeritsTask::StatementOfCase
attr_accessor :statement, :upload, :typed, :choice
validate :validate_any_checkbox_checked, unless: :draft?
validates :statement, presence: true, if:... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/application_merits_task/second_appeal_court_type_form.rb | Ruby | mit | 19 | main | 383 | module Providers
module ApplicationMeritsTask
class SecondAppealCourtTypeForm < BaseAppealCourtTypeForm
form_for ::ApplicationMeritsTask::Appeal
attr_accessor :court_type
validates :court_type, presence: true, inclusion: { in: SECOND_APPEAL_COURT_TYPES }, unless: :draft?
def court_types... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/application_merits_task/matter_opposed_form.rb | Ruby | mit | 19 | main | 276 | module Providers
module ApplicationMeritsTask
class MatterOpposedForm < BaseForm
form_for ::ApplicationMeritsTask::MatterOpposition
attr_accessor :matter_opposed
validates :matter_opposed, inclusion: %w[true false], unless: :draft?
end
end
end |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/application_merits_task/base_appeal_court_type_form.rb | Ruby | mit | 19 | main | 426 | module Providers
module ApplicationMeritsTask
class BaseAppealCourtTypeForm < BaseForm
SECOND_APPEAL_COURT_TYPES = %w[
court_of_appeal
supreme_court
].freeze
FIRST_APPEAL_COURT_TYPES =
SECOND_APPEAL_COURT_TYPES + %w[
other_court
].freeze
# :nocov... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/application_merits_task/client_denial_of_allegation_form.rb | Ruby | mit | 19 | main | 759 | module Providers
module ApplicationMeritsTask
class ClientDenialOfAllegationForm < BaseForm
form_for ::ApplicationMeritsTask::Allegation
attr_accessor :denies_all, :additional_information
validate :denies_all_presence
validates :additional_information, presence: true, if: :requires_addit... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/application_merits_task/in_scope_of_laspo_form.rb | Ruby | mit | 19 | main | 233 | module Providers
module ApplicationMeritsTask
class InScopeOfLaspoForm < BaseForm
form_for LegalAidApplication
attr_accessor :in_scope_of_laspo
validates :in_scope_of_laspo, presence: true
end
end
end |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/application_merits_task/plf_court_order_form.rb | Ruby | mit | 19 | main | 332 | module Providers
module ApplicationMeritsTask
class PLFCourtOrderForm < BaseForm
form_for LegalAidApplication
attr_accessor :plf_court_order
validates :plf_court_order, inclusion: %w[true false], unless: :draft?
def copy_of_court_order?
plf_court_order == "true"
end
en... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/application_merits_task/parental_responsibilities_form.rb | Ruby | mit | 19 | main | 909 | module Providers
module ApplicationMeritsTask
class ParentalResponsibilitiesForm < BaseForm
form_for Applicant
attr_accessor :relationship_to_children
validates :relationship_to_children,
inclusion: {
in: %w[court_order parental_responsibility_agreement false]... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/application_merits_task/child_subject_form.rb | Ruby | mit | 19 | main | 840 | module Providers
module ApplicationMeritsTask
class ChildSubjectForm < BaseForm
form_for Applicant
attr_accessor :relationship_to_children
validates :relationship_to_children,
inclusion: {
in: %w[child_subject false],
message: I18n.t("provide... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/application_merits_task/nature_of_urgency_form.rb | Ruby | mit | 19 | main | 1,048 | module Providers
module ApplicationMeritsTask
class NatureOfUrgencyForm < BaseForm
form_for ::ApplicationMeritsTask::Urgency
attr_accessor :nature_of_urgency,
:hearing_date_set,
:hearing_date
validates :nature_of_urgency,
:hearing_date_se... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/application_merits_task/second_appeal_form.rb | Ruby | mit | 19 | main | 623 | module Providers
module ApplicationMeritsTask
class SecondAppealForm < BaseForm
form_for ::ApplicationMeritsTask::Appeal
attr_accessor :second_appeal
validates :second_appeal, presence: true, unless: :draft?
set_callback :save, :before, :sync_second_appeal_details
private
de... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/application_merits_task/client_offered_undertakings_form.rb | Ruby | mit | 19 | main | 1,650 | module Providers
module ApplicationMeritsTask
class ClientOfferedUndertakingsForm < BaseForm
form_for ::ApplicationMeritsTask::Undertaking
attr_accessor :offered, :additional_information, :additional_information_true, :additional_information_false
validates :offered, inclusion: { in: %w[true f... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/application_merits_task/involved_child_form.rb | Ruby | mit | 19 | main | 2,109 | module Providers
module ApplicationMeritsTask
class InvolvedChildForm < BaseForm
form_for ::ApplicationMeritsTask::InvolvedChild
BASE_ATTRIBUTES = %i[first_name last_name].freeze
MODEL_ATTRIBUTES = BASE_ATTRIBUTES + %i[date_of_birth].freeze # Used in controller parameter handling
ATTRIB... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/application_merits_task/original_judge_level_form.rb | Ruby | mit | 19 | main | 864 | module Providers
module ApplicationMeritsTask
class OriginalJudgeLevelForm < BaseForm
form_for ::ApplicationMeritsTask::Appeal
attr_accessor :original_judge_level
set_callback :save, :before, :sync_court_type
JUDGE_LEVELS = %w[
family_panel_magistrates
deputy_district_ju... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/application_merits_task/statement_of_case_upload_form.rb | Ruby | mit | 19 | main | 1,635 | module Providers
module ApplicationMeritsTask
class StatementOfCaseUploadForm < BaseFileUploaderForm
form_for ::ApplicationMeritsTask::StatementOfCase
attr_accessor :original_file, :original_filename, :provider_uploader, :upload_button_pressed
def exclude_from_model
%i[upload_button_pr... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/application_merits_task/matter_opposed_reason_form.rb | Ruby | mit | 19 | main | 292 | module Providers
module ApplicationMeritsTask
class MatterOpposedReasonForm < BaseForm
form_for ::ApplicationMeritsTask::MatterOpposition
attr_accessor :reason, :legal_aid_application_id
validates :reason, :legal_aid_application_id, presence: true
end
end
end |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/proceeding_interrupts/related_orders_form.rb | Ruby | mit | 19 | main | 1,682 | module Providers
module ProceedingInterrupts
class RelatedOrdersForm < BaseForm
form_for Proceeding
ORDER_TYPES = %i[
care
supervision
secure_accommodation
placement
adoption
emergency_protection
child_assessment
parenting
child_... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/link_application/copy_form.rb | Ruby | mit | 19 | main | 526 | module Providers
module LinkApplication
class CopyForm < BaseForm
form_for LegalAidApplication
attr_accessor :copy_case
validates :copy_case, inclusion: [true, false, "true", "false"], unless: :draft?
def save
model.update!(copy_case_id: ActiveRecord::Type::Boolean.new.cast(copy... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/link_application/confirm_link_form.rb | Ruby | mit | 19 | main | 646 | module Providers
module LinkApplication
class ConfirmLinkForm < BaseForm
form_for LinkedApplication
attr_accessor :confirm_link
validates :confirm_link, presence: true, unless: :draft?
def save
super
if confirm_link == "No"
model.update!(confirm_link: nil)
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/link_application/find_link_application_form.rb | Ruby | mit | 19 | main | 1,755 | module Providers
module LinkApplication
class FindLinkApplicationForm < BaseForm
form_for LinkedApplication
APPLICATION_REF_REGEXP = /\AL-[0-9ABCDEFHJKLMNPRTUVWXY]{3}-[0-9ABCDEFHJKLMNPRTUVWXY]{3}\z/i
attr_accessor :search_laa_reference, :legal_aid_application
validates :search_laa_refer... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/link_application/make_link_form.rb | Ruby | mit | 19 | main | 1,228 | module Providers
module LinkApplication
class MakeLinkForm < BaseForm
form_for LinkedApplication
attr_accessor :link_type_code
validates :link_type_code, presence: true, unless: :draft?
def save
if link_type_code == "false"
model.associated_application.update!(copy_cas... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/partners/bank_statement_form.rb | Ruby | mit | 19 | main | 861 | module Providers
module Partners
class BankStatementForm < BaseBankStatementForm
def initialize(bank_statement_form_params)
super
@attachment_type = "part_bank_state_evidence"
@attachment_type_capture = /^#{@attachment_type}_(\d+)$/
end
private
def any_bank_statemen... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/partners/receives_state_benefits_form.rb | Ruby | mit | 19 | main | 335 | module Providers
module Partners
class ReceivesStateBenefitsForm < BaseForm
form_for Partner
attr_accessor :receives_state_benefits
validates :receives_state_benefits, presence: true, unless: :draft?
def receives_state_benefits?
receives_state_benefits.eql?("true")
end
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | app/forms/providers/means/housing_benefit_form.rb | Ruby | mit | 19 | main | 931 | module Providers
module Means
class HousingBenefitForm < RegularTransactionForm
include ApplicantOwner
attr_accessor :housing_benefit_amount, :housing_benefit_frequency
delegate :applicant_in_receipt_of_housing_benefit, to: :legal_aid_application
def housing_benefit_transaction_type
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.