johnsbrn-classy-inheritance 0.6.7 → 0.6.8

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.
Files changed (3) hide show
  1. data/History.txt +2 -0
  2. data/lib/classy-inheritance.rb +9 -3
  3. metadata +1 -1
data/History.txt CHANGED
@@ -1,3 +1,5 @@
1
+ == 0.6.8 2009-02-03
2
+ * Make has_one fix consistent with edge Rails - johnsbrn
1
3
  == 0.6.7 2009-02-01
2
4
  * Forgot to remove some debugging code -johnsbrn
3
5
  == 0.6.6 2009-02-01
@@ -7,7 +7,10 @@ module ActiveRecord
7
7
  record["#{@reflection.options[:as]}_id"] = @owner.id unless @owner.new_record?
8
8
  record["#{@reflection.options[:as]}_type"] = @owner.class.base_class.name.to_s
9
9
  else
10
- record[@reflection.primary_key_name] = @reflection.options.has_key?(:primary_key) ? @owner.send(@reflection.options[:primary_key]) : @owner.id unless @owner.new_record?
10
+ unless @owner.new_record?
11
+ primary_key = @reflection.options[:primary_key] || :id
12
+ record[@reflection.primary_key_name] = @owner.send(primary_key)
13
+ end
11
14
  end
12
15
  end
13
16
 
@@ -24,7 +27,10 @@ module ActiveRecord
24
27
  if replace_existing
25
28
  replace(record, true)
26
29
  else
27
- record[@reflection.primary_key_name] = @reflection.options.has_key?(:primary_key) ? @owner.send(@reflection.options[:primary_key]) : @owner.id unless @owner.new_record?
30
+ unless @owner.new_record?
31
+ primary_key = @reflection.options[:primary_key] || :id
32
+ record[@reflection.primary_key_name] = @owner.send(primary_key)
33
+ end
28
34
  self.target = record
29
35
  end
30
36
 
@@ -36,7 +42,7 @@ end
36
42
 
37
43
  module Stonean
38
44
  module ClassyInheritance
39
- VERSION = '0.6.5'
45
+ VERSION = '0.6.8'
40
46
 
41
47
  def self.version
42
48
  VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: johnsbrn-classy-inheritance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.7
4
+ version: 0.6.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Stone