find_as_hashes 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.octopolo.yml +4 -0
- data/.soyuz.yml +13 -0
- data/CHANGELOG.markdown +1 -0
- data/lib/find_as_hashes.rb +16 -3
- data/lib/find_as_hashes/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7878cce2c73a10e929ab7e41cb87f2e2a75a5cc8
|
4
|
+
data.tar.gz: 5450e62f8254997fc182684cd39439c357896c92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 174b4fa10e6679abe33bc3d42e82f073cb4a8ba6e41ec2426d1a5014c96b97e39b69ae78721263cd57ea64c9e8cb6a34e6af45df8a785bfc3756489d72119a03
|
7
|
+
data.tar.gz: 22d53f129c3005aef6571e52ef6f42a6920dff2cf5f7b3bd586f8485c0e7c5c42290099b92de33e2521828c894fbb5543a3099f666b031b717df14d7741aff92
|
data/.octopolo.yml
ADDED
data/.soyuz.yml
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
defaults:
|
2
|
+
deploy_cmd: gem push *.gem
|
3
|
+
before_deploy_cmds:
|
4
|
+
- op tag-release
|
5
|
+
- sed -i '' -e "s/\".*/\"$(git tag | tail -1 | sed s/v//)\"/" lib/find_as_hashes/version.rb
|
6
|
+
- git add lib/find_as_hashes/version.rb
|
7
|
+
- git commit -m "Version Bump" && git push
|
8
|
+
- gem build find_as_hashes.gemspec
|
9
|
+
after_deploy_cmds:
|
10
|
+
- rm *.gem
|
11
|
+
environments:
|
12
|
+
-
|
13
|
+
rubygems: {}
|
data/CHANGELOG.markdown
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
#### v0.6.0
|
data/lib/find_as_hashes.rb
CHANGED
@@ -6,13 +6,26 @@ module FindAsHashes
|
|
6
6
|
|
7
7
|
module Relation
|
8
8
|
def all_as_hashes
|
9
|
-
|
9
|
+
fix_prepared_statement do
|
10
|
+
connection.select_all(self.joins(self.includes_values).to_sql).to_a
|
11
|
+
end
|
10
12
|
end
|
11
13
|
|
12
14
|
def first_as_hash
|
13
|
-
|
14
|
-
|
15
|
+
fix_prepared_statement do
|
16
|
+
relation_stack = limit(1)
|
17
|
+
connection.select_one(relation_stack.joins(relation_stack.includes_values).to_sql)
|
18
|
+
end
|
15
19
|
end
|
20
|
+
|
21
|
+
def fix_prepared_statement
|
22
|
+
if connection.respond_to?(:unprepared_statement)
|
23
|
+
connection.unprepared_statement{ yield }
|
24
|
+
else
|
25
|
+
yield
|
26
|
+
end
|
27
|
+
end
|
28
|
+
private :fix_prepared_statement
|
16
29
|
end
|
17
30
|
|
18
31
|
module Base
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: find_as_hashes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Byrne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -160,8 +160,11 @@ extensions: []
|
|
160
160
|
extra_rdoc_files: []
|
161
161
|
files:
|
162
162
|
- ".gitignore"
|
163
|
+
- ".octopolo.yml"
|
164
|
+
- ".soyuz.yml"
|
163
165
|
- ".travis.yml"
|
164
166
|
- Appraisals
|
167
|
+
- CHANGELOG.markdown
|
165
168
|
- Gemfile
|
166
169
|
- Gemfile.lock
|
167
170
|
- MIT-LICENSE
|