All Versions
Latest Version
Avg Release Cycle
150 days
Latest Release
728 days ago

Changelog History
Page 3

  • v2.1 Changes

    November 30, 2011
    • added syntactic sugar: grant and revoke are aliases for has_role and has_no_role
    • ๐Ÿ’Ž check if RUBY_ENGINE is defined in the gemspec to be able to use jdbc with JRuby for SQLite
  • v2.0 Changes

    November 10, 2011
    • improved performance of has_all_roles? method using one single DB query instead of doing one DB lookup per argument
      • significant speed-up when requesting with many arguments
      • database choice can mitigate the results
    • clean up the initializer code
      • using a DSL to configure the library
      • setting defaults for User and Role classes
      • dynamic shortcuts feature is now disabled by default. To turn it on:
      • set it to true in the initializer file
      • uncomment the extend Rolify::Dynamic line in the User class
      • detecting if it's loaded by Rails::Server or Rails::Console
    • ๐Ÿ’Ž now also running on Rubinius, JRuby, REE and Ruby 1.8. all specs pass successfully, yeah !
  • v1.2 Changes

    November 04, 2011
    • ๐Ÿ›  fixed a strange bug, probably rails related (thanks to @scottkf)
      • when using rails in development mode, the config.cache_classes = false makes the role class to be loaded at every call and can lead to a AssociationTypeMismatch
      • use of role_ids array instead of the roles association
    • ๐Ÿ’Ž now running on JRuby (specs are still failing for JRuby though)
  • v1.1 Changes

    October 14, 2011
    • โž• added a spec to test the rails generator using ammeter gem
    • ๐Ÿšš Gemfile cleanup, moved all dependencies in gemspec instead
    • ๐Ÿš€ edited the dependency to Rails 3.1 and newer, now that Rails 3.1 has been released
    • ๐Ÿ†• new role scoping capabilities
      • instance level : user.has_role "moderator", Forum.first (already supported in previous release). user has the moderator role only on that Forum in particular
      • class level : user.has_role "moderator", Forum. User has the moderator role on all instances of Forum
      • global level : user.has_role "moderator" (already supported in previous release). User has the moderator role globally (e.q. on all resources)
    • ๐Ÿ†• new scoped query capabilities
      • user.has_role? "moderator", Forum.first (already supported in previous release). asks if the user has the moderator role on Forum.first instance
      • user.has_role? "moderator", Forum. asks if the user has the moderator role on all Forum instances
      • user.has_role? "moderator" (already supported in previous release). asks if the user has the global moderator role
      • user.has_role? "moderator", :any. asks if the user has at least one moderator role no matter the scope is (instance, class or global).
  • v1.0 Changes

    August 25, 2011
    • โž• added a new parameter to disable dynamic shortcut methods due to potential incompatibility with other gems using method_missing with the same pattern
      • add Rolify.dynamic_shortcuts = false in the initializer file or
      • use the generator command with a third parameter:
      • rails g rolify:role Role User false
    • โœ‚ removed the railtie as it created more problems than it solved
    • ๐Ÿ”จ code refactoring to do some speed improvements and code clean up
    • โž• added a lot of specs to improve tests coverage
    • wrote a tutorial showing how to use rolify with CanCan and Devise
    • ๐Ÿ— rolify is now on travis-ci to monitor build status
  • v0.7 Changes

    June 20, 2011
    • โž• added a method_missing to catch newly created role outside the current ruby process (i.e. dynamic shortcut methods are not defined within this process)
      • dynamic shortcut is created on the fly in the method_missing to avoid extra method_missing for the same dynamic shortcut
      • check if the role actually exists in the database before defining the new method
      • first call is slower due to method_missing but next calls are fast
      • avoid strange bugs when spawning many ruby processes as the dynamic shortcut methods were only defined in the process that used the has_role command
  • v0.6 Changes

    June 19, 2011
    • ๐Ÿ‘ custom User and Role class names support
      • can now use other class names for Role and User classes
      • fixed generators and templates
      • join table is explicitly set to avoid alphabetical order issue
    • created a new railtie to load the dynamic shortcuts at startup
  • v0.5.1 Changes

    June 07, 2011
    • ๐Ÿ›  fixed a nasty typo on a variable name and added a spec to make it never happen again
  • v0.5 Changes

    June 07, 2011
    • ๐Ÿ‘ dynamic shortcuts support
      • creates automatically new methods upon new role creation (or at startup for a Rails app)
      • has_role "admin" will create a method called is_admin?
      • has_role "moderator", Forum.first will create 2 methods:
        • is_moderator_of?(resource)
        • is_moderator?
  • v0.4 Changes

    June 07, 2011
    • ๐Ÿ‘ removing role support
      • has_no_role removes a global role or a role scoped to a resource
      • Please note that trying to remove a global role whereas the user a role with the same name on a resource will remove that scoped role
      • Trying to remove a role scoped to a resource whereas the user has a global role won't remove it