Can't create a category


(Camille Roux) #1

When I try to create a category, I get an error:

Here is what I get in logs:

<hash>
  <date type="dateTime">2014-09-12T23:13:37+00:00</date>
  <guid>fdb8bf2e-eaa0-4906-a94b-8080273f38c4</guid>
  <user-id type="integer">2</user-id>
  <parameters>{"name":"Test","color":"AB9364","text_color":"FFFFFF","permissions":{"fr.category.everyone_permission":"1"},"allow_badges":"true","action":"create","controller":"categories"}</parameters>
  <action>create</action>
  <controller>categories</controller>
  <backtrace>[RAILS_ROOT]/app/models/group.rb:192:in `lookup_group'
[RAILS_ROOT]/app/models/group.rb:162:in `[]'
[RAILS_ROOT]/app/models/category.rb:300:in `block in resolve_permissions'
[RAILS_ROOT]/app/models/category.rb:296:in `each'
[RAILS_ROOT]/app/models/category.rb:296:in `map'
[RAILS_ROOT]/app/models/category.rb:296:in `resolve_permissions'
[RAILS_ROOT]/app/models/category.rb:235:in `set_permissions'
[RAILS_ROOT]/app/models/category.rb:242:in `permissions='
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/attribute_assignment.rb:45:in `public_send'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/attribute_assignment.rb:45:in `_assign_attribute'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/attribute_assignment.rb:56:in `block in assign_nested_parameter_attributes'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/attribute_assignment.rb:56:in `each'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/attribute_assignment.rb:56:in `assign_nested_parameter_attributes'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/attribute_assignment.rb:36:in `assign_attributes'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/core.rb:455:in `init_attributes'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/core.rb:198:in `initialize'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/inheritance.rb:30:in `new'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/inheritance.rb:30:in `new'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/persistence.rb:33:in `create'
[RAILS_ROOT]/app/controllers/categories_controller.rb:69:in `create'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/abstract_controller/base.rb:189:in `process_action'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_controller/metal/rendering.rb:10:in `process_action'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:113:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:113:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:229:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:229:in `block in halting'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:86:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:86:in `run_callbacks'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/abstract_controller/callbacks.rb:19:in `process_action'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_controller/metal/rescue.rb:29:in `process_action'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/notifications.rb:159:in `block in instrument'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/notifications.rb:159:in `instrument'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/abstract_controller/base.rb:136:in `process'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionview-4.1.5/lib/action_view/rendering.rb:30:in `process'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/rack-mini-profiler-0.9.1/lib/mini_profiler/profiling_methods.rb:79:in `block in profile_method'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_controller/metal.rb:196:in `dispatch'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_controller/metal.rb:232:in `block in action'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/routing/route_set.rb:82:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/routing/route_set.rb:82:in `dispatch'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/routing/route_set.rb:50:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/journey/router.rb:71:in `block in call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/journey/router.rb:59:in `each'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/journey/router.rb:59:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/routing/route_set.rb:678:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/rack-protection-1.5.2/lib/rack/protection/frame_options.rb:31:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:186:in `call!'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:164:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:186:in `call!'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:164:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:186:in `call!'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:164:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:186:in `call!'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:164:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:186:in `call!'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:164:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:186:in `call!'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:164:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/builder.rb:59:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/conditionalget.rb:35:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
[RAILS_ROOT]/lib/middleware/anonymous_cache.rb:119:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/middleware/flash.rb:254:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/message_bus-0.9.5/lib/message_bus/rack/middleware.rb:55:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in `context'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/middleware/cookies.rb:560:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/query_cache.rb:36:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:82:in `run_callbacks'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/logster-0.1.6/lib/logster/middleware/reporter.rb:23:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/rack/logger.rb:38:in `call_app'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/rack/logger.rb:22:in `call'
[RAILS_ROOT]/config/initializers/quiet_logger.rb:10:in `call_with_quiet_assets'
[RAILS_ROOT]/config/initializers/silence_logger.rb:26:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/middleware/request_id.rb:21:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/rack-mini-profiler-0.9.1/lib/mini_profiler/profiler.rb:215:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/engine.rb:514:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/application.rb:144:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/railtie.rb:194:in `public_send'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/railtie.rb:194:in `method_missing'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:138:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/urlmap.rb:65:in `block in call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in `each'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in `call'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:576:in `process_client'
[RAILS_ROOT]/lib/middleware/unicorn_oobgc.rb:95:in `process_client'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:670:in `worker_loop'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:525:in `spawn_missing_workers'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:140:in `start'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/unicorn-4.8.3/bin/unicorn:126:in `&lt;top (required)&gt;'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/bin/unicorn:23:in `load'
[RAILS_ROOT]/vendor/bundle/ruby/2.0.0/bin/unicorn:23:in `&lt;main&gt;'</backtrace>
  <message>unknown group</message>
  <url>https://forum.humancoders.com/categories</url>
  <exception-class>ArgumentError</exception-class>
</hash>

Do you know what happens? thanks!


(Camille Roux) #2

After looking more closely to the problem I found that it comes from a translation problem:

If I delete then recreate the permission using “everyone”, it works. Can someone fix it? thanks.


(Gerhard Schlager) #3

Duplicate of


(Jeff Atwood) #4