extjs-mvc 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/extjs/data/store.rb +20 -9
  3. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.6
1
+ 0.3.7
@@ -69,19 +69,30 @@ module ExtJS::Data
69
69
  private
70
70
 
71
71
  def self.get_controller(name)
72
- if (defined?(Rails))
73
- "#{name.to_s.camelize}Controller".constantize
74
- else
75
- Extlib::Inflection.constantize("#{Extlib::Inflection.camelize(name)}")
72
+ begin
73
+ if (defined?(Rails))
74
+ "#{name.to_s.camelize}Controller".constantize
75
+ else
76
+ Extlib::Inflection.constantize("#{Extlib::Inflection.camelize(name)}")
77
+ end
78
+ rescue NameError
79
+ throw NameError.new("ExtJS::Store failed with an unknown controller named '#{name.to_s}'")
76
80
  end
77
81
  end
78
-
82
+
79
83
  def self.get_model(controller, model)
80
- if (defined?(Rails))
81
- ((model) ? model : controller.singularize).camelize.constantize
82
- else
83
- Extlib::Inflection.constantize(Extlib::Inflection.camelize(((model) ? model : Extlib::Inflection.singularize(controller))))
84
+ unless model.class == Class
85
+ begin
86
+ if (defined?(Rails))
87
+ model = ((model) ? model : controller.singularize).camelize.constantize
88
+ else
89
+ model = Extlib::Inflection.constantize(Extlib::Inflection.camelize(((model) ? model : Extlib::Inflection.singularize(controller))))
90
+ end
91
+ rescue NameError => e
92
+ throw NameError.new("EXTJS::Store found an unknown model #{model.to_s})")
93
+ end
84
94
  end
95
+ model
85
96
  end
86
97
 
87
98
  def proxy
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: extjs-mvc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Scott
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-25 00:00:00 -05:00
12
+ date: 2010-02-28 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency