# radar/by_star

Lets you find ActiveRecord + Mongoid objects by year, month, fortnight, week and more!

Repository: https://github.com/radar/by_star
Canonical: https://ross.abutalabs.com/products/by_star
Homepage: http://ryanbigg.com
Language: Ruby
License: MIT
License Family: permissive
Last push: 2023-01-18T06:30:34+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 6492, "days_push": 1323, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1047, forks 72 (observed 2026-08-28T04:03:22.258250+00:00)

## What it is
ByStar is a Ruby gem that adds time-based query scopes to ActiveRecord and Mongoid models, letting you find records by year, month, fortnight, week, day, or arbitrary time ranges. It provides convenient finder methods like by_year, by_month, between_times, before, and after for time-oriented data queries.

## Use cases
- query posts created in a given year or month
- find records between two dates or times
- get all records from yesterday or last week
- find the next or previous record relative to a given record
- query records by calendar month, weekend, or fortnight
- filter ActiveRecord or Mongoid models by time ranges

## When to choose
- you use Rails ActiveRecord or Mongoid and frequently query by time periods
- you want reliable, tested scopes for year/month/week/fortnight queries instead of hand-writing date math
- you need calendar-aware queries like calendar months or weekends

## When to avoid
- you don't use ActiveRecord or Mongoid (e.g. Sequel, ROM, or non-Ruby stacks)
- your time queries are too complex or custom for the provided scopes
- you need a non-Ruby ORM time-querying solution

## Facets
- artifact type: library
- maturity: maintenance
- function: orm, database, date-time
- domain: databases, web-development, developer-tools
- platform: ruby, jvm
- tags: activerecord, mongoid, time-based-queries, rails, gem

## Member repositories
- radar/by_star (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:22.258250+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:01:08.819208+00:00, confidence not recorded.
  - readme: https://github.com/radar/by_star (fetched 2026-08-28T04:03:22.258250+00:00, sha f5ca879255d2)
  - homepage: http://ryanbigg.com (fetched 2026-08-29T13:02:27.392763+00:00, sha 7de34b15c737)
- Data as of 2026-08-30T08:39:29.467469+00:00.
