relation_to_struct 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Appraisals +1 -1
- data/README.md +2 -0
- data/gemfiles/rails_4_1.gemfile +1 -1
- data/gemfiles/rails_4_2.gemfile +1 -1
- data/gemfiles/rails_5_0.gemfile +1 -1
- data/gemfiles/rails_5_1.gemfile +7 -0
- data/lib/relation_to_struct/version.rb +1 -1
- data/relation_to_struct.gemspec +2 -2
- data/spec/active_record_helper/setup.rb +2 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e144536f0414aeccfb958f8ccf336ecec3bc3e8
|
4
|
+
data.tar.gz: d5c5785c24474b4629081346ef5f1c2eb1620ffd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0eede8794be139c326deca580ec817adffe746454848af34ee701e7a540d97267e6de44d0b9245c8f7128335b574013a2bea1fdb6c12f750c497f51cc49f47dc
|
7
|
+
data.tar.gz: 9b7e3a0e055c2501d7d5c23eb11bc08727d71a008f382580c328d746e43037d2c7791094acee393381ec8da822971ee3ec7679d1877b0c9bd2b9efb4b86d3b90
|
data/Appraisals
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# RelationToStruct
|
2
2
|
|
3
|
+
[![Build Status](https://semaphoreci.com/api/v1/jcoleman/relation_to_struct/branches/master/badge.svg)](https://semaphoreci.com/jcoleman/relation_to_struct)
|
4
|
+
|
3
5
|
When one needs to use ActiveRecord to fetch specific values (whether subset columns of a model or arbitrary calculated columns), it's desirable to avoid the overhead of model instances and any associated callbacks.
|
4
6
|
|
5
7
|
ActiveRecord::Relation#pluck solves a similar problem but returns tuples; I wanted to be able to return Ruby structs to benefit from named instance methods.
|
data/gemfiles/rails_4_1.gemfile
CHANGED
data/gemfiles/rails_4_2.gemfile
CHANGED
data/gemfiles/rails_5_0.gemfile
CHANGED
data/relation_to_struct.gemspec
CHANGED
@@ -26,6 +26,6 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_development_dependency "pry-byebug"
|
27
27
|
spec.add_development_dependency "pg"
|
28
28
|
|
29
|
-
spec.add_dependency "activerecord", ">= 4.1", "< 5.
|
30
|
-
spec.add_dependency "activesupport", ">= 4.1", "< 5.
|
29
|
+
spec.add_dependency "activerecord", ">= 4.1", "< 5.2"
|
30
|
+
spec.add_dependency "activesupport", ">= 4.1", "< 5.2"
|
31
31
|
end
|
@@ -4,7 +4,8 @@ ActiveRecord::Base.configurations = {
|
|
4
4
|
"host" => 'localhost',
|
5
5
|
"database" => 'relation_to_struct_tests',
|
6
6
|
"encoding" => 'utf8',
|
7
|
-
"username" =>
|
7
|
+
"username" => ENV["DATABASE_POSTGRESQL_USERNAME"] || `whoami`.strip,
|
8
|
+
"password" => ENV["DATABASE_POSTGRESQL_PASSWORD"],
|
8
9
|
},
|
9
10
|
"sqlite" => {
|
10
11
|
"adapter" => "sqlite3",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relation_to_struct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Coleman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: appraisal
|
@@ -117,7 +117,7 @@ dependencies:
|
|
117
117
|
version: '4.1'
|
118
118
|
- - "<"
|
119
119
|
- !ruby/object:Gem::Version
|
120
|
-
version: '5.
|
120
|
+
version: '5.2'
|
121
121
|
type: :runtime
|
122
122
|
prerelease: false
|
123
123
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -127,7 +127,7 @@ dependencies:
|
|
127
127
|
version: '4.1'
|
128
128
|
- - "<"
|
129
129
|
- !ruby/object:Gem::Version
|
130
|
-
version: '5.
|
130
|
+
version: '5.2'
|
131
131
|
- !ruby/object:Gem::Dependency
|
132
132
|
name: activesupport
|
133
133
|
requirement: !ruby/object:Gem::Requirement
|
@@ -137,7 +137,7 @@ dependencies:
|
|
137
137
|
version: '4.1'
|
138
138
|
- - "<"
|
139
139
|
- !ruby/object:Gem::Version
|
140
|
-
version: '5.
|
140
|
+
version: '5.2'
|
141
141
|
type: :runtime
|
142
142
|
prerelease: false
|
143
143
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -147,7 +147,7 @@ dependencies:
|
|
147
147
|
version: '4.1'
|
148
148
|
- - "<"
|
149
149
|
- !ruby/object:Gem::Version
|
150
|
-
version: '5.
|
150
|
+
version: '5.2'
|
151
151
|
description: ''
|
152
152
|
email:
|
153
153
|
- jtc331@gmail.com
|
@@ -165,6 +165,7 @@ files:
|
|
165
165
|
- gemfiles/rails_4_1.gemfile
|
166
166
|
- gemfiles/rails_4_2.gemfile
|
167
167
|
- gemfiles/rails_5_0.gemfile
|
168
|
+
- gemfiles/rails_5_1.gemfile
|
168
169
|
- lib/relation_to_struct.rb
|
169
170
|
- lib/relation_to_struct/active_record_base_extension.rb
|
170
171
|
- lib/relation_to_struct/active_record_relation_extension.rb
|