api_me 0.3.5 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11208e14f060071af76e6477ededc5c31c2a5ced
4
- data.tar.gz: d9c671e3403e6b57f3d27fd5594312221735a842
3
+ metadata.gz: d1cf140e09ecf4b5773e21ece939ed3065942283
4
+ data.tar.gz: 0110c77f7a39fe0511872f935c8efafcf4b529ed
5
5
  SHA512:
6
- metadata.gz: db8358d8e59b17ef42d80f8c3c02b407e2e20d2f40f58c6017ca7d3200d31a9f956f857bfcca9c9e968e19bf06ce3b73a92348183349427dbb168a8a42b23a39
7
- data.tar.gz: 5c670244207bccd31c309d90b9d626e9f38f33677a362cb7a028914f0be38efe28d7e57dcfdfad17c233ebe50bd2e0c7c6a3fef11526e5aa9b13bff8a570c430
6
+ metadata.gz: aadc59fd10b73f2d0e9a4971fe1b3e84c5d8e981e34ec07f898da236039af6c3c47a8944b43ceacabd9e0c247661e477915ba2389a274438a024a873b20e42ce
7
+ data.tar.gz: 54ac80d1afab0a9cae531782be418124a4240fd832c8934245bc9b0006c44d2d9143be164cf06f2de4aeda65551312d4baa01d053f025208cd3e81d7234caea6
data/lib/api_me.rb CHANGED
@@ -63,7 +63,7 @@ module ApiMe
63
63
  # to move to support the jsonapi.org standard closer.
64
64
  def index
65
65
  ids_filter_hash = params[:ids] ? { ids: params[:ids] } : {}
66
- @scoped_objects = policy_scope(model_klass.all)
66
+ @scoped_objects = policy_scope(resource_scope)
67
67
  @filter_objects = filter_klass.new(
68
68
  scope: @scoped_objects,
69
69
  filters: (filter_params || {}).merge(ids_filter_hash)
@@ -139,6 +139,10 @@ module ApiMe
139
139
  self.class.filter_klass
140
140
  end
141
141
 
142
+ def resource_scope
143
+ model_klass.all
144
+ end
145
+
142
146
  def params_klass_symbol
143
147
  model_klass.name.demodulize.underscore.to_sym
144
148
  end
@@ -1,3 +1,3 @@
1
1
  module ApiMe
2
- VERSION = '0.3.5'
2
+ VERSION = '0.3.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_me
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Clopton
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-15 00:00:00.000000000 Z
12
+ date: 2015-01-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord