citier 0.1.9 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('citier', '0.1.9') do |p|
5
+ Echoe.new('citier', '0.1.10') do |p|
6
6
  p.description = "CITIER (Class Inheritance & Table Inheritance Embeddings for Rails) is a solution for single and multiple class table inheritance.
7
7
  For full information: http://peterhamilton.github.com/citier/
8
8
  For the original version by ALTRABio see www.github.com/altrabio/"
data/citier.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{citier}
5
- s.version = "0.1.9"
5
+ s.version = "0.1.10"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Peter Hamilton, Originally from Laurent Buffat, Pierre-Emmanuel Jouve"]
@@ -41,9 +41,11 @@ module ChildInstanceMethods
41
41
  end
42
42
 
43
43
  # Update root class with this 'type'
44
- sql = "UPDATE #{self.class.root_class.table_name} SET #{self.class.inheritance_column} = '#{self.class.to_s}' WHERE id = #{self.id}"
45
- citier_debug("SQL : #{sql}")
46
- self.connection.execute(sql)
44
+ if parent_saved && current_saved
45
+ sql = "UPDATE #{self.class.root_class.table_name} SET #{self.class.inheritance_column} = '#{self.class.to_s}' WHERE id = #{self.id}"
46
+ citier_debug("SQL : #{sql}")
47
+ self.connection.execute(sql)
48
+ end
47
49
  return parent_saved && current_saved
48
50
  end
49
51
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: citier
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 9
10
- version: 0.1.9
9
+ - 10
10
+ version: 0.1.10
11
11
  platform: ruby
12
12
  authors:
13
13
  - Peter Hamilton, Originally from Laurent Buffat, Pierre-Emmanuel Jouve