resources 1.1.0 → 1.1.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: d7ba480aba9df36982aa13a33f36a1494179f19d
4
- data.tar.gz: d678f58af6eeae8de533447c6c962438859e899d
3
+ metadata.gz: 5b27d9b725c589b1a0e1f25799c0671ada03957e
4
+ data.tar.gz: 4f26e14b8b99a639e60e1c42ae8eb7f6204a1341
5
5
  SHA512:
6
- metadata.gz: a97a3ddf6bba5a3c09b4ac893b8b559375f457dc620f2cfa7d1a4048925e04e48a563ab049708d332d00fdf1d84966f9d88886cb01f9889775bcdb0b0a7ee552
7
- data.tar.gz: 1ca3fbc57783202dd5c94d8bd6829671c6cf5227e6d24302809a0ad9527e71553cc719ac65c1281a601eb296c8af432d8ddfae5986caa3fed9c68f1dfa3eb2b9
6
+ metadata.gz: c7f4b08516e02872e7d0fa3c648e07e8e5209136f49edce0d8e3f2bf7d02fab371d7283917f215ece72ea7624546606c61f00e8e30015369ae6ec53005eb0385
7
+ data.tar.gz: 7f5a273128dae741ef33c58e4bb4f7d8e302ae805375c8db16d7e03f5c9a09c0eaff0fdd7849183e5287cc3bd395672af1de6293e7d0babcf1c963da5c116f47
@@ -66,7 +66,7 @@ module Resources
66
66
  if block_given?
67
67
  block.call(resource)
68
68
  else
69
- if self.class.resource_configuration.flash && request.format.html?
69
+ if self.class.resource_configuration.flash && request.format.html? && resource_saved?
70
70
  if self.class.resource_configuration.flash.respond_to?(:call)
71
71
  flash[:notice] = self.class.resource_configuration.flash.call(resource, params, self)
72
72
  else
@@ -1,3 +1,3 @@
1
1
  module Resources
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -1,5 +1,7 @@
1
1
  class Country < ActiveRecord::Base
2
2
 
3
+ validates :name, presence: true
4
+
3
5
  def permited_attributes
4
6
  [:name, :code, :active]
5
7
  end
@@ -4868,3 +4868,98 @@ Processing by Admin::CountriesController#index as HTML
4868
4868
   (0.3ms) SELECT DISTINCT COUNT(DISTINCT "countries"."id") FROM "countries"
4869
4869
  Rendered admin/countries/index.html.haml within layouts/application (14.5ms)
4870
4870
  Completed 200 OK in 34ms (Views: 33.1ms | ActiveRecord: 0.6ms)
4871
+
4872
+
4873
+ Started GET "/" for 127.0.0.1 at 2015-09-03 19:45:20 -0600
4874
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
4875
+ Processing by CountriesController#index as HTML
4876
+ Country Load (0.2ms) SELECT "countries".* FROM "countries" LIMIT 25 OFFSET 0
4877
+  (0.1ms) SELECT COUNT(*) FROM "countries"
4878
+ Rendered countries/index.html.haml within layouts/application (277.5ms)
4879
+ Completed 200 OK in 373ms (Views: 372.2ms | ActiveRecord: 0.5ms)
4880
+
4881
+
4882
+ Started GET "/assets/admin/countries.self-b60acab5af8d245ed2b3012f77d11d8d207d8eada27756badaf4ef05770d60f6.css?body=1" for 127.0.0.1 at 2015-09-03 19:45:21 -0600
4883
+
4884
+
4885
+ Started GET "/assets/application.self-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css?body=1" for 127.0.0.1 at 2015-09-03 19:45:21 -0600
4886
+
4887
+
4888
+ Started GET "/assets/countries.self-b60acab5af8d245ed2b3012f77d11d8d207d8eada27756badaf4ef05770d60f6.css?body=1" for 127.0.0.1 at 2015-09-03 19:45:21 -0600
4889
+
4890
+
4891
+ Started GET "/assets/admin/countries.self-19a187bec6cdb96d6de80a61c16c857c613536adf9138476bd367db38d282635.js?body=1" for 127.0.0.1 at 2015-09-03 19:45:21 -0600
4892
+
4893
+
4894
+ Started GET "/assets/countries.self-19a187bec6cdb96d6de80a61c16c857c613536adf9138476bd367db38d282635.js?body=1" for 127.0.0.1 at 2015-09-03 19:45:21 -0600
4895
+
4896
+
4897
+ Started GET "/assets/application.self-fb28094035fc8f155b896e47c199355db7c84fc9d6214ed9800f1022ac2ece52.js?body=1" for 127.0.0.1 at 2015-09-03 19:45:21 -0600
4898
+
4899
+
4900
+ Started GET "/admin/countries" for 127.0.0.1 at 2015-09-03 19:45:31 -0600
4901
+ Processing by Admin::CountriesController#index as HTML
4902
+ Country Load (0.5ms) SELECT DISTINCT "countries".* FROM "countries" LIMIT 25 OFFSET 0
4903
+  (0.3ms) SELECT DISTINCT COUNT(DISTINCT "countries"."id") FROM "countries"
4904
+ Rendered admin/countries/index.html.haml within layouts/application (20.4ms)
4905
+ Completed 200 OK in 42ms (Views: 41.3ms | ActiveRecord: 0.8ms)
4906
+
4907
+
4908
+ Started GET "/admin/countries/new" for 127.0.0.1 at 2015-09-03 19:45:33 -0600
4909
+ Processing by Admin::CountriesController#new as HTML
4910
+ Rendered admin/countries/_form.html.haml (67.1ms)
4911
+ Rendered admin/countries/new.html.haml within layouts/application (69.3ms)
4912
+ Completed 200 OK in 92ms (Views: 91.5ms | ActiveRecord: 0.0ms)
4913
+
4914
+
4915
+ Started POST "/admin/countries" for 127.0.0.1 at 2015-09-03 19:45:36 -0600
4916
+ Processing by Admin::CountriesController#create as HTML
4917
+ Parameters: {"utf8"=>"✓", "authenticity_token"=>"59fZABHl379kSlV+61zt0b15YV50igDn53xcgnpKTHgnPxM2iMOzCqRN4BEm/eyigOLj51v+qRJ+YjSYcCce/A==", "country"=>{"code"=>"", "name"=>"qwqwe", "active"=>""}, "commit"=>"SAVE"}
4918
+  (0.1ms) begin transaction
4919
+ SQL (0.9ms) INSERT INTO "countries" ("name", "code", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "qwqwe"], ["code", ""], ["created_at", "2015-09-04 01:45:36.828286"], ["updated_at", "2015-09-04 01:45:36.828286"]]
4920
+  (16.3ms) commit transaction
4921
+ Redirected to http://localhost:3000/admin/countries
4922
+ Completed 302 Found in 30ms (ActiveRecord: 17.4ms)
4923
+
4924
+
4925
+ Started GET "/admin/countries" for 127.0.0.1 at 2015-09-03 19:45:36 -0600
4926
+ Processing by Admin::CountriesController#index as HTML
4927
+ Country Load (0.6ms) SELECT DISTINCT "countries".* FROM "countries" LIMIT 25 OFFSET 0
4928
+  (0.3ms) SELECT DISTINCT COUNT(DISTINCT "countries"."id") FROM "countries"
4929
+ Rendered admin/countries/index.html.haml within layouts/application (17.9ms)
4930
+ Completed 200 OK in 46ms (Views: 45.0ms | ActiveRecord: 0.9ms)
4931
+
4932
+
4933
+ Started GET "/admin/countries/new" for 127.0.0.1 at 2015-09-03 19:46:12 -0600
4934
+ Processing by Admin::CountriesController#new as HTML
4935
+ Rendered admin/countries/_form.html.haml (24.8ms)
4936
+ Rendered admin/countries/new.html.haml within layouts/application (25.9ms)
4937
+ Completed 200 OK in 51ms (Views: 50.3ms | ActiveRecord: 0.5ms)
4938
+
4939
+
4940
+ Started POST "/admin/countries" for 127.0.0.1 at 2015-09-03 19:47:01 -0600
4941
+ Processing by Admin::CountriesController#create as HTML
4942
+ Parameters: {"utf8"=>"✓", "authenticity_token"=>"E6nvMIO3J29kLKS3uaUnt6lnS1WnaqjOCtvZaSAUqdXTQSUGGpFL2qQrEdh0BCbElPzJ7IgeATuTxbFzKnn7UQ==", "country"=>{"code"=>"weqwe", "name"=>"", "active"=>"2"}, "commit"=>"SAVE"}
4943
+  (0.2ms) begin transaction
4944
+  (0.1ms) rollback transaction
4945
+ Rendered admin/countries/_form.html.haml (12.0ms)
4946
+ Rendered admin/countries/new.html.haml within layouts/application (13.0ms)
4947
+ Completed 200 OK in 42ms (Views: 34.9ms | ActiveRecord: 0.3ms)
4948
+
4949
+
4950
+ Started POST "/admin/countries" for 127.0.0.1 at 2015-09-03 19:47:05 -0600
4951
+ Processing by Admin::CountriesController#create as HTML
4952
+ Parameters: {"utf8"=>"✓", "authenticity_token"=>"nmCPEFdgKiGvEBmeZ0qTVtGn0OjAKUSzw25ESRZFddNeiEUmzkZGlG8XrPGq65Il7DxSUe9d7UZacCxTHCgnVw==", "country"=>{"code"=>"weqwe", "name"=>"qweq", "active"=>"2"}, "commit"=>"SAVE"}
4953
+  (0.2ms) begin transaction
4954
+ SQL (0.4ms) INSERT INTO "countries" ("name", "code", "active", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["name", "qweq"], ["code", "weqwe"], ["active", 2], ["created_at", "2015-09-04 01:47:05.295909"], ["updated_at", "2015-09-04 01:47:05.295909"]]
4955
+  (7.5ms) commit transaction
4956
+ Redirected to http://localhost:3000/admin/countries
4957
+ Completed 302 Found in 15ms (ActiveRecord: 8.1ms)
4958
+
4959
+
4960
+ Started GET "/admin/countries" for 127.0.0.1 at 2015-09-03 19:47:05 -0600
4961
+ Processing by Admin::CountriesController#index as HTML
4962
+ Country Load (0.4ms) SELECT DISTINCT "countries".* FROM "countries" LIMIT 25 OFFSET 0
4963
+  (0.2ms) SELECT DISTINCT COUNT(DISTINCT "countries"."id") FROM "countries"
4964
+ Rendered admin/countries/index.html.haml within layouts/application (14.8ms)
4965
+ Completed 200 OK in 35ms (Views: 34.6ms | ActiveRecord: 0.5ms)
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.1.0
4
+ version: 1.1.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-09-02 00:00:00.000000000 Z
11
+ date: 2015-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails