resources 1.0.0 → 1.0.1

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: 7c1eab3b5d6bce3821a092b6041cad69e43759cf
4
- data.tar.gz: 6f24aadf85ae78657cd7e8c1d2034584f9136c30
3
+ metadata.gz: e5ed704f005664652620db58a65009f2ef5a1260
4
+ data.tar.gz: c335d159bf4bacdaa0389dff7df154ba38a4c85d
5
5
  SHA512:
6
- metadata.gz: 155541ab096be555fc2af0a0fb6a305c2c181daeb4bb360197c77d37dbad28e910f8cbd4e4ae389ed4b27eca0379c9f28ec97354cec8e9ba817aa7f3174b273f
7
- data.tar.gz: 7a4ff96fdcc34146f2765b6a86d8092ca2b4e637c00f3db7044c5ebe8093517f60c2593d0c24db5da34f0104e6f8dc82f96ce87c9a77cc56c6f704315cf35e77
6
+ metadata.gz: ae6977fbe1caf2b3444f66699c682998fd311017c09a7d41c7e4d72a1b453365b026b2712e73f4823a1203b84dcda881fb2bf48e46c51a661ed4102d0ae50d9d
7
+ data.tar.gz: 52aa1ce83e25d996a3723ce34a64b9b28ccfe95218d69bf214d021684a951ebc1eb078028ce99582ae9d425e88bf31b16261bd5478255c225527e9642740df3f
@@ -48,14 +48,14 @@ module Resources
48
48
 
49
49
  def resource
50
50
  if grape?
51
- @resource ||= params[:id].blank? ? build_resource : (resource_scope.where("#{resource_class.table_name}.id = ?",params[:id]).first rescue nil )
51
+ @resource ||= params[:id].blank? ? build_resource : (resource_scope.find(params[:id]) rescue nil )
52
52
  else
53
53
  @resource ||=
54
54
  case controller.action_name
55
55
  when "new", "create"
56
56
  build_resource
57
57
  else
58
- resource_scope.where("#{resource_class.table_name}.id = ?",params[:id]).first rescue nil
58
+ resource_scope.find(params[:id]) rescue nil
59
59
  end
60
60
  end
61
61
  end
@@ -1,3 +1,3 @@
1
1
  module Resources
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -3989,3 +3989,6 @@ Processing by CountriesController#index as HTML
3989
3989
   (0.0ms) SELECT COUNT(*) FROM "countries"
3990
3990
  Rendered countries/index.html.haml within layouts/application (3.5ms)
3991
3991
  Completed 200 OK in 11ms (Views: 11.2ms | ActiveRecord: 0.2ms)
3992
+  (17.2ms) DELETE FROM "countries";
3993
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3994
+  (17.5ms) DELETE FROM sqlite_sequence where name = 'countries';
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emilio Forrer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-30 00:00:00.000000000 Z
11
+ date: 2015-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -238,7 +238,6 @@ files:
238
238
  - test/dummy/tmp/cache/assets/development/sprockets/v3.0/tCM0KKnd2WiAjdWEr6LbNvF0qyf45275nyBUJwpmeMQ.cache
239
239
  - test/dummy/tmp/cache/assets/development/sprockets/v3.0/uVhuknH4mKck5LFVwZj9pmuaR7SE-0M45V52MkrBJPk.cache
240
240
  - test/dummy/tmp/cache/assets/development/sprockets/v3.0/xa5H-1005wsDczOFgyc7KdSbQzU5n8neJtBcQS74ncg.cache
241
- - test/dummy/tmp/pids/server.pid
242
241
  - test/resources_test.rb
243
242
  - test/test_helper.rb
244
243
  homepage: https://github.com/emilioforrer/resources
@@ -297,7 +296,6 @@ test_files:
297
296
  - test/dummy/config/environments/production.rb
298
297
  - test/dummy/config/database.yml
299
298
  - test/dummy/config/routes.rb
300
- - test/dummy/tmp/pids/server.pid
301
299
  - test/dummy/tmp/cache/assets/development/sprockets/v3.0/41pS6qeEZuOGdyzk3yCjRfBsaXZAyI-DvH5kzsEcVdo.cache
302
300
  - test/dummy/tmp/cache/assets/development/sprockets/v3.0/7ZK4CBk3GcsUKFsZNRJfseBsCcQIIJUzVEPZiEGcdJ4.cache
303
301
  - test/dummy/tmp/cache/assets/development/sprockets/v3.0/G3sodj-ssqsbEWYKt4p0hE18yArx4HB1LUI3JWIY15Y.cache
@@ -1 +0,0 @@
1
- 5189