classy-inheritance 0.4.3 → 0.4.4

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.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.4.4 2008-06-24
2
+ * Fix: :class_name attribute was not being recognized
3
+ == 0.4.3 2008-06-24
4
+ * Fix: :prefix option was not being removed before passing option to has_one/belongs_to
1
5
  == 0.4.2 2008-06-24
2
6
  * Fix: has_one only saves for a create, not update. added in save for update.
3
7
  == 0.4.1 2008-06-23
@@ -39,7 +39,7 @@ module Stonean
39
39
  define_can_be_method_on_requisite_class(model_sym, options[:as])
40
40
  end
41
41
 
42
- options[:attrs].each{|attr| define_accessors(model_sym, attr, options[:prefix])}
42
+ options[:attrs].each{|attr| define_accessors(model_sym, attr, options)}
43
43
  end
44
44
 
45
45
 
@@ -115,8 +115,8 @@ module Stonean
115
115
  end
116
116
  end
117
117
 
118
- def define_accessors(model_sym, attr, prefix)
119
- accessor_method_name = ( prefix ? "#{model_sym}_#{attr}" : attr)
118
+ def define_accessors(model_sym, attr, options)
119
+ accessor_method_name = ( options[:prefix] ? "#{model_sym}_#{attr}" : attr)
120
120
 
121
121
  define_method accessor_method_name do
122
122
  eval("self.#{model_sym} ? self.#{model_sym}.#{attr} : nil")
@@ -126,7 +126,7 @@ module Stonean
126
126
  model_defined = eval("self.#{model_sym}")
127
127
 
128
128
  unless model_defined
129
- klass = model_sym.to_s.classify
129
+ klass = options[:class_name] || model_sym.to_s.classify
130
130
  eval("self.#{model_sym} = #{klass}.new")
131
131
  end
132
132
 
@@ -2,7 +2,7 @@ module ClassyInheritance #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 4
5
- TINY = 3
5
+ TINY = 4
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/website/index.html CHANGED
@@ -33,7 +33,7 @@
33
33
  <h1>Classy Inheritance</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/classyinherit"; return false'>
35
35
  <p>Get Version</p>
36
- <a href="http://rubyforge.org/projects/classyinherit" class="numbers">0.4.3</a>
36
+ <a href="http://rubyforge.org/projects/classyinherit" class="numbers">0.4.4</a>
37
37
  </div>
38
38
  <p><i>&#8220;You stay classy, inheritance&#8221; &#8211; Gibson</i></p>
39
39
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: classy-inheritance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Stone