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 +4 -0
- data/lib/classy-inheritance.rb +4 -4
- data/lib/classy-inheritance/version.rb +1 -1
- data/website/index.html +1 -1
- metadata +1 -1
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
|
data/lib/classy-inheritance.rb
CHANGED
@@ -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
|
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,
|
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
|
|
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.
|
36
|
+
<a href="http://rubyforge.org/projects/classyinherit" class="numbers">0.4.4</a>
|
37
37
|
</div>
|
38
38
|
<p><i>“You stay classy, inheritance” – Gibson</i></p>
|
39
39
|
|