Sha256: 85b2b844adb329a89ee9498c0d21e85fe12301cb0e71852d85bd2ff0c0cfc48c

Contents?: true

Size: 542 Bytes

Versions: 5

Compression:

Stored size: 542 Bytes

Contents

module RailsAdminSortEmbedded
  class Configuration
    def initialize(abstract_model)
      @abstract_model = abstract_model
    end

    def options
      @options ||= {
          fields: [{}],
          thumbnail_fields: [:image, :cover],
          label_methods: [:name, :label],
          hint_fields: [],
          thumbnail_size: :thumb,
          thumbnail_gem: :paperclip,
      }.merge(config || {})
    end

    protected
    def config
      ::RailsAdmin::Config.model(@abstract_model.model).sort_embedded || {}
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rails_admin_sort_embedded-0.2.0.1 lib/rails_admin_sort_embedded/configuration.rb
rails_admin_sort_embedded-0.2.0 lib/rails_admin_sort_embedded/configuration.rb
rails_admin_sort_embedded-0.1.4 lib/rails_admin_sort_embedded/configuration.rb
rails_admin_sort_embedded-0.1.3 lib/rails_admin_sort_embedded/configuration.rb
rails_admin_sort_embedded-0.1.2 lib/rails_admin_sort_embedded/configuration.rb