restpack_group_service 0.0.5 → 0.0.6

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: 5f59fe4026cc51c3b027b697e09dbadb58659185
4
- data.tar.gz: 9014a6a6cfaa115a7a5f10f84f89665c058ebf1b
3
+ metadata.gz: ea6117abcc201cbaf5678975017f74376cd8d145
4
+ data.tar.gz: 48fa78ada002540d524fc52d0190e352294d3334
5
5
  SHA512:
6
- metadata.gz: 8d85127110d7bd149d818661fe5f5f213b37b7df1adde720437ec30ce8033f7607193155370a2677ffeef9d3e3c62adde53aae7fb5ee2700a3278d69161bd376
7
- data.tar.gz: 7c369ac7537e2121b8daf77f964136405c4a18d199f0567dde1cecbeed647b506423ac07ddb5e01b9b792b308d0990635613d54cbbc71097c1f804f622cd9d8d
6
+ metadata.gz: 7778ee62688445ab9ba522b40391e8dca156af690ecd6260fb92f236968cda7728185c15145f17a65525423879d0f234bf8a79451b31b1f1ba3adb260b061d8c
7
+ data.tar.gz: 7960f2ff18dc78b44de95a44d84651fed7e91ab07eb3b8358d70d9e4a473cbe63bb3154108ab9245dcb036b5b9af9155816312c325fc750ad52f915fdd82cd3e
@@ -7,12 +7,7 @@ module RestPack::Group::Service::Commands
7
7
  end
8
8
 
9
9
  def execute
10
- # TODO: GJ: remove the :application_id scope when we can specify custom serializer filters
11
- # https://github.com/RestPack/restpack_serializer/issues/42
12
- result = Serializers::Group.resource(
13
- inputs,
14
- Models::Group.where(application_id: inputs[:application_id])
15
- )
10
+ result = Serializers::Group.resource(inputs)
16
11
 
17
12
  if result[:groups].empty?
18
13
  status :not_found
@@ -14,12 +14,7 @@ module RestPack::Group::Service::Commands
14
14
  end
15
15
 
16
16
  def execute
17
- # TODO: GJ: remove the scope when we can specify custom serializer filters
18
- # https://github.com/RestPack/restpack_serializer/issues/42
19
17
  scope = Models::Group.all
20
- scope = scope.where(application_id: application_id)
21
- scope = scope.where(account_id: account_id) if account_id
22
- scope = scope.where(created_by: created_by) if created_by
23
18
 
24
19
  if is_account_group
25
20
  scope = scope.where("account_id IS NOT NULL")
@@ -15,14 +15,7 @@ module RestPack::Group::Service::Commands
15
15
  end
16
16
 
17
17
  def execute
18
- # TODO: GJ: remove the scope when we can specify custom serializer filters
19
- # https://github.com/RestPack/restpack_serializer/issues/42
20
18
  scope = Models::Membership.all
21
- scope = scope.where(application_id: application_id)
22
- scope = scope.where(account_id: account_id) if account_id
23
- scope = scope.where(group_id: group_id) if group_id
24
- scope = scope.where(user_id: user_id) if user_id
25
-
26
19
  if is_account_group
27
20
  scope = scope.where("account_id IS NOT NULL")
28
21
  else
@@ -8,5 +8,6 @@ module RestPack::Group::Service::Serializers
8
8
  attributes :id, :application_id, :account_id, :created_by, :name,
9
9
  :description, :invitation_required, :href
10
10
  can_include :memberships, :invitations
11
+ can_filter_by :application_id, :account_id, :created_by
11
12
  end
12
13
  end
@@ -8,5 +8,6 @@ module RestPack::Group::Service::Serializers
8
8
  attributes :id, :application_id, :account_id, :group_id, :user_id,
9
9
  :invitation_id, :href
10
10
  can_include :groups, :invitations
11
+ can_filter_by :application_id, :account_id, :group_id, :user_id
11
12
  end
12
13
  end
@@ -1,7 +1,7 @@
1
1
  module RestPack
2
2
  module Group
3
3
  module Service
4
- VERSION = "0.0.5"
4
+ VERSION = "0.0.6"
5
5
  end
6
6
  end
7
7
  end
@@ -1,2 +1,2 @@
1
1
  require 'restpack_service'
2
- RestPack::Service::Loader.load 'group', Dir.pwd
2
+ RestPack::Service::Loader.load 'group'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restpack_group_service
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Joyce
@@ -185,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
185
  version: '0'
186
186
  requirements: []
187
187
  rubyforge_project:
188
- rubygems_version: 2.0.5
188
+ rubygems_version: 2.0.7
189
189
  signing_key:
190
190
  specification_version: 4
191
191
  summary: Groups, Members and Invitations