{"issue":{"state":"open","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"user":{"avatar_url":"https://secure.gravatar.com/avatar/68721930b6e2d5b125633cc3d28715c8?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"68721930b6e2d5b125633cc3d28715c8","url":"https://api.github.com/users/scottkf","login":"scottkf","id":11314},"milestone":{"state":"open","open_issues":4,"url":"https://api.github.com/repos/EppO/rolify/milestones/3","due_on":null,"description":"Rewrite of all queries for the roles lookup to improve speed.\r\nWill have to find the good balance between the number of DB requests required to process the lookup and the complexity of the query.\r\nWill have to be cross DB compatible too, or at least MySQL, PostgreSQL and if possible SQLite.","creator":{"avatar_url":"https://secure.gravatar.com/avatar/f5696f921180666d269c5740733582b1?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"f5696f921180666d269c5740733582b1","url":"https://api.github.com/users/EppO","login":"EppO","id":6111},"number":3,"title":"rolify 2.0","closed_issues":0,"created_at":"2011-10-14T14:03:50Z"},"assignee":null,"labels":[{"name":"1.1","color":"002288","url":"https://api.github.com/repos/EppO/rolify/labels/1.1"},{"name":"bugs","color":"444444","url":"https://api.github.com/repos/EppO/rolify/labels/bugs"}],"updated_at":"2011-11-03T13:12:27Z","comments":3,"closed_at":null,"url":"https://api.github.com/repos/EppO/rolify/issues/20","body":"I was getting AssociationTypeMismatch errors from this code: https://github.com/EppO/rolify/blob/master/lib/rolify/role.rb#L30-38\r\n\r\nI'm not quite sure why (the use of the `@@role_cname`?) it would be reloading the class if I wasn't touching it, but it did nonetheless. My solution was to change \r\n\r\n```ruby\r\nself.roles << role\r\n```\r\n\r\nto\r\n\r\n```ruby\r\nself.role_ids |= [role.id]\r\n```\r\nIt would update fast enough so the class would be the same.","html_url":"https://github.com/EppO/rolify/issues/20","number":20,"title":"Class caching in development","id":2126089,"created_at":"2011-11-02T20:31:28Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/68721930b6e2d5b125633cc3d28715c8?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"68721930b6e2d5b125633cc3d28715c8","url":"https://api.github.com/users/scottkf","login":"scottkf","id":11314},"updated_at":"2011-11-03T13:12:27Z","url":"https://api.github.com/repos/EppO/rolify/issues/comments/2616702","body":"All of the tests pass when I run it locally using Ruby 1.9.2p180 (from homebrew), and the issue only comes about in development because of [#L36](https://github.com/EppO/rolify/blob/master/lib/rolify/role.rb#L36; the Role class is being reloaded for some reason from `config.cache_classes = false`\r\n\r\nThe only thing I can think of is that calling the class dynamically causes it to reload? ","id":2616702,"created_at":"2011-11-03T13:12:27Z"}}