Class: RedmineRest::Models::Issue
- Inherits:
-
ActiveResource::Base
- Object
- ActiveResource::Base
- RedmineRest::Models::Issue
- Defined in:
- lib/redmine_rest/models/issue.rb
Overview
issue model
Class Method Summary collapse
-
.find(what, options = {}) ⇒ Object
Adds journals, relations, children and watchers to request.
Instance Method Summary collapse
Methods inherited from ActiveResource::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
56 57 58 59 |
# File 'lib/redmine_rest/models/issue.rb', line 56 def method_missing(method, *args) return super if block_given? || method.to_s.end_with?('?') || !args.empty? attributes[method] end |
Class Method Details
.find(what, options = {}) ⇒ Object
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)
43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/redmine_rest/models/issue.rb', line 43 def self.find(what, = {}) [:params] = {} unless [:params] params = [: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, ) end |
Instance Method Details
#tracker_id ⇒ Object
33 34 35 |
# File 'lib/redmine_rest/models/issue.rb', line 33 def tracker_id attributes[:tracker_id] || tracker? && tracker.id end |