wingman_rails 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -135,7 +135,7 @@
135
135
  view = new this.constructor.RootView({
136
136
  parent: this,
137
137
  el: this.el,
138
- app: this,
138
+ state: this.get('state'),
139
139
  childClasses: this.constructor.rootViewSiblings()
140
140
  });
141
141
  view.bind('descendantCreated', function(view) {
@@ -146,6 +146,14 @@
146
146
  return view;
147
147
  };
148
148
 
149
+ Application.prototype.state = function() {
150
+ return this._state || (this._state = this.createState());
151
+ };
152
+
153
+ Application.prototype.createState = function() {
154
+ return new Wingman.Object;
155
+ };
156
+
149
157
  Application.prototype.buildController = function(view) {
150
158
  var Controller;
151
159
  Controller = this.controllerClassForView(view);
@@ -216,7 +224,7 @@
216
224
  view: view
217
225
  });
218
226
  this.set({
219
- app: view.app
227
+ state: view.state
220
228
  });
221
229
  this.setupBindings();
222
230
  _Class.__super__.constructor.call(this);
@@ -2198,9 +2206,9 @@
2198
2206
  parent: options.parent
2199
2207
  });
2200
2208
  }
2201
- if ((options != null ? options.app : void 0) != null) {
2209
+ if ((options != null ? options.state : void 0) != null) {
2202
2210
  this.set({
2203
- app: options.app
2211
+ state: options.state
2204
2212
  });
2205
2213
  }
2206
2214
  if ((options != null ? options.childClasses : void 0) != null) {
@@ -2246,7 +2254,7 @@
2246
2254
  klass = this.get('childClasses')[className];
2247
2255
  child = new klass({
2248
2256
  parent: this,
2249
- app: this.get('app')
2257
+ state: this.get('state')
2250
2258
  });
2251
2259
  if (options != null ? options.properties : void 0) {
2252
2260
  child.set(options.properties);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wingman_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-25 00:00:00.000000000 Z
12
+ date: 2012-04-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
16
- requirement: &70265883248260 !ruby/object:Gem::Requirement
16
+ requirement: &70354341268980 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -24,7 +24,7 @@ dependencies:
24
24
  version: '5.0'
25
25
  type: :runtime
26
26
  prerelease: false
27
- version_requirements: *70265883248260
27
+ version_requirements: *70354341268980
28
28
  description: This gem provides Wingman for your Rails 3 application.
29
29
  email:
30
30
  - rasmusrnielsen@gmail.com