Sha256: 3a553eed6850711c1707216dd8863ef4f1d6ed181fe9656f27dc411aa2fef882

Contents?: true

Size: 532 Bytes

Versions: 13

Compression:

Stored size: 532 Bytes

Contents

module Hancock
  if Hancock.mongoid?
    class EmbeddedElement
      include Hancock::Models::EmbeddedElement

      include Hancock::Decorators::EmbeddedElement

      rails_admin(&Hancock::Admin::EmbeddedElement.config(rails_admin_add_fields) { |config|
        rails_admin_add_config(config)
      })

      # use it in rails_admin in parent model for sort
      # sort_embedded({fields: [:embedded_field_1, :embedded_field_2...]})
      # or u need to override rails_admin in inherited model to add sort field
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
hancock_cms-2.0.1.3 app/models/hancock/embedded_element.rb
hancock_cms-1.0.2.3 app/models/hancock/embedded_element.rb
hancock_cms-2.0.1.2 app/models/hancock/embedded_element.rb
hancock_cms-2.0.1.1 app/models/hancock/embedded_element.rb
hancock_cms-1.0.2.2 app/models/hancock/embedded_element.rb
hancock_cms-1.0.1 app/models/hancock/embedded_element.rb
hancock_cms-2.0.0.2 app/models/hancock/embedded_element.rb
hancock_cms-1.0.0.4 app/models/hancock/embedded_element.rb
hancock_cms-1.0.0.3 app/models/hancock/embedded_element.rb
hancock_cms-2.0.0.1 app/models/hancock/embedded_element.rb
hancock_cms-1.0.0.2 app/models/hancock/embedded_element.rb
hancock_cms-2.0.0 app/models/hancock/embedded_element.rb
hancock_cms-1.0.0 app/models/hancock/embedded_element.rb