Sha256: 823ed5b7441deee0625f297e314247a16f2c9bd47f1c8b28ce324c74dc2f105a

Contents?: true

Size: 466 Bytes

Versions: 10

Compression:

Stored size: 466 Bytes

Contents

require 'active_resource'

module RedmineRest
  module Models
    #
    # User model
    #
    class User < ActiveResource::Base
      self.format = :xml

      def self.find_by_name_or_mail(str)
        all_by_name_or_mail(str).first
      end

      def self.all_by_name_or_mail(str)
        find :all, params: { name: str }
      end

      def issues(params = {})
        params[:assigned_to_id] = id
        Issue.all params: params
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
redmine_rest-0.8.0 lib/redmine_rest/models/user.rb
redmine_rest-0.7.0 lib/redmine_rest/models/user.rb
redmine_rest-0.6.1 lib/redmine_rest/models/user.rb
redmine_rest-0.6.0 lib/redmine_rest/models/user.rb
redmine_rest-0.5.2 lib/redmine_rest/models/user.rb
redmine_rest-0.5.1 lib/redmine_rest/models/user.rb
redmine_rest-0.5.0 lib/redmine_rest/models/user.rb
redmine_rest-0.4.0 lib/redmine_rest/models/user.rb
redmine_rest-0.3.0 lib/redmine_rest/models/user.rb
redmine_rest-0.2.0 lib/redmine_rest/models/user.rb