mereghost-rails_sql_views 0.8.5 → 0.8.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9b73d5ec817858ceac02807644de1b49d00907f5
4
+ data.tar.gz: 68860896a2763b5d075382139dc5a3ff80b3bc87
5
+ SHA512:
6
+ metadata.gz: 1464a267fb50eec1fe118aeff825898b1baf495c6ac153588b123c6bd9d8feb7e0dec4a78dfb5e7c2879ef85e55008b13e387703883772dbcdb8c3ef41304e65
7
+ data.tar.gz: 4bbb593150e5d09faef206725b17253e3850f1af8e13cc9d881b0ba8be0f5bb8c05980bb477e6377deda5bdcca8e3e365bb0cb240dd0b8d5779e018e1fd40987
data/Rakefile CHANGED
@@ -1,7 +1,8 @@
1
1
  require 'rake'
2
2
  require 'rake/testtask'
3
3
  require 'rdoc/task'
4
- require 'rubygems/package_task'
4
+ #require 'rake/packagetask'
5
+ #require 'rake/gempackagetask'
5
6
 
6
7
  require File.join(File.dirname(__FILE__), 'lib/rails_sql_views', 'version')
7
8
 
@@ -25,8 +25,14 @@ module RailsSqlViews
25
25
  # Get the view select statement for the specified view.
26
26
  def view_select_statement(view, name=nil)
27
27
  q =<<-ENDSQL
28
- SELECT view_definition FROM information_schema.views
29
- WHERE table_name = '#{view}'
28
+ SELECT
29
+ SM.definition
30
+ FROM
31
+ sys.objects O
32
+ JOIN
33
+ sys.sql_modules SM ON o.object_id = SM.object_id
34
+ WHERE
35
+ o.type = 'V' AND o.name = '#{view}'
30
36
  ENDSQL
31
37
 
32
38
  view_def = select_value(q, name)
@@ -40,7 +46,7 @@ module RailsSqlViews
40
46
 
41
47
  private
42
48
  def convert_statement(s)
43
- s.sub(/^CREATE.* AS (select .*)/i, '\1').gsub(/\n/, '')
49
+ s.gsub(/\n/, ' ').sub(/.*CREATE VIEW.* AS.* (SELECT .*)/i, '\1')
44
50
  end
45
51
  end
46
52
  end
metadata CHANGED
@@ -1,30 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mereghost-rails_sql_views
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.5
5
- prerelease:
4
+ version: 0.8.6
6
5
  platform: ruby
7
6
  authors:
8
7
  - Anthony Eden
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-09-28 00:00:00.000000000 Z
11
+ date: 2014-02-10 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: activerecord
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  description: Adds support for using SQL views within ActiveRecord
@@ -37,8 +34,10 @@ extra_rdoc_files:
37
34
  - TODO
38
35
  files:
39
36
  - CHANGELOG
37
+ - LICENSE
40
38
  - README
41
39
  - Rakefile
40
+ - TODO
42
41
  - lib/active_record/view.rb
43
42
  - lib/core_ext/module.rb
44
43
  - lib/rails_sql_views.rb
@@ -57,30 +56,27 @@ files:
57
56
  - lib/rails_sql_views/loader.rb
58
57
  - lib/rails_sql_views/schema_dumper.rb
59
58
  - lib/rails_sql_views/version.rb
60
- - LICENSE
61
- - TODO
62
59
  homepage: http://activewarehouse.rubyforge.org/rails_sql_views
63
60
  licenses: []
61
+ metadata: {}
64
62
  post_install_message:
65
63
  rdoc_options: []
66
64
  require_paths:
67
65
  - lib
68
66
  required_ruby_version: !ruby/object:Gem::Requirement
69
- none: false
70
67
  requirements:
71
- - - ! '>='
68
+ - - ">="
72
69
  - !ruby/object:Gem::Version
73
70
  version: '0'
74
71
  required_rubygems_version: !ruby/object:Gem::Requirement
75
- none: false
76
72
  requirements:
77
- - - ! '>='
73
+ - - ">="
78
74
  - !ruby/object:Gem::Version
79
75
  version: '0'
80
76
  requirements: []
81
77
  rubyforge_project:
82
- rubygems_version: 1.8.24
78
+ rubygems_version: 2.2.2
83
79
  signing_key:
84
- specification_version: 3
80
+ specification_version: 4
85
81
  summary: Library which adds SQL Views to ActiveRecord.
86
82
  test_files: []