classy-inheritance 0.6.1 → 0.6.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.
- data/History.txt +2 -0
- data/lib/classy-inheritance.rb +12 -11
- data/lib/classy-inheritance/version.rb +1 -1
- data/website/index.html +7 -19
- metadata +2 -2
data/History.txt
CHANGED
data/lib/classy-inheritance.rb
CHANGED
@@ -1,22 +1,23 @@
|
|
1
1
|
$:.unshift(File.dirname(__FILE__)) unless
|
2
2
|
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
3
3
|
|
4
|
-
|
4
|
+
|
5
5
|
module ActiveRecord::Validations::ClassMethods
|
6
|
-
def validates_associated(
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
def validates_associated(*attr_names)
|
7
|
+
configuration = { :message => ActiveRecord::Errors.default_error_messages[:invalid], :on => :save }
|
8
|
+
configuration.update(attr_names.extract_options!)
|
9
|
+
|
10
|
+
validates_each(attr_names, configuration) do |record, attr_name, value|
|
11
|
+
associate = record.send(attr_name)
|
12
|
+
if associate && !associate.valid?
|
13
|
+
associate.errors.each do |key, value|
|
14
|
+
record.errors.add(key, value)
|
14
15
|
end
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
18
19
|
end
|
19
|
-
|
20
|
+
|
20
21
|
|
21
22
|
module Stonean
|
22
23
|
module ClassyInheritance
|
@@ -38,7 +39,7 @@ module Stonean
|
|
38
39
|
end
|
39
40
|
|
40
41
|
if options.has_key?(:validates_associated_if) && options[:validates_associated_if] != true
|
41
|
-
if [Symbol, String, Proc].include?(options[:
|
42
|
+
if [Symbol, String, Proc].include?(options[:validates_associated_if].class)
|
42
43
|
validates_associated model_sym, :if => options[:validates_associated_if]
|
43
44
|
end
|
44
45
|
else
|
data/website/index.html
CHANGED
@@ -33,27 +33,15 @@
|
|
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.6.
|
36
|
+
<a href="http://rubyforge.org/projects/classyinherit" class="numbers">0.6.2</a>
|
37
37
|
</div>
|
38
38
|
<p><i>“You stay classy, inheritance” – Gibson</i></p>
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
<h2>Quick links</h2>
|
48
|
-
|
49
|
-
|
50
|
-
<p><a href="http://stonean.com/wiki/classy-inheritance">Wiki</a></p>
|
51
|
-
|
52
|
-
|
53
|
-
<p><a href="http://stonean.com/projects/classy-inheritance/boards">Forum</a></p>
|
54
|
-
|
55
|
-
|
56
|
-
<p>Thanks for your interest in Classy Inheritance,<br/>
|
39
|
+
<h2>Consolidation of information</h2>
|
40
|
+
<p>Maintaining this page, the wiki at GitHub, the Google Group and no issue tracker is not an ideal setup. So, everything is moving to <a href="http://stonean.com">stonean.com</a> where I’m giving <a href="http://redmine.org">Redmine</a> a shot a running everything for me. I’ll be posting release announcements to the news feed for each project and keeping the docs up-to-date. Hopefully this will be better for everyone.</p>
|
41
|
+
<h2>Quick links</h2>
|
42
|
+
<p><a href="http://stonean.com/wiki/classy-inheritance">Wiki</a></p>
|
43
|
+
<p><a href="http://stonean.com/projects/classy-inheritance/boards">Forum</a></p>
|
44
|
+
<p>Thanks for your interest in Classy Inheritance,<br/><br />
|
57
45
|
-andy</p>
|
58
46
|
<p class="coda">
|
59
47
|
<a href="http://blog.stonean.com">Andrew Stone</a>, 8th July 2008<br>
|
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.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Stone
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-09-25 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|