Rails admin doesn't support Binary column types for mongoid #1582

Closed
iainbeeston opened this Issue Mar 28, 2013 · 2 comments

Comments

Projects
None yet
1 participant
Contributor

iainbeeston commented Mar 28, 2013

I'm using railsadmin with mongoid, but when I load railsadmin it crashes with the following error:

RuntimeError - Type Moped::BSON::Binary for field :rendered_pdf in Invoice not supported:
  (gem) rails_admin-0.4.6/lib/rails_admin/adapters/mongoid.rb:305:in `type_lookup'
  (gem) rails_admin-0.4.6/lib/rails_admin/adapters/mongoid.rb:92:in `block in properties'
  (gem) rails_admin-0.4.6/lib/rails_admin/adapters/mongoid.rb:85:in `properties'
  (gem) rails_admin-0.4.6/lib/rails_admin/config/actions/dashboard.rb:29:in `block (3 levels) in <class:Dashboard>'
  (gem) rails_admin-0.4.6/lib/rails_admin/config/actions/dashboard.rb:24:in `block (2 levels) in <class:Dashboard>'
  (eval):8:in `dashboard'
  (gem) actionpack-3.2.11/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  (gem) actionpack-3.2.11/lib/abstract_controller/base.rb:167:in `process_action'
  (gem) actionpack-3.2.11/lib/action_controller/metal/rendering.rb:10:in `process_action'
  (gem) actionpack-3.2.11/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  (gem) activesupport-3.2.11/lib/active_support/callbacks.rb:513:in `_run__3907890206384098903__process_action__2505316672246447833__callbacks'
  (gem) activesupport-3.2.11/lib/active_support/callbacks.rb:405:in `__run_callback'
  (gem) activesupport-3.2.11/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
  (gem) activesupport-3.2.11/lib/active_support/callbacks.rb:81:in `run_callbacks'
  (gem) actionpack-3.2.11/lib/abstract_controller/callbacks.rb:17:in `process_action'
  (gem) actionpack-3.2.11/lib/action_controller/metal/rescue.rb:29:in `process_action'
  (gem) actionpack-3.2.11/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
  (gem) activesupport-3.2.11/lib/active_support/notifications.rb:123:in `block in instrument'
  (gem) activesupport-3.2.11/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  (gem) activesupport-3.2.11/lib/active_support/notifications.rb:123:in `instrument'
  (gem) actionpack-3.2.11/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
  (gem) actionpack-3.2.11/lib/action_controller/metal/params_wrapper.rb:207:in `process_action'

It seems to be that I'm using a binary field on one of my documents and railsadmin doesn't support that.

I've noticed that for other databases there have been issues with binary types too.

iainbeeston added a commit to iainbeeston/rails_admin that referenced this issue Mar 28, 2013

Contributor

iainbeeston commented Mar 28, 2013

To reproduce: have a model that contains a binary field, then load the main rails admin URL. The rails admin dashboard never loads - I get the above error instead.

Contributor

iainbeeston commented Apr 18, 2013

The fix for this has been merged now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment