activeadmin / activeadmin-mongoid

ActiveAdmin hacks to support Mongoid
MIT License
192 stars 210 forks source link

NoMethodError in Admin::Users#index undefined method `associations' for User:Class #111

Closed grzegorz-jakubiak closed 6 years ago

grzegorz-jakubiak commented 6 years ago

This is what I get when I click on Users link in ActiveAdmin. I use model generated by activeadmin:install command I've only changed the name from AdminUser to User and all of the methods accordingly and I don't have any associations. I just want to see the users page before I start building my models.

The actual error:

NoMethodError in Admin::Users#index

Showing /home/gregg/.rvm/gems/ruby-2.4.2@hms-mongoid/gems/activeadmin-1.1.0/app/views/active_admin/resource/index.html.arb where line #2 raised:

undefined method `associations' for User:Class

My configuration:

Rails 5.0.6
mongoid 6.0.3
activeadmin-mongoid 0.4.0

I've installed kaminari-mongoid on my own.

I'm providing stack trace as well:

activeadmin-mongoid (0.4.0) lib/active_admin/mongoid/filter_form_builder.rb:28:in `is_association?'
activeadmin-mongoid (0.4.0) lib/active_admin/mongoid/filter_form_builder.rb:19:in `default_input_type'
activeadmin-mongoid (0.4.0) lib/active_admin/mongoid/filter_form_builder.rb:4:in `filter'
activeadmin (1.1.0) lib/active_admin/filters/forms.rb:61:in `block (2 levels) in active_admin_filters_form_for'
activeadmin (1.1.0) lib/active_admin/filters/forms.rb:57:in `each'
activeadmin (1.1.0) lib/active_admin/filters/forms.rb:57:in `block in active_admin_filters_form_for'
actionview (5.1.4) lib/action_view/helpers/capture_helper.rb:39:in `block in capture'
actionview (5.1.4) lib/action_view/helpers/capture_helper.rb:203:in `with_output_buffer'
actionview (5.1.4) lib/action_view/helpers/capture_helper.rb:39:in `capture'
actionview (5.1.4) lib/action_view/helpers/form_helper.rb:450:in `form_for'
activeadmin (1.1.0) lib/active_admin/filters/forms.rb:56:in `active_admin_filters_form_for'
arbre (1.1.1) lib/arbre/element.rb:180:in `method_missing'
activeadmin (1.1.0) lib/active_admin/filters/resource_extension.rb:144:in `block in filters_sidebar_section'
activeadmin (1.1.0) lib/active_admin/views/components/sidebar_section.rb:25:in `instance_exec'
activeadmin (1.1.0) lib/active_admin/views/components/sidebar_section.rb:25:in `build_sidebar_content'
activeadmin (1.1.0) lib/active_admin/views/components/sidebar_section.rb:13:in `build'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:30:in `block in build_tag'
arbre (1.1.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:14:in `sidebar_section'
activeadmin (1.1.0) lib/active_admin/views/pages/base.rb:132:in `block (2 levels) in build_sidebar'
activeadmin (1.1.0) lib/active_admin/views/pages/base.rb:131:in `collect'
activeadmin (1.1.0) lib/active_admin/views/pages/base.rb:131:in `block in build_sidebar'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
arbre (1.1.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:14:in `div'
activeadmin (1.1.0) lib/active_admin/views/pages/base.rb:130:in `build_sidebar'
activeadmin (1.1.0) lib/active_admin/views/pages/base.rb:78:in `block in build_page_content'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
arbre (1.1.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:14:in `div'
activeadmin (1.1.0) lib/active_admin/views/pages/base.rb:76:in `build_page_content'
activeadmin (1.1.0) lib/active_admin/views/pages/base.rb:54:in `block (2 levels) in build_page'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
arbre (1.1.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:14:in `div'
activeadmin (1.1.0) lib/active_admin/views/pages/base.rb:50:in `block in build_page'
arbre (1.1.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
activeadmin (1.1.0) lib/active_admin/views/pages/base.rb:49:in `build_page'
activeadmin (1.1.0) lib/active_admin/views/pages/base.rb:10:in `build'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:30:in `block in build_tag'
arbre (1.1.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
activeadmin (1.1.0) app/views/active_admin/resource/index.html.arb:2:in `block in __home_gregg__rvm_gems_ruby_______hms_mongoid_gems_activeadmin_______app_views_active_admin_resource_index_html_arb___1304627410741508341_70327090586020'
arbre (1.1.1) lib/arbre/context.rb:45:in `instance_eval'
arbre (1.1.1) lib/arbre/context.rb:45:in `initialize'
activeadmin (1.1.0) app/views/active_admin/resource/index.html.arb:1:in `new'
activeadmin (1.1.0) app/views/active_admin/resource/index.html.arb:1:in `__home_gregg__rvm_gems_ruby_______hms_mongoid_gems_activeadmin_______app_views_active_admin_resource_index_html_arb___1304627410741508341_70327090586020'
actionview (5.1.4) lib/action_view/template.rb:157:in `block in render'
activesupport (5.1.4) lib/active_support/notifications.rb:168:in `instrument'
actionview (5.1.4) lib/action_view/template.rb:352:in `instrument_render_template'
actionview (5.1.4) lib/action_view/template.rb:155:in `render'
actionview (5.1.4) lib/action_view/renderer/template_renderer.rb:52:in `block (2 levels) in render_template'
actionview (5.1.4) lib/action_view/renderer/abstract_renderer.rb:42:in `block in instrument'
activesupport (5.1.4) lib/active_support/notifications.rb:166:in `block in instrument'
activesupport (5.1.4) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (5.1.4) lib/active_support/notifications.rb:166:in `instrument'
actionview (5.1.4) lib/action_view/renderer/abstract_renderer.rb:41:in `instrument'
actionview (5.1.4) lib/action_view/renderer/template_renderer.rb:51:in `block in render_template'
actionview (5.1.4) lib/action_view/renderer/template_renderer.rb:59:in `render_with_layout'
actionview (5.1.4) lib/action_view/renderer/template_renderer.rb:50:in `render_template'
actionview (5.1.4) lib/action_view/renderer/template_renderer.rb:14:in `render'
actionview (5.1.4) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionview (5.1.4) lib/action_view/renderer/renderer.rb:23:in `render'
actionview (5.1.4) lib/action_view/rendering.rb:103:in `_render_template'
actionpack (5.1.4) lib/action_controller/metal/streaming.rb:217:in `_render_template'
actionview (5.1.4) lib/action_view/rendering.rb:83:in `render_to_body'
actionpack (5.1.4) lib/action_controller/metal/rendering.rb:52:in `render_to_body'
actionpack (5.1.4) lib/action_controller/metal/renderers.rb:141:in `render_to_body'
actionpack (5.1.4) lib/abstract_controller/rendering.rb:24:in `render'
actionpack (5.1.4) lib/action_controller/metal/rendering.rb:36:in `render'
actionpack (5.1.4) lib/action_controller/metal/instrumentation.rb:44:in `block (2 levels) in render'
activesupport (5.1.4) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/home/gregg/.rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/benchmark.rb:308:in `realtime'
activesupport (5.1.4) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (5.1.4) lib/action_controller/metal/instrumentation.rb:44:in `block in render'
actionpack (5.1.4) lib/action_controller/metal/instrumentation.rb:87:in `cleanup_view_runtime'
actionpack (5.1.4) lib/action_controller/metal/instrumentation.rb:43:in `render'
responders (2.4.0) lib/action_controller/responder.rb:238:in `default_render'
responders (2.4.0) lib/action_controller/responder.rb:170:in `to_html'
responders (2.4.0) lib/responders/flash_responder.rb:107:in `to_html'
responders (2.4.0) lib/action_controller/responder.rb:163:in `respond'
responders (2.4.0) lib/action_controller/responder.rb:156:in `call'
responders (2.4.0) lib/action_controller/respond_with.rb:211:in `respond_with'
inherited_resources (1.7.2) lib/inherited_resources/actions.rb:7:in `index'
activeadmin (1.1.0) lib/active_admin/resource_controller/streaming.rb:12:in `index'
actionpack (5.1.4) lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
actionpack (5.1.4) lib/abstract_controller/base.rb:186:in `process_action'
actionpack (5.1.4) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (5.1.4) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (5.1.4) lib/active_support/callbacks.rb:131:in `run_callbacks'
actionpack (5.1.4) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (5.1.4) lib/action_controller/metal/rescue.rb:20:in `process_action'
actionpack (5.1.4) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (5.1.4) lib/active_support/notifications.rb:166:in `block in instrument'
activesupport (5.1.4) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (5.1.4) lib/active_support/notifications.rb:166:in `instrument'
actionpack (5.1.4) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (5.1.4) lib/action_controller/metal/params_wrapper.rb:252:in `process_action'
actionpack (5.1.4) lib/abstract_controller/base.rb:124:in `process'
actionview (5.1.4) lib/action_view/rendering.rb:30:in `process'
actionpack (5.1.4) lib/action_controller/metal.rb:189:in `dispatch'
actionpack (5.1.4) lib/action_controller/metal.rb:253:in `dispatch'
actionpack (5.1.4) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
actionpack (5.1.4) lib/action_dispatch/routing/route_set.rb:31:in `serve'
actionpack (5.1.4) lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack (5.1.4) lib/action_dispatch/journey/router.rb:33:in `each'
actionpack (5.1.4) lib/action_dispatch/journey/router.rb:33:in `serve'
actionpack (5.1.4) lib/action_dispatch/routing/route_set.rb:834:in `call'
warden (1.2.7) lib/warden/manager.rb:36:in `block in call'
warden (1.2.7) lib/warden/manager.rb:35:in `catch'
warden (1.2.7) lib/warden/manager.rb:35:in `call'
rack (2.0.3) lib/rack/etag.rb:25:in `call'
rack (2.0.3) lib/rack/conditional_get.rb:25:in `call'
rack (2.0.3) lib/rack/head.rb:12:in `call'
rack (2.0.3) lib/rack/session/abstract/id.rb:232:in `context'
rack (2.0.3) lib/rack/session/abstract/id.rb:226:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/cookies.rb:613:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/callbacks.rb:26:in `block in call'
activesupport (5.1.4) lib/active_support/callbacks.rb:97:in `run_callbacks'
actionpack (5.1.4) lib/action_dispatch/middleware/callbacks.rb:24:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call'
web-console (3.5.1) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.5.1) lib/web_console/middleware.rb:28:in `block in call'
web-console (3.5.1) lib/web_console/middleware.rb:18:in `catch'
web-console (3.5.1) lib/web_console/middleware.rb:18:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.1.4) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.1.4) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.1.4) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.1.4) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.1.4) lib/active_support/tagged_logging.rb:69:in `tagged'
railties (5.1.4) lib/rails/rack/logger.rb:24:in `call'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/request_id.rb:25:in `call'
rack (2.0.3) lib/rack/method_override.rb:22:in `call'
rack (2.0.3) lib/rack/runtime.rb:22:in `call'
activesupport (5.1.4) lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/static.rb:125:in `call'
rack (2.0.3) lib/rack/sendfile.rb:111:in `call'
railties (5.1.4) lib/rails/engine.rb:522:in `call'
puma (3.11.0) lib/puma/configuration.rb:225:in `call'
puma (3.11.0) lib/puma/server.rb:624:in `handle_request'
puma (3.11.0) lib/puma/server.rb:438:in `process_client'
puma (3.11.0) lib/puma/server.rb:302:in `block in run'
puma (3.11.0) lib/puma/thread_pool.rb:120:in `block in spawn_thread'
boie0025 commented 6 years ago

@greggzst can you please provide the contents of your Gemfile.lock and confirm that you've modified your application.rb file as specified here: Remove Application Dependencies

grzegorz-jakubiak commented 6 years ago

@boie0025 Here is everything you wanted. I'm surprised because I created TestModel class without any fields and I can see this panel in activeadmin without any errors as opposed to Users page.

Gemfile.lock:

GEM
  remote: https://rubygems.org/
  specs:
    actioncable (5.1.4)
      actionpack (= 5.1.4)
      nio4r (~> 2.0)
      websocket-driver (~> 0.6.1)
    actionmailer (5.1.4)
      actionpack (= 5.1.4)
      actionview (= 5.1.4)
      activejob (= 5.1.4)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (5.1.4)
      actionview (= 5.1.4)
      activesupport (= 5.1.4)
      rack (~> 2.0)
      rack-test (>= 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    actionview (5.1.4)
      activesupport (= 5.1.4)
      builder (~> 3.1)
      erubi (~> 1.4)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.3)
    activeadmin (1.1.0)
      arbre (>= 1.1.1)
      coffee-rails
      formtastic (~> 3.1)
      formtastic_i18n
      inherited_resources (~> 1.7)
      jquery-rails
      kaminari (>= 0.15, < 2.0)
      railties (>= 4.2, < 5.2)
      ransack (~> 1.3)
      sass (~> 3.1)
      sprockets (< 4.1)
    activeadmin-mongoid (0.4.0)
      activeadmin (~> 1.0)
      jquery-rails
      mongoid (~> 6.0.3)
      sass-rails (>= 3.1.4, <= 5.0.6)
    activejob (5.1.4)
      activesupport (= 5.1.4)
      globalid (>= 0.3.6)
    activemodel (5.1.4)
      activesupport (= 5.1.4)
    activemodel-serializers-xml (1.0.2)
      activemodel (> 5.x)
      activesupport (> 5.x)
      builder (~> 3.1)
    activerecord (5.1.4)
      activemodel (= 5.1.4)
      activesupport (= 5.1.4)
      arel (~> 8.0)
    activeresource (5.0.0)
      activemodel (>= 5.0, < 6)
      activemodel-serializers-xml (~> 1.0)
      activesupport (>= 5.0, < 6)
    activesupport (5.1.4)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (~> 0.7)
      minitest (~> 5.1)
      tzinfo (~> 1.1)
    arbre (1.1.1)
      activesupport (>= 3.0.0)
    arel (8.0.0)
    bcrypt (3.1.11)
    bindex (0.5.0)
    bson (4.2.2)
    builder (3.2.3)
    byebug (9.1.0)
    coffee-rails (4.2.2)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.12.2)
    concurrent-ruby (1.0.5)
    crass (1.0.3)
    devise (4.3.0)
      bcrypt (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 4.1.0, < 5.2)
      responders
      warden (~> 1.2.3)
    erubi (1.7.0)
    execjs (2.7.0)
    ffi (1.9.18)
    formtastic (3.1.5)
      actionpack (>= 3.2.13)
    formtastic_i18n (0.6.0)
    globalid (0.4.1)
      activesupport (>= 4.2.0)
    has_scope (0.7.1)
      actionpack (>= 4.1, < 5.2)
      activesupport (>= 4.1, < 5.2)
    i18n (0.9.1)
      concurrent-ruby (~> 1.0)
    inherited_resources (1.7.2)
      actionpack (>= 3.2, < 5.2.x)
      has_scope (~> 0.6)
      railties (>= 3.2, < 5.2.x)
      responders
    jbuilder (2.7.0)
      activesupport (>= 4.2.0)
      multi_json (>= 1.2)
    jquery-rails (4.3.1)
      rails-dom-testing (>= 1, < 3)
      railties (>= 4.2.0)
      thor (>= 0.14, < 2.0)
    kaminari (1.1.1)
      activesupport (>= 4.1.0)
      kaminari-actionview (= 1.1.1)
      kaminari-activerecord (= 1.1.1)
      kaminari-core (= 1.1.1)
    kaminari-actionview (1.1.1)
      actionview
      kaminari-core (= 1.1.1)
    kaminari-activerecord (1.1.1)
      activerecord
      kaminari-core (= 1.1.1)
    kaminari-core (1.1.1)
    kaminari-mongoid (1.0.1)
      kaminari-core (~> 1.0)
      mongoid
    listen (3.1.5)
      rb-fsevent (~> 0.9, >= 0.9.4)
      rb-inotify (~> 0.9, >= 0.9.7)
      ruby_dep (~> 1.2)
    loofah (2.1.1)
      crass (~> 1.0.2)
      nokogiri (>= 1.5.9)
    mail (2.7.0)
      mini_mime (>= 0.1.1)
    method_source (0.9.0)
    mini_mime (1.0.0)
    mini_portile2 (2.3.0)
    minitest (5.10.3)
    mongo (2.4.3)
      bson (>= 4.2.1, < 5.0.0)
    mongoid (6.0.3)
      activemodel (~> 5.0)
      mongo (~> 2.3)
    multi_json (1.12.2)
    nio4r (2.1.0)
    nokogiri (1.8.1)
      mini_portile2 (~> 2.3.0)
    orm_adapter (0.5.0)
    polyamorous (1.3.1)
      activerecord (>= 3.0)
    puma (3.11.0)
    rack (2.0.3)
    rack-test (0.8.2)
      rack (>= 1.0, < 3)
    rails (5.1.4)
      actioncable (= 5.1.4)
      actionmailer (= 5.1.4)
      actionpack (= 5.1.4)
      actionview (= 5.1.4)
      activejob (= 5.1.4)
      activemodel (= 5.1.4)
      activerecord (= 5.1.4)
      activesupport (= 5.1.4)
      bundler (>= 1.3.0)
      railties (= 5.1.4)
      sprockets-rails (>= 2.0.0)
    rails-dom-testing (2.0.3)
      activesupport (>= 4.2.0)
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.0.3)
      loofah (~> 2.0)
    railties (5.1.4)
      actionpack (= 5.1.4)
      activesupport (= 5.1.4)
      method_source
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rake (12.3.0)
    ransack (1.8.4)
      actionpack (>= 3.0)
      activerecord (>= 3.0)
      activesupport (>= 3.0)
      i18n
      polyamorous (~> 1.3)
    rb-fsevent (0.10.2)
    rb-inotify (0.9.10)
      ffi (>= 0.5.0, < 2)
    responders (2.4.0)
      actionpack (>= 4.2.0, < 5.3)
      railties (>= 4.2.0, < 5.3)
    ruby_dep (1.5.0)
    sass (3.5.3)
      sass-listen (~> 4.0.0)
    sass-listen (4.0.0)
      rb-fsevent (~> 0.9, >= 0.9.4)
      rb-inotify (~> 0.9, >= 0.9.7)
    sass-rails (5.0.6)
      railties (>= 4.0.0, < 6)
      sass (~> 3.1)
      sprockets (>= 2.8, < 4.0)
      sprockets-rails (>= 2.0, < 4.0)
      tilt (>= 1.1, < 3)
    spring (2.0.2)
      activesupport (>= 4.2)
    spring-watcher-listen (2.0.1)
      listen (>= 2.7, < 4.0)
      spring (>= 1.2, < 3.0)
    sprockets (3.7.1)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.2.1)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    thor (0.20.0)
    thread_safe (0.3.6)
    tilt (2.0.8)
    turbolinks (5.0.1)
      turbolinks-source (~> 5)
    turbolinks-source (5.0.3)
    tzinfo (1.2.4)
      thread_safe (~> 0.1)
    uglifier (3.2.0)
      execjs (>= 0.3.0, < 3)
    warden (1.2.7)
      rack (>= 1.0)
    web-console (3.5.1)
      actionview (>= 5.0)
      activemodel (>= 5.0)
      bindex (>= 0.4.0)
      railties (>= 5.0)
    websocket-driver (0.6.5)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.3)

PLATFORMS
  ruby

DEPENDENCIES
  activeadmin-mongoid (= 0.4.0)
  activeresource
  byebug
  coffee-rails (~> 4.2)
  devise
  jbuilder (~> 2.5)
  kaminari-mongoid
  listen (>= 3.0.5, < 3.2)
  puma (~> 3.7)
  rails (~> 5.1.4)
  spring
  spring-watcher-listen (~> 2.0.0)
  turbolinks (~> 5)
  tzinfo-data
  uglifier (>= 1.3.0)
  web-console (>= 3.3.0)

BUNDLED WITH
   1.16.0

Gemfile:

source 'https://rubygems.org'

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.4'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# activeadmin
gem 'activeadmin-mongoid', '0.4.0'
# devise
gem 'devise'

gem 'kaminari-mongoid'

gem 'activeresource'

# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

application.rb:

require_relative 'boot'

# require 'rails/all'
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "sprockets/railtie"
require "rails/test_unit/railtie"

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module HmsMongoid
  class Application < Rails::Application
    # Initialize configuration defaults for originally generated Rails version.
    config.load_defaults 5.1

    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.
  end
end
boie0025 commented 6 years ago

@greggzst I suspect it has to do with Rails 5.1.x instead of Rails 5.0.x, if you're able, try downgrade to Rails 5.0 and see if it goes away. I tried moving to 5.1 on an app we have here and got some funky errors. We'll have to work on an upgrade to support Rails 5.1.x

grzegorz-jakubiak commented 6 years ago

@boie0025 Unfortunately it doesn't. I tried different Rails(5.0.0 and 5.0.3) and Rubies(2.2.0, 2.3.1, 2.4.0 and 2.4.2) and always ended up having this error when I try to see users panel.

boie0025 commented 6 years ago

@greggzst Well, there goes that theory. We've also had some issues with Kaminari versions, give this a try:

gem 'kaminari-mongoid', '= 0.1.2'
gem 'kaminari', '= 0.17.0' 

In the meanwhile, I'm going to create a new rails app with your gemfile and see if I can re-create the error.

grzegorz-jakubiak commented 6 years ago

@boie0025 This change doesn't help either. I still get the same error.

boie0025 commented 6 years ago

@greggzst - OK I'm out of ideas now. If you create a repo with all of the relevant parts of your current app that re-creates the error I can dig, otherwise, you should be able to work around this by turning filters off in ActiveAdmin config: config.filters = true and/or config.include_default_association_filters = true

boie0025 commented 6 years ago

@greggzst Actually, try remove the "created_at" filter from your default User model.. Remove filter :created_at

grzegorz-jakubiak commented 6 years ago

@boie0025 Removing filter :created_at helps I can see users now. So it's the mentioned issue with filters I suppose? Do you still want me to upload my repository?

boie0025 commented 6 years ago

@greggzst Yes, it took me a while to connect the dots. No, I have replicated the issue myself (and that's how I found the filter issue). Thanks!

jonatasdaniel commented 2 years ago

I'm still having this issue and I don't even have filter on my admin. Any news on this? I'm using both ActiveRecord and MongoId.