citier 0.1.14 → 0.1.15
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/citier.gemspec +2 -2
- data/lib/citier/class_methods.rb +4 -4
- data/lib/citier/core_ext.rb +1 -1
- data/lib/citier/sql_adapters.rb +2 -1
- metadata +3 -3
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.
|
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/"
|
data/citier.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{citier}
|
5
|
-
s.version = "0.1.
|
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{
|
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/}
|
data/lib/citier/class_methods.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
-
|
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
|
data/lib/citier/core_ext.rb
CHANGED
data/lib/citier/sql_adapters.rb
CHANGED
@@ -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
|
-
-
|
9
|
-
version: 0.1.
|
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:
|
17
|
+
date: 2012-01-08 00:00:00 +00:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|