activerecord_lite 0.2.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/activerecord_lite.gemspec +1 -1
- data/lib/activerecord_lite/base.rb +2 -2
- data/lib/activerecord_lite/version.rb +1 -1
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63cb732de671e3311e173459f2b87e3da6e8494bb8b33a959802f0c675d2d352
|
4
|
+
data.tar.gz: 5a61b779bc561a52ac4e591069dbe3785290f105e7453952be1511504a397775
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29a06f1e3bc173be527db6f60ed8967756a0a4b473f0cf0ef64930a031b743c0ff21931f43b5d8337a2b0a1398e6cbd847d457d4aa4a2720ac29fae2e3624c70
|
7
|
+
data.tar.gz: 15c37c4e5edd94f3953ea662cbd0512adb8fec19d184d2102282cfb951100264aa985126d0e7a1b737499393ddfb98d4f7eab7dc090aa4515f740bea0692e36a
|
data/activerecord_lite.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
|
|
16
16
|
end
|
17
17
|
spec.require_paths = ["lib"]
|
18
18
|
|
19
|
-
spec.add_development_dependency "bundler"
|
19
|
+
spec.add_development_dependency "bundler"
|
20
20
|
spec.add_development_dependency "rspec", "~> 3.0"
|
21
21
|
spec.add_development_dependency "activerecord", ">= 4.0.0"
|
22
22
|
spec.add_development_dependency "sqlite3", "~> 1.3"
|
@@ -2,7 +2,7 @@ module ActiveRecordLite
|
|
2
2
|
module Base
|
3
3
|
def fetch_lite(*select_sql)
|
4
4
|
select_columns, columns = prepare(select_sql)
|
5
|
-
_struct = Struct.new(
|
5
|
+
_struct = Struct.new(*columns)
|
6
6
|
sql = select(select_columns).to_sql
|
7
7
|
self.connection.select_all(sql).map { |result| _struct.new(*result.values) }
|
8
8
|
end
|
@@ -27,7 +27,7 @@ module ActiveRecordLite
|
|
27
27
|
|
28
28
|
def prepare_hash(select_sql)
|
29
29
|
columns = select_sql.keys
|
30
|
-
select_columns = select_sql.map { |key, value| "#{value} #{key}" }.join(",")
|
30
|
+
select_columns = select_sql.map { |key, value| "#{value} AS #{key}" }.join(",")
|
31
31
|
[select_columns, columns]
|
32
32
|
end
|
33
33
|
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord_lite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adriano Bacha
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,8 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
100
|
- !ruby/object:Gem::Version
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
|
-
|
104
|
-
rubygems_version: 2.7.7
|
103
|
+
rubygems_version: 3.2.33
|
105
104
|
signing_key:
|
106
105
|
specification_version: 4
|
107
106
|
summary: lightweight activerecord queries
|