First, I wanted to thank you for the work you've done with this great gem. I've used it in quite a few applications and it's saved me a bunch of time.
I'm currently working on a new application and it's using the new Rails 4.1 and I'm having a little difficulty getting a couple parts to work properly and I was wondering if this was a known issue or if I'm doing something wrong. The full application stack is ruby 2.0.0-p0, rails 4.1 and postgresql 9.2. I've made sure that I'm using the latest gem version of 2.5.4. Here's from my Gemfile.lock
the_role (2.5.4)
rails (>= 3, < 5)
the_string_to_slug (~> 1.2)
the_role_bootstrap3_ui (1.1)
haml
rails (>= 3, < 5)
Everything works as usual with the exception of sections and rules. When I attempt to create a rule or section, it's returning true, however the role hash does not get updated. I get the same behavior from both the UI (I'm using your the_role_bootstrap3_ui gem) and from the console.
Here's an example output from the console
[3] pry(main)> @role = Role.last
Role Load (0.5ms) SELECT "roles".* FROM "roles" ORDER BY "roles"."id" DESC LIMIT 1
=> #<Role id: 2, name: "not_admin", title: "Not Admin", description: "Not an admin role", the_role: {}, created_at: "2014-04-09 19:46:29", updated_at: "2014-04-09 19:46:29", parent_id: nil, lft: 3, rgt: 4, depth: 0>
[4] pry(main)> @role.create_section(:pages)
(0.2ms) BEGIN
Role Exists (0.7ms) SELECT 1 AS one FROM "roles" WHERE ("roles"."name" = 'not_admin' AND "roles"."id" != 2) LIMIT 1
Role Exists (0.2ms) SELECT 1 AS one FROM "roles" WHERE ("roles"."title" = 'Not Admin' AND "roles"."id" != 2) LIMIT 1
Role Load (0.3ms) SELECT "roles".* FROM "roles" WHERE "roles"."id" = $1 LIMIT 1 [["id", 2]]
SQL (0.7ms) UPDATE "roles" SET "depth" = 0 WHERE "roles"."id" IN (SELECT "roles"."id" FROM "roles" WHERE "roles"."id" = 2 ORDER BY "lft")
(2.7ms) COMMIT
=> true
The output from the log looks pretty much the same
Started POST "/admin/roles/2/sections" for 127.0.0.1 at 2014-04-09 13:12:34 -0700
Processing by Admin::RoleSectionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"QLrU1rw8CjJvAR1U8ASu0jl1z56iAR237r9WgzHn9As=", "section_name"=>"pages", "commit"=>"Create new section", "role_id"=>"2"}
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
Role Load (0.3ms) SELECT "roles".* FROM "roles" WHERE "roles"."id" = $1 LIMIT 1 [["id", 1]]
Role Load (0.2ms) SELECT "roles".* FROM "roles" WHERE "roles"."id" = $1 LIMIT 1 [["id", 2]]
(0.1ms) BEGIN
Role Exists (0.5ms) SELECT 1 AS one FROM "roles" WHERE ("roles"."name" = 'not_admin' AND "roles"."id" != 2) LIMIT 1
Role Exists (0.2ms) SELECT 1 AS one FROM "roles" WHERE ("roles"."title" = 'Not Admin' AND "roles"."id" != 2) LIMIT 1
Role Load (0.3ms) SELECT "roles".* FROM "roles" WHERE "roles"."id" = $1 LIMIT 1 [["id", 2]]
SQL (0.6ms) UPDATE "roles" SET "depth" = 0 WHERE "roles"."id" IN (SELECT "roles"."id" FROM "roles" WHERE "roles"."id" = 2 ORDER BY "lft")
(0.5ms) COMMIT
In either case it doesn't look like the role hash is being updated at all. Is there something that I'm missing or did I configure something wrong here?