validates_constancy 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,5 +1,9 @@
1
1
  *SVN*
2
2
 
3
+ *1.0.1*
4
+
5
+ * Fix bug #14521 addressing subclasses of a constancy-validated model that do
6
+ not themselves have constancy validations
3
7
 
4
8
  *1.0*
5
9
 
data/README CHANGED
@@ -1,4 +1,4 @@
1
- == Validates Constancy for Active Record
1
+ == Validates Constancy for Ruby on Rails (Active Record)
2
2
 
3
3
  http://constancy.rubyforge.org
4
4
 
@@ -103,9 +103,9 @@ according to the version of Rails (Active Record) it works with.
103
103
 
104
104
  ==== Gem
105
105
 
106
- [<b>Rails v1.2.2 (Active Record v1.15.2)</b>] Check out http://constancy.rubyforge.org/svn/gem/tags/rel_1-0-0/test/rails_1-2-2
107
- [<b>Rails v1.2.3 (Active Record v1.15.3)</b>] Check out http://constancy.rubyforge.org/svn/gem/tags/rel_1-0-0/test/rails_1-2-3
108
- [<b>Edge Rails</b>] Check out http://constancy.rubyforge.org/svn/gem/tags/rel_1-0-0/test/rails_edge
106
+ [<b>Rails v1.2.2 (Active Record v1.15.2)</b>] Check out http://constancy.rubyforge.org/svn/gem/trunk/test/rails_1-2-2
107
+ [<b>Rails v1.2.3 (Active Record v1.15.3)</b>] Check out http://constancy.rubyforge.org/svn/gem/trunk/test/rails_1-2-3
108
+ [<b>Edge Rails</b>] Check out http://constancy.rubyforge.org/svn/gem/trunk/test/rails_edge
109
109
 
110
110
  ==== Plugin
111
111
 
@@ -48,7 +48,11 @@ module ConstancyValidation
48
48
  ActiveRecord::Errors.default_error_messages[:constancy]}
49
49
  options.merge!(attribute_names.pop) if attribute_names.last.kind_of?(Hash)
50
50
 
51
- (@constant_attribute_names ||= []).concat attribute_names.collect!(&:to_s)
51
+ constant_names = base_class.instance_variable_get(:@constant_attribute_names) ||
52
+ []
53
+ constant_names.concat attribute_names.collect!(&:to_s)
54
+ base_class.instance_variable_set :@constant_attribute_names,
55
+ constant_names
52
56
 
53
57
  ConstancyValidation::OriginalAttributesCapture.extend self
54
58
 
@@ -100,7 +104,8 @@ module ConstancyValidation
100
104
 
101
105
  def create_method_capture_original_attributes(klass)
102
106
  create_method(klass, :capture_original_attributes) do
103
- constant_names = self.class.instance_variable_get(:@constant_attribute_names)
107
+ constant_names = self.class.base_class.instance_variable_get(:@constant_attribute_names) ||
108
+ []
104
109
  originals = constant_names.inject({}) do |result, attribute_name|
105
110
  result[attribute_name] = read_attribute(attribute_name)
106
111
  result
@@ -3,4 +3,4 @@ suites of integration tests in the form of Active Record models that use the
3
3
  gem while running against different versions of Active Record.
4
4
 
5
5
  See the doc/README_FOR_APP files that are included in the various Rails
6
- applications in http://constancy.rubyforge.org/svn/gem/tags/rel_1-0-0/test.
6
+ applications in http://constancy.rubyforge.org/svn/gem/trunk/test.
File without changes
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: validates_constancy
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.0
7
- date: 2007-08-29 00:00:00 -05:00
6
+ version: 1.0.1
7
+ date: 2007-10-08 00:00:00 -05:00
8
8
  summary: "[Rails] Adds a 'validates_constancy_of' validation to Active Record. It allows you to protect model attributes from being changed after a record is created."
9
9
  require_paths:
10
10
  - lib
@@ -40,10 +40,14 @@ files:
40
40
  - test
41
41
  - test/README
42
42
  - validates_constancy-1.0.0.gem
43
+ - validates_constancy-1.0.1.gem
43
44
  test_files: []
44
45
 
45
- rdoc_options: []
46
-
46
+ rdoc_options:
47
+ - --title
48
+ - Validates Constancy for Active Record
49
+ - --main
50
+ - README
47
51
  extra_rdoc_files:
48
52
  - MIT-LICENSE
49
53
  - README