vidibus-resource 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,7 +13,7 @@ class Api::ResourcesController < ApiController
13
13
  if instance
14
14
  instance.update_resource_attributes(params[:resource])
15
15
  else
16
- attributes = {:uuid => params[:uuid], :resource_attributes => JSON.parse(params[:resource])}
16
+ attributes = {:resource_uuid => params[:uuid], :resource_attributes => JSON.parse(params[:resource])}
17
17
  attributes[:realm_uuid] = params[:realm] if klass_with_realm?
18
18
  klass.create!(attributes)
19
19
  end
@@ -58,7 +58,7 @@ class Api::ResourcesController < ApiController
58
58
 
59
59
  def instance
60
60
  @instance ||= begin
61
- results = klass.where(:uuid => params[:uuid])
61
+ results = klass.any_of({:resource_uuid => params[:uuid]}, {:uuid => params[:uuid]})
62
62
  if klass_with_realm?
63
63
  results = results.and(:realm_uuid => params[:realm])
64
64
  end
@@ -8,7 +8,9 @@ module Vidibus::Resource
8
8
 
9
9
  included do
10
10
  field :resource_attributes, :type => Hash, :default => {}
11
+ field :response_uuid
11
12
  field :uuid
13
+ index :response_uuid
12
14
  index :uuid
13
15
  validates :uuid, :uuid => true
14
16
 
@@ -1,5 +1,5 @@
1
1
  module Vidibus
2
2
  module Resource
3
- VERSION = '0.3.2'
3
+ VERSION = '0.3.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vidibus-resource
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 2
10
- version: 0.3.2
9
+ - 3
10
+ version: 0.3.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andre Pankratz
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-14 00:00:00 +02:00
18
+ date: 2011-09-15 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency