Sha256: a3a25aae11b680727ace92b017429180119acf472c00e71d4e4ce26fd0dfeb13

Contents?: true

Size: 422 Bytes

Versions: 4

Compression:

Stored size: 422 Bytes

Contents

require 'active_resource'
require 'unicode'

module RedmineRest
  module Models
    module Collections
      #
      # Base class for most custom collections
      #
      class Base < ActiveResource::Collection
        def filter_by_name_substring(str)
          str = Unicode.downcase(str)
          self.class.new @elements.find_all { |e| Unicode.downcase(e.name).include? str }
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
redmine_rest-0.8.0 lib/redmine_rest/models/collections/base.rb
redmine_rest-0.7.0 lib/redmine_rest/models/collections/base.rb
redmine_rest-0.6.1 lib/redmine_rest/models/collections/base.rb
redmine_rest-0.6.0 lib/redmine_rest/models/collections/base.rb