Closed danbartlett closed 7 years ago
@pencilcheck, any thoughts?
@danbartlett I believe you would also want to include master branch to activeadmin/activeadmin.
e.g. gem 'activeadmin', github: 'activeadmin', branch: 'master'
But including a moving target is dangerous, so I pick one commit
e.g. gem 'activeadmin', github: 'activeadmin', ref: '54bed'
Also, I have a fork of ransack that adds embedded documents in this PR: https://github.com/activerecord-hackery/ransack/pull/498
If you are interested just include this before activeadmin and activeadmin-mongoid:
gem 'ransack', github: 'pencilcheck/ransack', branch: 'patch-1'
Hope that works for you.
If you are getting an error about "$oid", maybe this snippet from this issue plataformatec/devise#2949 would help:
def self.serialize_into_session(record) [record.id.to_s, record.authenticatable_salt] end Put it in the user class used for devise
It is working for me so far. Extra much appreciate :)
I managed to solve Undefined method column_for_attribute
by adding initializer:
module Mongoid
module Document
def column_for_attribute(attribute)
type = fields[attribute.to_s].type.to_s.underscore.split('/').last.to_sym
Struct.new(:type).new(type)
end
end
end
I hope this helps.
After upgrading to rails 4.2 we started experiencing
Undefined method column_for_attribute
I eventually came across https://github.com/elia/activeadmin-mongoid/issues/95 which lead me to this pull request https://github.com/elia/activeadmin-mongoid/pull/96/files
I tried using:
gem 'activeadmin-mongoid', github: 'pencilcheck/activeadmin-mongoid', branch: 'patch-1'
Which fixed my first error, but then raised another error about
_ransack
not being available. So I looked at the pull request again, and tried re-adding what pencilcheck removed:After adding this in to one of my models, everything works again!