jcontroller 1.0.3 → 1.0.4

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: e5a65c45169a29498afb0d1fa3152be24a82fc07
4
- data.tar.gz: 2d0ddb08cfe971e85e0231e1c0c1584ad6857b50
3
+ metadata.gz: 22c4aaa4a7e3d6508cdfbfd704f751a684a228df
4
+ data.tar.gz: 91bf54f58ab80341995d6e5313ba1224956c772b
5
5
  SHA512:
6
- metadata.gz: e398e233d3536d856247931d313df6deacca0f1e2782121c591aeebb86391b2e0e0c36c7cf581fb2a45622989a1c3ba9fe1e0a03f5674587954f563d32b27211
7
- data.tar.gz: be60e2c9a7d95c1b37b8240ed2d37d12326ed960936cfed019bb8f5d173d17dae88d422d3d79ad79cf6f26a6c3e907a88972b5b3a8a59f0a7d528b8f76e93a62
6
+ metadata.gz: 3bd0f42b2f358a68c6a5a9b7bee0ada5e31a6aed48522e0cd9d78a09246b84ad189e9083ad89d6dfdf40317255d0f910ca2565b48786321ef103388f6cb29570
7
+ data.tar.gz: 2e9d1744c7b07e75ca7c03a944a517ea565148dac4c2d68767302ae9ae73877f8131614abd4a112ca19b187263f13d790a24ddda7f2fe12181708c7b3186d1c5
@@ -19,22 +19,24 @@ var Jcontroller = {
19
19
  },
20
20
 
21
21
  execute_action: function() {
22
- if ($.isPlainObject(this[this.format])) {
23
- this.execute_post_order_filter('before');
24
- this.execute_post_order_filter(this.action_name);
25
- this.execute_pre_order_filter('after');
26
- }
22
+ this.execute_post_order_filter('before');
23
+ this.execute_post_order_filter(this.action_name);
24
+ this.execute_pre_order_filter('after');
27
25
  },
28
26
  execute_post_order_filter: function(filter) {
29
27
  if (Jcontroller.present(this.parent())) { this.parent().execute_post_order_filter(filter); }
30
- this.execute_filter(this[this.format][filter]);
28
+ this.execute_filter(filter);
31
29
  },
32
30
  execute_pre_order_filter: function(filter) {
33
- this.execute_filter(this[this.format][filter]);
31
+ this.execute_filter(filter);
34
32
  if (Jcontroller.present(this.parent())) { this.parent().execute_pre_order_filter(filter); }
35
33
  },
36
34
  execute_filter: function(filter) {
37
- if ($.isFunction(filter)) { $.proxy(filter, this)(this.params, this.state); }
35
+ var f = this[this.format];
36
+ if (!$.isPlainObject(f)) { return; }
37
+ f = f[filter];
38
+ if (!$.isFunction(f)) { return; }
39
+ $.proxy(f, this)(this.params, this.state);
38
40
  }
39
41
  },
40
42
  definition
@@ -1,3 +1,3 @@
1
1
  module Jcontroller
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  end
@@ -0,0 +1,2 @@
1
+ Jcontroller.create('empty');
2
+ create_routes('empty_parents', { parent_path: "empty" });
@@ -43,6 +43,11 @@ class SuperusersController < UsersController
43
43
  end
44
44
  end
45
45
 
46
+ class EmptyParentsController < ApplicationController
47
+ def index
48
+ end
49
+ end
50
+
46
51
  module Admin
47
52
  class UsersController < ApplicationController
48
53
  def index
@@ -14,6 +14,7 @@ FakeApp::Application.routes.draw do
14
14
  end
15
15
  end
16
16
  resources :superusers, :only => %w[index]
17
+ resources :empty_parents, :only => %w[index]
17
18
 
18
19
  namespace :admin do
19
20
  resources :users, :only => %w[index]
@@ -61,6 +61,10 @@ feature 'invoke correct filter', :js => true do
61
61
  visit superusers_path
62
62
  test_elements filters('superusers', "index", %w[application users])
63
63
  end
64
+ scenario 'with empty parent controller' do
65
+ visit empty_parents_path
66
+ test_elements filters('empty_parents', "index")
67
+ end
64
68
 
65
69
  scenario 'with no action defined' do
66
70
  visit no_action_users_path
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jcontroller
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Chung
@@ -165,11 +165,13 @@ files:
165
165
  - spec/fake_app/app/assets/javascripts/application.js
166
166
  - spec/fake_app/app/assets/javascripts/jcontrollers/admin/admins_jcontroller.js
167
167
  - spec/fake_app/app/assets/javascripts/jcontrollers/application_jcontroller.js
168
+ - spec/fake_app/app/assets/javascripts/jcontrollers/empty_parents_jcontroller.js
168
169
  - spec/fake_app/app/assets/javascripts/jcontrollers/superusers_jcontroller.js
169
170
  - spec/fake_app/app/assets/javascripts/jcontrollers/users_jcontroller.js
170
171
  - spec/fake_app/app/controllers.rb
171
172
  - spec/fake_app/app/helpers.rb
172
173
  - spec/fake_app/app/views/admin/users/index.html.erb
174
+ - spec/fake_app/app/views/empty_parents/index.html.erb
173
175
  - spec/fake_app/app/views/layouts/application.html.erb
174
176
  - spec/fake_app/app/views/superusers/index.html.erb
175
177
  - spec/fake_app/app/views/users/action_and_parameters.html.erb
@@ -218,11 +220,13 @@ test_files:
218
220
  - spec/fake_app/app/assets/javascripts/application.js
219
221
  - spec/fake_app/app/assets/javascripts/jcontrollers/admin/admins_jcontroller.js
220
222
  - spec/fake_app/app/assets/javascripts/jcontrollers/application_jcontroller.js
223
+ - spec/fake_app/app/assets/javascripts/jcontrollers/empty_parents_jcontroller.js
221
224
  - spec/fake_app/app/assets/javascripts/jcontrollers/superusers_jcontroller.js
222
225
  - spec/fake_app/app/assets/javascripts/jcontrollers/users_jcontroller.js
223
226
  - spec/fake_app/app/controllers.rb
224
227
  - spec/fake_app/app/helpers.rb
225
228
  - spec/fake_app/app/views/admin/users/index.html.erb
229
+ - spec/fake_app/app/views/empty_parents/index.html.erb
226
230
  - spec/fake_app/app/views/layouts/application.html.erb
227
231
  - spec/fake_app/app/views/superusers/index.html.erb
228
232
  - spec/fake_app/app/views/users/action_and_parameters.html.erb