= 2.2 (Jan 18, 2012) * fixed a bug in the initiliazer file regarding dynamic shortcuts = 2.1 (Nov 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 = 2.0 (Nov 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 ! = 1.2 (Nov 4, 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) = 1.1 (Oct 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). = 1.0 (Aug 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 = 0.7 (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 = 0.6 (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 = 0.5.1 (June 07, 2011) * fixed a nasty typo on a variable name and added a spec to make it never happen again = 0.5 (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 (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 = v0.3 (June 06, 2011) * multiple roles check: * has_all_roles? returns true if the user has ALL the roles in arguments * has_any_role? returns true if the user has ANY the roles in arguments = v0.2 (June 04, 2011) * fixed the generator to include the lib * fixed the migration file with missing polymorphic field * added some examples in documentation = v0.1 (June 04, 2011) * first release