Module: ActiveAdmin::Mongoid::Document::ClassMethods
- Defined in:
- lib/active_admin/mongoid/document.rb
Instance Method Summary collapse
- #associations ⇒ Object
- #connection ⇒ Object
- #content_columns ⇒ Object
- #find_by_id(id) ⇒ Object
- #quoted_table_name ⇒ Object
- #reflections(*a) ⇒ Object
Instance Method Details
#associations ⇒ Object
73 74 75 |
# File 'lib/active_admin/mongoid/document.rb', line 73 def associations @associations ||= new.associations end |
#connection ⇒ Object
61 62 63 |
# File 'lib/active_admin/mongoid/document.rb', line 61 def connection @connection ||= Connection.new(self) end |
#content_columns ⇒ Object
54 55 56 57 58 59 |
# 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) ⇒ Object
65 66 67 |
# File 'lib/active_admin/mongoid/document.rb', line 65 def find_by_id id find_by(:_id => id) end |
#quoted_table_name ⇒ Object
69 70 71 |
# File 'lib/active_admin/mongoid/document.rb', line 69 def quoted_table_name collection_name.to_s.inspect end |
#reflections(*a) ⇒ Object
78 79 80 |
# File 'lib/active_admin/mongoid/document.rb', line 78 def reflections *a relations *a end |