Skip to content

Releases

v6.0.3

Choose a tag to compare

@enjaku4 enjaku4 released this 14 Oct 19:02
b4c2b1c

Bugs:

  • Fixed Rabarber.all_roles raising Rabarber::NotFoundError when a role's context is a class that is not an ActiveRecord model

v6.0.2

Choose a tag to compare

@enjaku4 enjaku4 released this 19 Jul 10:24

Bugs:

  • Fixed Rails commands failing when the configured user model class does not exist yet

v6.0.1

Choose a tag to compare

@enjaku4 enjaku4 released this 19 Jul 00:33
192967c

Bugs:

  • Fixed role management methods raising NameError when the configured user model is not named User
  • Fixed a race condition where outdated roles could remain cached after being changed
  • Fixed role creation and renaming raising ActiveRecord::RecordNotUnique instead of returning false when called concurrently
  • Fixed uniqueness of global and class context roles not being enforced at the database level

This release is fully backward compatible: existing applications continue to work as before without any changes. The new indexes only apply to new applications installing Rabarber. To get the same database-level protection in an existing application, run the following optional migration if your database supports partial indexes:

add_index :rabarber_roles, :name, unique: true, where: "context_type IS NULL AND context_id IS NULL"
add_index :rabarber_roles, [:name, :context_type], unique: true, where: "context_type IS NOT NULL AND context_id IS NULL"

On databases without partial index support, such as MySQL, uniqueness of global and class context roles remains, for now, enforced at the application level only.

Misc:

  • Rabarber.prune now clears the role cache

v6.0.0

Choose a tag to compare

@enjaku4 enjaku4 released this 01 Apr 16:39
19765f4

Breaking:

  • Removed methods deprecated in v5.2.0 from the public API
  • Dropped support for Ruby 3.2
  • Dropped support for Rails 7.1

Bugs:

  • Fixed cache clearing not working with Memcached

Misc:

  • Optimized cache key generation
  • Dropped some unnecessary dependencies

To upgrade to v6.0.0, please refer to the migration guide

v5.2.5

Choose a tag to compare

@enjaku4 enjaku4 released this 25 Dec 21:03
f1ce66a

Misc:

  • Added support for Ruby 4

v5.2.4

Choose a tag to compare

@enjaku4 enjaku4 released this 22 Oct 17:22
c6aad2f

Misc:

  • Added support for Rails 8.1

v5.2.3

Choose a tag to compare

@enjaku4 enjaku4 released this 10 Oct 23:29
cb6daba

Bugs:

  • Fixed context validation blocking Rails console and database commands when orphaned context classes exist

v5.2.2

Choose a tag to compare

@enjaku4 enjaku4 released this 08 Oct 16:34
6780536

Bugs:

  • Fixed deprecation warnings showing when calling non-deprecated methods

v5.2.1

Choose a tag to compare

@enjaku4 enjaku4 released this 06 Oct 15:00
b5313d7

Bugs:

  • Fixed error raised on Rails console commands when the database was not yet set up

v5.2.0

Choose a tag to compare

@enjaku4 enjaku4 released this 06 Oct 12:56
51a4d06

Features:

  • Added Rabarber.prune method to allow manual pruning of roles with deleted contexts

Misc:

  • revoke_all_roles now returns an empty array instead of nil for consistency with other role assignment methods
  • Deprecated the following role management methods in favor of new counterparts:
    • Rabarber::Role.names -> Rabarber.roles
    • Rabarber::Role.all_names -> Rabarber.all_roles
    • Rabarber::Role.add -> Rabarber.create_role
    • Rabarber::Role.rename -> Rabarber.rename_role
    • Rabarber::Role.remove -> Rabarber.delete_role
    • Rabarber::Role.assignees -> User.with_role