rgviz-rails 0.18 → 0.19

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,6 +17,8 @@ module Rgviz
17
17
  @adapter = SqliteAdapter.new
18
18
  when 'mysql'
19
19
  @adapter = MySqlAdapter.new
20
+ when 'postgresql'
21
+ @adapter = PostgreSqlAdapter.new
20
22
  end
21
23
  end
22
24
 
data/lib/rgviz_rails.rb CHANGED
@@ -1,3 +1,4 @@
1
1
  require 'rgviz_rails/executor.rb'
2
2
  require 'rgviz_rails/adapters/mysql_adapter.rb'
3
+ require 'rgviz_rails/adapters/postgresql_adapter.rb'
3
4
  require 'rgviz_rails/adapters/sqlite_adapter.rb'
@@ -139,7 +139,7 @@ describe Executor do
139
139
  Person.make :name => 'two', :age => 3
140
140
  Person.make :name => 'two', :age => 4
141
141
 
142
- table = exec 'select max(age) group by name'
142
+ table = exec 'select max(age) group by name order by name'
143
143
 
144
144
  table.rows.length.should == 2
145
145
  table.rows[0].c.length.should == 1
@@ -240,7 +240,7 @@ describe Executor do
240
240
  end
241
241
  end
242
242
 
243
- # it_processes_single_select_column "quarter(created_at)", 'c0', :number, 5 do
243
+ # it_processes_single_select_column "quarter(created_at)", 'c0', :number, 2, 'quarter(created_at)' do
244
244
  # Person.make :created_at => Time.parse('2006-05-02 3:04:09')
245
245
  # end
246
246
 
@@ -286,7 +286,7 @@ describe Executor do
286
286
  Person.make :name => 'Sales', :birthday => '2000-01-12', :age => 350
287
287
  Person.make :name => 'Marketing', :birthday => '2000-01-13', :age => 800
288
288
 
289
- table = exec 'select name, sum(age) group by name pivot birthday'
289
+ table = exec 'select name, sum(age) group by name pivot birthday order by name'
290
290
 
291
291
  table.cols.length.should == 3
292
292
 
@@ -322,7 +322,7 @@ describe Executor do
322
322
  Person.make :name => 'Sales', :birthday => '2000-01-12', :age => 350
323
323
  Person.make :name => 'Marketing', :birthday => '2000-01-13', :age => 800
324
324
 
325
- table = exec 'select sum(age), name group by name pivot birthday'
325
+ table = exec 'select sum(age), name group by name pivot birthday order by name'
326
326
 
327
327
  table.cols.length.should == 3
328
328
 
data/spec/spec_helper.rb CHANGED
@@ -7,7 +7,8 @@ require 'logger'
7
7
  require 'active_record'
8
8
 
9
9
  ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => ':memory:')
10
- #ActiveRecord::Base.establish_connection(:adapter => 'mysql', :database => 'rgviz_rails', :username => 'root', :password => 'Manas.03')
10
+ #ActiveRecord::Base.establish_connection(:adapter => 'mysql', :database => 'rgviz_rails', :username => 'root', :password => '###')
11
+ #ActiveRecord::Base.establish_connection(:adapter => 'postgresql', :database => 'rgviz_rails', :username => 'postgres', :password => '###', :host => '/var/run/postgresql/')
11
12
 
12
13
  ActiveRecord::Schema.define do
13
14
  create_table "cities", :force => true do |t|
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rgviz-rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 47
4
+ hash: 45
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 18
9
- version: "0.18"
8
+ - 19
9
+ version: "0.19"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ary Borenszweig
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-08-17 00:00:00 +07:00
17
+ date: 2010-08-18 00:00:00 +07:00
18
18
  default_executable:
19
19
  dependencies: []
20
20