mcmire-ar_oo_select 0.3 → 0.4
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/lib/ar_oo_select/ar_ext.rb +8 -8
- metadata +4 -3
data/lib/ar_oo_select/ar_ext.rb
CHANGED
|
@@ -7,8 +7,8 @@ module ArOoSelect
|
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
# Executes the query and returns an array of openhashes.
|
|
10
|
-
def oo_select_all(query)
|
|
11
|
-
query = sanitize_sql(query)
|
|
10
|
+
def oo_select_all(query, sanitize_query=true)
|
|
11
|
+
query = sanitize_sql(query) if sanitize_query
|
|
12
12
|
rows = connection.select_all(query)
|
|
13
13
|
rows.map do |row|
|
|
14
14
|
oh = OpenHash.new(row)
|
|
@@ -18,8 +18,8 @@ module ArOoSelect
|
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
# Executes the query and returns an array of rows.
|
|
21
|
-
def oo_select_rows(query)
|
|
22
|
-
query = sanitize_sql(query)
|
|
21
|
+
def oo_select_rows(query, sanitize_query=true)
|
|
22
|
+
query = sanitize_sql(query) if sanitize_query
|
|
23
23
|
rows = connection.select_rows(query)
|
|
24
24
|
rows.map do |row|
|
|
25
25
|
row.map {|v| oo_select_type_cast(v) }
|
|
@@ -27,13 +27,13 @@ module ArOoSelect
|
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
# Executes the query and returns the first row as an openhash.
|
|
30
|
-
def oo_select_one(query)
|
|
31
|
-
oo_select_all(query).first
|
|
30
|
+
def oo_select_one(query, sanitize_query)
|
|
31
|
+
oo_select_all(query, sanitize_query).first
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
# Executes the query and returns the value of the first column in the first row.
|
|
35
|
-
def oo_select_value(query)
|
|
36
|
-
query = sanitize_sql(query)
|
|
35
|
+
def oo_select_value(query, sanitize_query)
|
|
36
|
+
query = sanitize_sql(query) if sanitize_query
|
|
37
37
|
connection.select_value(query)
|
|
38
38
|
end
|
|
39
39
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mcmire-ar_oo_select
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: "0.
|
|
4
|
+
version: "0.4"
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Elliot Winkler
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2009-
|
|
12
|
+
date: 2009-08-18 00:00:00 -07:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies: []
|
|
15
15
|
|
|
@@ -28,6 +28,7 @@ files:
|
|
|
28
28
|
- lib/ar_oo_select/will_paginate_ext.rb
|
|
29
29
|
has_rdoc: false
|
|
30
30
|
homepage: http://github.com/mcmire/ar_oo_select
|
|
31
|
+
licenses:
|
|
31
32
|
post_install_message:
|
|
32
33
|
rdoc_options: []
|
|
33
34
|
|
|
@@ -48,7 +49,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
48
49
|
requirements: []
|
|
49
50
|
|
|
50
51
|
rubyforge_project:
|
|
51
|
-
rubygems_version: 1.
|
|
52
|
+
rubygems_version: 1.3.5
|
|
52
53
|
signing_key:
|
|
53
54
|
specification_version: 2
|
|
54
55
|
summary: Use find_by_sql without going through ActiveRecord
|