Ruby on Rails app for managing agricultural land leasing between landowners and farmers, with financial year snapshots and payment tracking.
A specialized skill for working with KrishFlow, a Ruby on Rails 8 application that manages agricultural land leasing, tracking land ownership, farmer leases, and financial returns based on Indian financial year snapshots.
This skill helps you navigate and develop KrishFlow, understanding its unique person-centric architecture where individuals can be both landowners and farmers, its financial year snapshot system (April-March), and its land size conversion logic (bigha/biswa units).
The application uses a dual-role system where a `Person` can simultaneously be:
```
Person (landowner/farmer)
├── owned_lands (as landowner)
└── lease_snapshots (as farmer)
Land (physical property)
├── belongs_to :landowner (Person)
└── has_many :lease_snapshots
LeaseSnapshot (yearly lease terms)
├── belongs_to :land
├── belongs_to :farmer (Person)
└── has_many :payments
Payment (transaction record)
└── belongs_to :lease_snapshot
```
When setting up the project:
```bash
bundle install
rails db:create db:migrate db:seed
rails server
```
Always follow the person-centric model when creating database changes:
When modifying models:
Follow these patterns:
Run tests frequently during development:
```bash
rails test
rails test test/models/person_test.rb
rails test test/models/person_test.rb:test_validation
rails test:system
```
Before committing changes:
```bash
bundle exec brakeman
bundle exec rubocop
```
When working with data:
```bash
rails generate migration MigrationName
rails db:drop db:create db:migrate db:seed
rails console
```
The application has Devise gem installed but **not configured**. No User model or authentication routes exist. The app currently runs without authentication.
To implement authentication:
1. Run: `rails generate devise:install`
2. Run: `rails generate devise User`
3. Run: `rails db:migrate`
4. Add `devise_for :users` to `config/routes.rb`
5. Uncomment authentication UI in `app/views/layouts/application.html.erb`
1. **Financial year format**: Always "YYYY-YY" (e.g., "2024-25")
2. **Size units**: Store all sizes in `biswas`, display as `bigha/biswa`
3. **Person roles**: Never create separate Landowner/Farmer models - use Person with scopes
4. **Unique constraints**: One LeaseSnapshot per land per financial year
5. **Nested resources**: Always access payments through their lease snapshot
1. Find or create Person (landowner)
2. Create Land associated with landowner
3. Find or create Person (farmer)
4. Create LeaseSnapshot linking land to farmer for current financial year
5. Create Payments associated with the snapshot
The application uses nested resources:
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/agricultural-land-leasing-tracker/raw