active_nomad 0.0.3 → 0.0.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/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.0.4 2010-10-01
2
+
3
+ * Attributes are inheritable.
4
+
1
5
  == 0.0.3 2010-09-29
2
6
 
3
7
  * Don't open unnecessary database transactions on save.
@@ -1,5 +1,5 @@
1
1
  module ActiveNomad
2
- VERSION = [0, 0, 3]
2
+ VERSION = [0, 0, 4]
3
3
 
4
4
  class << VERSION
5
5
  include Comparable
data/lib/active_nomad.rb CHANGED
@@ -83,7 +83,7 @@ module ActiveNomad
83
83
  end
84
84
 
85
85
  def columns # :nodoc:
86
- @columns ||= []
86
+ @columns ||= superclass.columns.dup
87
87
  end
88
88
 
89
89
  def reset_column_information # :nodoc:
@@ -103,6 +103,7 @@ module ActiveNomad
103
103
  end
104
104
  end
105
105
 
106
+ @columns = []
106
107
  self.abstract_class = true
107
108
 
108
109
  def create_or_update_without_callbacks
@@ -60,6 +60,16 @@ describe ActiveNomad::Base do
60
60
  end
61
61
  klass.columns_hash['name'].default.should == 'Joe'
62
62
  end
63
+
64
+ it "should add the attribute to those of any superclasses" do
65
+ superclass = Class.new(ActiveNomad::Base) do
66
+ attribute :a, :integer
67
+ end
68
+ subclass = Class.new(superclass) do
69
+ attribute :b, :integer
70
+ end
71
+ subclass.columns.map{|c| c.name}.should == ['a', 'b']
72
+ end
63
73
  end
64
74
 
65
75
  describe "an integer attribute" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_nomad
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - George Ogata
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-29 00:00:00 -04:00
18
+ date: 2010-10-01 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency