Skip to content

Releases: bonkers-ie/bitfields

v1.0.2

Choose a tag to compare

@github-actions github-actions released this 29 Jun 23:29

Fixed

  • Plain gem "bonkers-bitfields" now loads the library under Bundler's auto-require (e.g. Rails'
    Bundler.require). Because the gem name (bonkers-bitfields) no longer matches the library file
    (bitfields.rb), Bundler previously failed to require it silently, leaving Bitfields undefined.
    A lib/bonkers-bitfields.rb shim that requires bitfields resolves this, so require: "bitfields"
    in the Gemfile is no longer needed.

Full Changelog: v1.0.1...v1.0.2

v1.0.1

Choose a tag to compare

@github-actions github-actions released this 29 Jun 23:29

Added

  • Tested against ActiveRecord 8.1 (Ruby 3.2+); supported range is now AR 6.1 – 8.1.

Fixed

  • Corrected the Rael Gugelmin Cunha contributor link, which pointed at another contributor's
    GitHub profile.

Changed

  • Gemfile.lock is no longer committed (standard for a library), so CI resolves dependencies
    fresh against each gemfiles/*.gemfile.

Full Changelog: v1.0.0...v1.0.1

v1.0.0 — bonkers-bitfields (maintained fork of grosser/bitfields)

Choose a tag to compare

@benwalsh benwalsh released this 29 Jun 20:21
dfb7fb2

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 working

Highlights

Breaking

  • Renamed the published gem to bonkers-bitfields (require path / Bitfields module unchanged).
  • Positional declarations now warn by default. bitfield :flags, :a, :b maps each name to
    2**index, so reordering silently shifts stored bits. Control with Bitfields.positional_bits
    (:warn default / :forbid / :allow); prefer explicit bitfield :flags, 1 => :a, 2 => :b.
  • Duplicate bit names across columns now raise DuplicateBitNameError at 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_bits configuration, with nil / :_skip bit-position placeholders.
  • with_bitfields / without_bitfields class 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_bitfield matcher.

Full changelog: CHANGELOG.md