class RedmineRest::Models::Issue
issue model
Public Class Methods
find(what, options = {})
click to toggle source
Adds journals, relations, children and watchers to request.
Be careful, even if issue has watchers, it won’t be loaded, because REST API can load them only after v2.3.0 (see Redmine docs)
Calls superclass method
# File lib/redmine_rest/models/issue.rb, line 45 def self.find(what, options = {}) options[:params] = {} unless options[:params] params = options[:params] if params[:include] params[:include] += ',journals,relations,children,watchers,attachments' else # doubling is not bad params[:include] = 'journals,relations,children,watchers,attachments' end super(what, options) end
Public Instance Methods
assigned_to=(user)
click to toggle source
Sets assigned_to_id via User
object
# File lib/redmine_rest/models/issue.rb, line 91 def assigned_to=(user) fail ArgumentError unless user.is_a? User self.assigned_to_id = user.id end
fixed_version=(version)
click to toggle source
Sets fixed_version_id via Version
object.
# File lib/redmine_rest/models/issue.rb, line 65 def fixed_version=(version) fail ArgumentError unless version.is_a? Version self.fixed_version_id = version.id end
Also aliased as: version=
method_missing(method, *args)
click to toggle source
Calls superclass method
# File lib/redmine_rest/models/issue.rb, line 104 def method_missing(method, *args) return super if block_given? || method.to_s.end_with?('?') || !args.empty? attributes[method] end
parent=(issue)
click to toggle source
Sets parent_issue_id via Issue
object
# File lib/redmine_rest/models/issue.rb, line 99 def parent=(issue) fail ArgumentError unless issue.is_a? Issue self.parent_issue_id = issue.id end
project=(project)
click to toggle source
Sets project_id via Project
object.
# File lib/redmine_rest/models/issue.rb, line 83 def project=(project) fail ArgumentError unless project.is_a? Project self.project_id = project.id end
tracker=(tracker)
click to toggle source
Sets tracker_id
via Tracker
object.
# File lib/redmine_rest/models/issue.rb, line 75 def tracker=(tracker) fail ArgumentError unless tracker.is_a? Tracker self.tracker_id = tracker.id end
tracker_id()
click to toggle source
# File lib/redmine_rest/models/issue.rb, line 35 def tracker_id attributes[:tracker_id] || tracker? && tracker.id end
version()
click to toggle source
# File lib/redmine_rest/models/issue.rb, line 58 def version fixed_version end