redmine_rest 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4e92d9ab8694a1917879ba8e959e123cd1e6a08b
4
- data.tar.gz: c8de20b6191ba7b04fc1bf12aba12ee1480bcca0
3
+ metadata.gz: 1eb48cd91b3992ee6524c3b5728b0836a6c74563
4
+ data.tar.gz: 405d4e6946dea7a35e1e87d05531879ec6dbed56
5
5
  SHA512:
6
- metadata.gz: c6644196b1b2bbf241bc425d80763766c3d71495e432ad9592cfccaaad12da1f4162ccf42326287519f5174c6e453abe1dac8f072a59b484af3c7207ebc20604
7
- data.tar.gz: 62ee2240131efd9c75aa33ce98dcbe5772751edc2f607fd0a58321b4f15a62966531b4704017202c1cfb77f22f48a0a0d7174165033a4b415dc00333c87b02f3
6
+ metadata.gz: bb1b966892b31414edf9e9b294880afe71ce043fbe46c290f6edbf065751584af4d8ad3479657a9631e90da82b2fb0b528c218b64a6052b8ae1960c564f9c132
7
+ data.tar.gz: 25306cc4f5a0ceb3f9d10c847254e8c5b6d7a62cdac41a53fd4e995f7928722d1b01b8c2b6762225db985e0f05c5eae704728cf88c915db29d2695dfdb098b64
@@ -0,0 +1,15 @@
1
+ require 'active_resource'
2
+
3
+ require_relative 'collections/base'
4
+
5
+ module RedmineRest
6
+ module Models
7
+ #
8
+ # attachments model
9
+ #
10
+ class Attachment < ActiveResource::Base
11
+ self.format = :xml
12
+ self.collection_parser = Collections::Base
13
+ end
14
+ end
15
+ end
@@ -5,6 +5,7 @@ require_relative 'project'
5
5
  require_relative 'version'
6
6
  require_relative 'relation'
7
7
  require_relative 'tracker'
8
+ require_relative 'attachment'
8
9
  require_relative 'collections/issue'
9
10
 
10
11
  module RedmineRest
@@ -20,11 +21,12 @@ module RedmineRest
20
21
  has_one :author, class_name: User
21
22
  has_one :assigned_to, class_name: User
22
23
  has_one :project, class_name: Project
23
- has_one :version, class_name: Version
24
+ has_one :fixed_version, class_name: Version
24
25
  has_one :parent, class_name: Issue
25
26
  has_many :children, class_name: Issue
26
27
  has_many :watchers, class_name: User
27
28
  has_many :relations, class_name: Relation
29
+ has_many :attachments, class_name: Attachment
28
30
 
29
31
  validates :subject, :tracker_id, presence: true
30
32
 
@@ -43,9 +45,9 @@ module RedmineRest
43
45
  params = options[:params]
44
46
 
45
47
  if params[:include]
46
- params[:include] += ',journals,relations,children,watchers'
48
+ params[:include] += ',journals,relations,children,watchers,attachments'
47
49
  else # doubling is not bad
48
- params[:include] = 'journals,relations,children,watchers'
50
+ params[:include] = 'journals,relations,children,watchers,attachments'
49
51
  end
50
52
 
51
53
  super(what, options)
@@ -1,3 +1,3 @@
1
1
  module RedmineRest
2
- VERSION = '0.6.1'.freeze
2
+ VERSION = '0.7.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmine_rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitriy Non
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-20 00:00:00.000000000 Z
11
+ date: 2016-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -112,6 +112,7 @@ files:
112
112
  - bin/setup
113
113
  - lib/redmine_rest.rb
114
114
  - lib/redmine_rest/models.rb
115
+ - lib/redmine_rest/models/attachment.rb
115
116
  - lib/redmine_rest/models/collections/base.rb
116
117
  - lib/redmine_rest/models/collections/issue.rb
117
118
  - lib/redmine_rest/models/group.rb