citier 0.1.14 → 0.1.15

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/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('citier', '0.1.14') do |p|
5
+ Echoe.new('citier', '0.1.15') 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/"
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{citier}
5
- s.version = "0.1.14"
5
+ s.version = "0.1.15"
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"]
9
- s.date = %q{2011-04-29}
9
+ s.date = %q{2012-01-08}
10
10
  s.description = %q{CITIER (Class Inheritance & Table Inheritance Embeddings for Rails) is a solution for single and multiple class table inheritance.
11
11
  For full information: http://peterhamilton.github.com/citier/
12
12
  For the original version by ALTRABio see www.github.com/altrabio/}
@@ -10,7 +10,7 @@ module Citier
10
10
  #:table_name = option for setting the name of the current class table_name, default value = 'tableized(current class name)'
11
11
  table_name = (options[:table_name] || self.name.tableize.gsub(/\//,'_')).to_s
12
12
 
13
- set_inheritance_column "#{db_type_field}"
13
+ self.inheritance_column = "#{db_type_field}"
14
14
 
15
15
  if(self.superclass!=ActiveRecord::Base)
16
16
  # Non root-class
@@ -19,7 +19,7 @@ module Citier
19
19
  citier_debug("table_name -> #{table_name}")
20
20
 
21
21
  # Set up the table which contains ALL attributes we want for this class
22
- set_table_name "view_#{table_name}"
22
+ self.table_name = "view_#{table_name}"
23
23
 
24
24
  citier_debug("tablename (view) -> #{self.table_name}")
25
25
 
@@ -38,7 +38,7 @@ module Citier
38
38
 
39
39
  citier_debug("Root Class")
40
40
 
41
- set_table_name "#{table_name}"
41
+ self.table_name = "#{table_name}"
42
42
 
43
43
  citier_debug("table_name -> #{self.table_name}")
44
44
 
@@ -47,4 +47,4 @@ module Citier
47
47
  end
48
48
  end
49
49
  end
50
- end
50
+ end
@@ -29,7 +29,7 @@ class ActiveRecord::Base
29
29
 
30
30
  # set the name of the table associated to this class
31
31
  # this class will be associated to the writable table of the class_reference class
32
- set_table_name(t_name)
32
+ self.table_name = t_name
33
33
  end
34
34
  end
35
35
  end
@@ -16,7 +16,7 @@ begin
16
16
  module ConnectionAdapters
17
17
  class SQLiteAdapter < AbstractAdapter
18
18
 
19
- def tables(name = nil)
19
+ def tables(name = 'SCHEMA', table_name = nil)
20
20
  sql = <<-SQL
21
21
  SELECT name
22
22
  FROM sqlite_master
@@ -25,6 +25,7 @@ begin
25
25
  # Modification : the where clause was intially WHERE type = 'table' AND NOT name = 'sqlite_sequence'
26
26
  # now it is WHERE (type = 'table' or type='view') AND NOT name = 'sqlite_sequence'
27
27
  # this modification is made to consider tables AND VIEWS as tables
28
+ sql << " AND name = #{quote_table_name(table_name)}" if table_name
28
29
 
29
30
  execute(sql, name).map do |row|
30
31
  row['name']
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 14
9
- version: 0.1.14
8
+ - 15
9
+ version: 0.1.15
10
10
  platform: ruby
11
11
  authors:
12
12
  - Peter Hamilton, Originally from Laurent Buffat, Pierre-Emmanuel Jouve
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-04-29 00:00:00 +01:00
17
+ date: 2012-01-08 00:00:00 +00:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency