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.
@@ -1,3 +1,5 @@
1
+ == 0.6.2 2008-09-25
2
+ * Added back validates_associated override.
1
3
  == 0.6.1 2008-07-21
2
4
  * Removed validates_associated override, was causing issues.
3
5
  == 0.6.0 2008-07-18
@@ -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
- =begin
4
+
5
5
  module ActiveRecord::Validations::ClassMethods
6
- def validates_associated(association, options = {})
7
- class_eval do
8
- validates_each(association) do |record, associate_name, value|
9
- associate = record.send(associate_name)
10
- if associate && !associate.valid?
11
- associate.errors.each do |key, value|
12
- record.errors.add(key, value)
13
- end
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
- =end
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[:validates_assoicated_if].class)
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
@@ -2,7 +2,7 @@ module ClassyInheritance #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 6
5
- TINY = 1
5
+ TINY = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -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.1</a>
36
+ <a href="http://rubyforge.org/projects/classyinherit" class="numbers">0.6.2</a>
37
37
  </div>
38
38
  <p><i>&#8220;You stay classy, inheritance&#8221; &#8211; Gibson</i></p>
39
-
40
-
41
- <h2>Consolidation of information</h2>
42
-
43
-
44
- <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&#8217;m giving <a href="http://redmine.org">Redmine</a> a shot a running everything for me. I&#8217;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>
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&#8217;m giving <a href="http://redmine.org">Redmine</a> a shot a running everything for me. I&#8217;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.1
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-07-21 00:00:00 -04:00
12
+ date: 2008-09-25 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency