BananaCrystal / email-templates

This repository contains in-house email templates that serve as structure for our emails. Each template can be updated and modified to fit requirements.
MIT License
0 stars 0 forks source link

loan_transactions.rb #28

Open geekelo opened 1 month ago

geekelo commented 1 month ago

FILE

# frozen_string_literal: true

ActiveAdmin.register LoanTransaction do
  actions :all, except: [:new, :create, :destroy]
  includes :user, :transfer

  config.sort_order = 'created_at_desc'

  menu parent: 'Loans & Insurance', label: 'Loans'
  # See permitted parameters documentation:
  # https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
  #
  # Uncomment all parameters which should be permitted for assignment
  #
  permit_params :order, :order_date, :product_slug, :order_key, :status, :active

  index do
    selectable_column
    id_column
    column :user
    column 'Interest' do |loan_transaction|
     loan_transaction.interest
    end
    column :transfer
    column :status
    column :active
    column :order
    column 'Loan Item' do |loan_transaction|
      loan_transaction.product_slug
    end
    column :order_date
    column :created_at
    column :updated_at
    actions
  end
end
geekelo commented 1 month ago

This ActiveAdmin configuration sets up an admin interface for managing LoanTransaction records. The interface is designed to allow for viewing and updating existing records while preventing the creation or deletion of records. Here's a detailed explanation:

1. Menu Configuration

2. Actions Configuration

3. Includes

4. Sorting Configuration

5. Permitted Parameters

6. Index Page Configuration

Summary

This ActiveAdmin configuration provides a well-structured interface for viewing and managing LoanTransaction records. Admins can filter and sort through transactions, view detailed information, and edit records as needed. By excluding actions such as creating or deleting records, the configuration ensures that only existing data can be managed, which may be a deliberate choice to maintain data integrity for loan transactions.