expose_model 0.0.1 → 0.0.2

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.
@@ -1,3 +1,7 @@
1
+ == 0.0.2 2009-02-05
2
+
3
+ * Move some stuff around
4
+
1
5
  == 0.0.1 2009-02-05
2
6
 
3
7
  * 1 major enhancement:
@@ -1,17 +1,6 @@
1
1
  $:.unshift(File.dirname(__FILE__)) unless
2
- $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
-
4
- require 'action_controller'
5
- require 'action_view'
2
+ $:.include?(File.dirname(__FILE__)) ||
3
+ $:.include?(File.expand_path(File.dirname(__FILE__)))
6
4
 
7
5
  require 'expose_model/expose_model'
8
6
  require 'expose_model/action_view'
9
-
10
- # Stop sharing so much!
11
- ActionController::Base.class_eval { def add_instance_variables_to_assigns; end }
12
- # Stop caring so much!
13
- ActionView::Base.class_eval { def assign_variables_from_controller; end }
14
-
15
- module ExposeModel
16
- VERSION = '0.0.1'
17
- end
@@ -1,3 +1,5 @@
1
+ require 'action_view'
2
+
1
3
  # raise a 404, not a 500 if we first access the exposed method in a view
2
4
  class ActionView::Template
3
5
  def render_template(view, local_assigns = {})
@@ -7,3 +9,5 @@ class ActionView::Template
7
9
  raise e
8
10
  end
9
11
  end
12
+
13
+ ActionView::Base.class_eval { def assign_variables_from_controller; end }
@@ -1,5 +1,13 @@
1
- class ApplicationController < ActionController::Base
2
- class << self
1
+ require 'action_controller'
2
+
3
+ module ExposeModel
4
+ VERSION = '0.0.2'
5
+
6
+ def self.included(base) #:nodoc:
7
+ base.extend(ClassMethods)
8
+ end
9
+
10
+ module ClassMethods
3
11
  def expose_model(model = nil)
4
12
  raise ArgumentError.new('expose_model requires a model name') if model.nil?
5
13
  model = model.to_s
@@ -27,4 +35,9 @@ class ApplicationController < ActionController::Base
27
35
  )
28
36
  end
29
37
  end
30
- end
38
+ end
39
+
40
+ ActionController::Base.class_eval {
41
+ def add_instance_variables_to_assigns; end
42
+ include ExposeModel
43
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: expose_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Moen