Sha256: 9f5fe06ac85b5f99dff5937a14f56dd138ff9e0af784968df78233110e1c3bd0

Contents?: true

Size: 421 Bytes

Versions: 16

Compression:

Stored size: 421 Bytes

Contents

module Qbrick
  class BrickTypeFilter < SimpleDelegator
    def empty?
      !(respond_to?(:user_can_add_childs?) && user_can_add_childs? && !allowed.empty?)
    end

    def allowed
      if Qbrick::BrickType.enabled.count.zero?
        []
      elsif allowed_brick_types.empty?
        Qbrick::BrickType.enabled
      else
        Qbrick::BrickType.enabled.constrained(allowed_brick_types)
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
qbrick-2.7.1 app/models/qbrick/brick_type_filter.rb
qbrick-2.7 app/models/qbrick/brick_type_filter.rb
qbrick-2.6.10 app/models/qbrick/brick_type_filter.rb
qbrick-2.6.9 app/models/qbrick/brick_type_filter.rb
qbrick-2.6.8 app/models/qbrick/brick_type_filter.rb
qbrick-2.6.7 app/models/qbrick/brick_type_filter.rb
qbrick-2.6.6 app/models/qbrick/brick_type_filter.rb
qbrick-2.6.5 app/models/qbrick/brick_type_filter.rb
qbrick-2.6.4 app/models/qbrick/brick_type_filter.rb
qbrick-2.6.3 app/models/qbrick/brick_type_filter.rb
qbrick-2.6.2 app/models/qbrick/brick_type_filter.rb
qbrick-2.6.1 app/models/qbrick/brick_type_filter.rb
qbrick-2.6.0 app/models/qbrick/brick_type_filter.rb
qbrick-2.5.2 app/models/qbrick/brick_type_filter.rb
qbrick-2.5.1 app/models/qbrick/brick_type_filter.rb
qbrick-2.5.0 app/models/qbrick/brick_type_filter.rb