{"action":"created","issue":{"url":"https://api.github.com/repos/lwe/simple_enum/issues/101","labels_url":"https://api.github.com/repos/lwe/simple_enum/issues/101/labels{/name}","comments_url":"https://api.github.com/repos/lwe/simple_enum/issues/101/comments","events_url":"https://api.github.com/repos/lwe/simple_enum/issues/101/events","html_url":"https://github.com/lwe/simple_enum/pull/101","id":71895738,"number":101,"title":"Development for v3","user":{"login":"lwe","id":83660,"avatar_url":"https://avatars.githubusercontent.com/u/83660?v=3","gravatar_id":"","url":"https://api.github.com/users/lwe","html_url":"https://github.com/lwe","followers_url":"https://api.github.com/users/lwe/followers","following_url":"https://api.github.com/users/lwe/following{/other_user}","gists_url":"https://api.github.com/users/lwe/gists{/gist_id}","starred_url":"https://api.github.com/users/lwe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lwe/subscriptions","organizations_url":"https://api.github.com/users/lwe/orgs","repos_url":"https://api.github.com/users/lwe/repos","events_url":"https://api.github.com/users/lwe/events{/privacy}","received_events_url":"https://api.github.com/users/lwe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-29T14:45:52Z","updated_at":"2015-04-29T16:09:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/lwe/simple_enum/pulls/101","html_url":"https://github.com/lwe/simple_enum/pull/101","diff_url":"https://github.com/lwe/simple_enum/pull/101.diff","patch_url":"https://github.com/lwe/simple_enum/pull/101.patch"},"body":"- [x] Enums should be symbols, see #100\r\n- [ ] #fetch method for SE::Enum, see #96 \r\n\r\nAny other wishes? Also feel free to try this branch and see if it fixes #100 as expected.\r\n\r\nThis is a new major version, because the change to return symbols is a breaking change.\r\n\r\n/cc @lucke84, @matthewrudy"},"comment":{"url":"https://api.github.com/repos/lwe/simple_enum/issues/comments/97482956","html_url":"https://github.com/lwe/simple_enum/pull/101#issuecomment-97482956","issue_url":"https://api.github.com/repos/lwe/simple_enum/issues/101","id":97482956,"user":{"login":"matthewrudy","id":8659,"avatar_url":"https://avatars.githubusercontent.com/u/8659?v=3","gravatar_id":"","url":"https://api.github.com/users/matthewrudy","html_url":"https://github.com/matthewrudy","followers_url":"https://api.github.com/users/matthewrudy/followers","following_url":"https://api.github.com/users/matthewrudy/following{/other_user}","gists_url":"https://api.github.com/users/matthewrudy/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewrudy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewrudy/subscriptions","organizations_url":"https://api.github.com/users/matthewrudy/orgs","repos_url":"https://api.github.com/users/matthewrudy/repos","events_url":"https://api.github.com/users/matthewrudy/events{/privacy}","received_events_url":"https://api.github.com/users/matthewrudy/received_events","type":"User","site_admin":false},"created_at":"2015-04-29T16:09:04Z","updated_at":"2015-04-29T16:09:04Z","body":"I think that including `:scope` as a default `:with` is something I'd remove\r\n\r\nMy projects has\r\n\r\n* 42 `as_enum` declarations\r\n* a maximum of 50 values from one of them\r\n\r\nIt means we create a whole mess of scopes.\r\n\r\nI created my own alternative\r\n\r\n``` ruby\r\nSimpleEnum.configure do |e|\r\n  e.with = [:attribute, :dirty, :my_scope]\r\nend\r\n\r\nmodule SimpleEnumCustomisations\r\n\r\n  # I want to say\r\n  #\r\n  #   Coupon.status_scope(:active)\r\n  #\r\n  def generate_enum_my_scope_methods_for(enum, accessor)\r\n    return unless respond_to?(:where)\r\n\r\n    name = accessor.name\r\n\r\n    singleton_class.send(:define_method, \"#{name}_scope\") do |key|\r\n      where(accessor.source => enum[key])\r\n    end\r\n  end\r\nend\r\n\r\nActiveRecord::Base.send :extend, SimpleEnumCustomisations\r\n```"}}