activerecord-advantage-adapter 0.1.0 → 0.1.1

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.
@@ -55,6 +55,7 @@ module ActiveRecord
55
55
  connection_string = "data source=#{config[:database]};User ID=#{config[:username]};"
56
56
  connection_string += "Password=#{config[:password]};" unless config[:options].nil?
57
57
  connection_string += "#{config[:options]};" unless config[:options].nil?
58
+ connection_string += "DateFormat=YYYY-MM-DD;"
58
59
 
59
60
  db = ADS.instance.api.ads_new_connection()
60
61
 
@@ -447,7 +448,7 @@ SQL
447
448
  # Nullability is returned as 0 (no nulls allowed) or 1 (nulls allowed)
448
449
  # Alos, ActiveRecord expects an autoincrement column to have default value of NULL
449
450
  def table_structure(table_name)
450
- sql = "SELECT COLUMN_NAME, IIF(COLUMN_DEF = 'NULL', null, COLUMN_DEF) as COLUMN_DEF, TYPE_NAME, NULLABLE from (EXECUTE PROCEDURE sp_GetColumns( NULL, NULL, '#{table_name}', NULL )) spgc;"
451
+ sql = "SELECT COLUMN_NAME, IIF(COLUMN_DEF = 'NULL', null, COLUMN_DEF) as COLUMN_DEF, TYPE_NAME, NULLABLE from (EXECUTE PROCEDURE sp_GetColumns( NULL, NULL, '#{table_name}', NULL )) spgc where table_cat <> 'system';"
451
452
  structure = execute(sql, :skip_logging)
452
453
  raise(ActiveRecord::StatementInvalid, "Could not find table '#{table_name}'") if structure == false
453
454
  structure
@@ -24,7 +24,8 @@ module Arel
24
24
  def visit_Arel_Nodes_SelectCore o
25
25
  [
26
26
  "#{o.projections.map { |x| visit x }.join ', '}",
27
- ("FROM #{visit o.froms}" if o.froms),
27
+ #("FROM #{visit o.froms}" if o.froms),
28
+ ("FROM #{visit o.source}" if o.source),
28
29
  ("WHERE #{o.wheres.map { |x| visit x }.join ' AND ' }" unless o.wheres.empty?),
29
30
  ("GROUP BY #{o.groups.map { |x| visit x }.join ', ' }" unless o.groups.empty?),
30
31
  (visit(o.having) if o.having),
@@ -36,4 +37,3 @@ end
36
37
 
37
38
  Arel::Visitors::VISITORS['advantage'] = Arel::Visitors::Advantage
38
39
 
39
- 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-advantage-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-17 00:00:00.000000000 Z
12
+ date: 2012-12-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: advantage
16
- requirement: &22592844 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: 0.1.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *22592844
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 0.1.0
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: activerecord
27
- requirement: &22592400 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,7 +37,12 @@ dependencies:
32
37
  version: 3.2.0
33
38
  type: :runtime
34
39
  prerelease: false
35
- version_requirements: *22592400
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 3.2.0
36
46
  description: ! ' ActiveRecord driver for Advantage
37
47
 
38
48
  '
@@ -73,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
83
  version: '0'
74
84
  requirements: []
75
85
  rubyforge_project:
76
- rubygems_version: 1.8.16
86
+ rubygems_version: 1.8.24
77
87
  signing_key:
78
88
  specification_version: 3
79
89
  summary: ActiveRecord driver for Advantage