Sha256: 9ce5ddea3f9712ec24b7ccc22ddd01571690beb3db4b8f6d056a00bc0fffd02d

Contents?: true

Size: 257 Bytes

Versions: 5

Compression:

Stored size: 257 Bytes

Contents

module Workarea
  decorate Admin::ProductViewModel, with: :browse_option do
    def browse_options
      [['None', nil]] + variants.map do |variant|
        variant.details.keys.map { |k| [k, k] }
      end.flatten.map { |v| [v, v] }.uniq
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
workarea-browse_option-2.2.0 app/view_models/workarea/admin/product_view_model.decorator
workarea-browse_option-2.1.9 app/view_models/workarea/admin/product_view_model.decorator
workarea-browse_option-2.1.8 app/view_models/workarea/admin/product_view_model.decorator
workarea-browse_option-2.1.7 app/view_models/workarea/admin/product_view_model.decorator
workarea-browse_option-2.1.6 app/view_models/workarea/admin/product_view_model.decorator