module ActiveAdmin::Mongoid::Document::ClassMethods

Public Instance Methods

associations() click to toggle source
# File lib/active_admin/mongoid/document.rb, line 73
def associations
  @associations ||= new.associations
end
connection() click to toggle source
# File lib/active_admin/mongoid/document.rb, line 61
def connection
  @connection ||= Connection.new(self)
end
content_columns() click to toggle source
# File lib/active_admin/mongoid/document.rb, line 54
def content_columns
  # cannot cache this, since changes in time (while defining fields)
  fields.map(&:second).reject! do |f|
    f.name =~ /(^_|^(created|updated)_at)/ or Mongoid::Fields::ForeignKey === f
  end
end
find_by_id(id) click to toggle source
# File lib/active_admin/mongoid/document.rb, line 65
def find_by_id id
  find_by(:_id => id)
end
quoted_table_name() click to toggle source
# File lib/active_admin/mongoid/document.rb, line 69
def quoted_table_name
  collection_name.to_s.inspect
end
reflections(*a) click to toggle source
# File lib/active_admin/mongoid/document.rb, line 78
def reflections *a
  relations *a
end