v1.0.0 — bonkers-bitfields (maintained fork of grosser/bitfields)
First release of bonkers-bitfields, a maintained fork of
grosser/bitfields. Modernized for current
Ruby and Rails, with safer bit declarations.
Upgrading from bitfields
Only your Gemfile changes — the library path and module are unchanged:
gem "bonkers-bitfields" # was: gem "bitfields"require "bitfields" # unchanged
include Bitfields # unchanged — all generated methods keep workingHighlights
Breaking
- Renamed the published gem to
bonkers-bitfields(require path /Bitfieldsmodule unchanged). - Positional declarations now warn by default.
bitfield :flags, :a, :bmaps each name to
2**index, so reordering silently shifts stored bits. Control withBitfields.positional_bits
(:warndefault /:forbid/:allow); prefer explicitbitfield :flags, 1 => :a, 2 => :b. - Duplicate bit names across columns now raise
DuplicateBitNameErrorat declaration time. - Dropped support for Ruby < 3.1 and ActiveRecord < 6.1. Now tested on Ruby 3.1–4.0 × AR 6.1–8.0.
Added
Bitfields.positional_bitsconfiguration, withnil/:_skipbit-position placeholders.with_bitfields/without_bitfieldsclass query methods (Arel-based, survive eager-load
aliasing) — resolves the long-standing README TODO and grosser#45.- GitHub Actions CI on every branch and PR; tag-triggered RubyGems publishing via Trusted Publishing.
Fixed
- Cross-column duplicate bit names no longer silently misbehave (grosser#21).
- README SQL examples and a duplicated assertion in the
have_a_bitfieldmatcher.
Full changelog: CHANGELOG.md