relation_to_struct 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 38b9e2235461124930a00545c8f280a149e720e2
4
- data.tar.gz: e554b29f4b015da645780962aa44985d751ec177
3
+ metadata.gz: 13c9453de8bfec35a498a7819b901efe8d380c11
4
+ data.tar.gz: 54fe4e8053127c1dc35a17df5dd4e11933c299be
5
5
  SHA512:
6
- metadata.gz: 60d4d55c08833a5c9f875d06df49c307d192f5ea11985201222ecc42a8fdc5b638ca750dfd89767c8add0f5a5b33e4af47e3d4b1b80b032cf75983ffef1448de
7
- data.tar.gz: acb30ead089b288b26f417cd985f2da323e95fd996da0a0c3ceca85d83ff123836a6d4480cd6e406dead496e13e1d9992d2797d996a3099c78b8d7d43d13f9d0
6
+ metadata.gz: 9062091e453d07f865fcd1a5fb9441bf36ae3e6ff488939d66ffdfff43d6ad7892a087d074c6b07c0796f60b80b1dd49e407817810ac4d1720609db47f3601dd
7
+ data.tar.gz: de7d53e292cb15de12b73f11a461ace4b23cfd7ff35bc678bbca7eb719496c880c848d48082ba5ae0b25d6d98f693cf21737458bc6c3d5359e55bd5d13e5a093
data/.gitignore CHANGED
@@ -1,6 +1,7 @@
1
1
  /.bundle/
2
2
  /.yardoc
3
3
  /Gemfile.lock
4
+ /gemfiles/*gemfile.lock
4
5
  /_yardoc/
5
6
  /coverage/
6
7
  /doc/
data/Appraisals ADDED
@@ -0,0 +1,5 @@
1
+ %w(4.1 4.2).each do |version|
2
+ appraise "rails-#{version.gsub(/\./, "-")}" do
3
+ gem "rails", "~> #{version}.0"
4
+ end
5
+ end
data/README.md CHANGED
@@ -47,10 +47,21 @@ ActiveRecord::Base.structs_from_sql(UserPostsSummary, sql) # => array of structs
47
47
  ActiveRecord::Base.pluck_from_sql(sql) # => array of tuples
48
48
  ```
49
49
 
50
+ ```
51
+ sql = <<-eos
52
+ SELECT users.name
53
+ FROM users
54
+ LIMIT 1
55
+ eos
56
+
57
+ ActiveRecord::Base.value_from_sql(sql) # => single value
58
+ ```
59
+
50
60
  ## Contributing
51
61
 
52
62
  1. Fork it ( https://github.com/jcoleman/relation_to_struct/fork )
53
63
  2. Create your feature branch (`git checkout -b my-new-feature`)
54
- 3. Commit your changes (`git commit -am 'Add some feature'`)
55
- 4. Push to the branch (`git push origin my-new-feature`)
56
- 5. Create a new Pull Request
64
+ 3. Test your changes (`bundle install && appraisal install && rake`)
65
+ 4. Commit your changes (`git commit -am 'Add some feature'`)
66
+ 5. Push to the branch (`git push origin my-new-feature`)
67
+ 6. Create a new Pull Request
data/Rakefile CHANGED
@@ -1,7 +1,11 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
+ require "appraisal"
3
4
 
4
5
  RSpec::Core::RakeTask.new(:spec)
5
6
 
6
- task :default => :spec
7
-
7
+ if !ENV["APPRAISAL_INITIALIZED"] && !ENV["TRAVIS"]
8
+ task :default => [:appraisal, :spec]
9
+ else
10
+ task :default => :spec
11
+ end
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 4.1.0"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 4.2.0"
6
+
7
+ gemspec :path => "../"
@@ -28,6 +28,21 @@ module RelationToStruct::ActiveRecordBaseExtension
28
28
  result = connection.select_all(sanitize_sql(sql, nil), "Pluck SQL Load", binds)
29
29
  result.cast_values()
30
30
  end
31
+
32
+ def value_from_sql(sql, binds=[])
33
+ result = connection.select_all(sanitize_sql(sql, nil), "Value SQL Load", binds)
34
+ raise ArgumentError, 'Expected exactly one column to be selected' unless result.columns.size == 1
35
+
36
+ values = result.cast_values()
37
+ case values.size
38
+ when 0
39
+ nil
40
+ when 1
41
+ values[0]
42
+ else
43
+ raise ArgumentError, 'Expected only a single result to be returned'
44
+ end
45
+ end
31
46
  end
32
47
  end
33
48
 
@@ -2,7 +2,7 @@ module RelationToStruct::ActiveRecordRelationExtension
2
2
  extend ::ActiveSupport::Concern
3
3
 
4
4
  def to_structs(struct_class)
5
- raise '' unless self.select_values.present?
5
+ raise ArgumentError, 'Expected select_values to be present' unless self.select_values.present?
6
6
 
7
7
  relation = spawn
8
8
  result = klass.connection.select_all(relation.arel, nil, relation.arel.bind_values + bind_values)
@@ -0,0 +1,26 @@
1
+ module RelationToStruct::ActiveRecord41ResultExtension
2
+ extend ::ActiveSupport::Concern
3
+
4
+ included do
5
+ alias_method_chain :column_type, :ar_42_semantics
6
+ end
7
+
8
+ def cast_values(type_overrides = {}) # :nodoc:
9
+ types = columns.map { |name| column_type(name, type_overrides) }
10
+ result = rows.map do |values|
11
+ types.zip(values).map { |type, value| type.type_cast(value) }
12
+ end
13
+
14
+ columns.one? ? result.map!(&:first) : result
15
+ end
16
+
17
+ def column_type_with_ar_42_semantics(name, type_overrides = {})
18
+ type_overrides.fetch(name) do
19
+ column_types.fetch(name, ::ActiveRecord::Result::IDENTITY_TYPE)
20
+ end
21
+ end
22
+ end
23
+
24
+ if ActiveRecord.version < Gem::Version.new("4.2.0")
25
+ ::ActiveRecord::Result.send(:include, RelationToStruct::ActiveRecord41ResultExtension)
26
+ end
@@ -1,3 +1,3 @@
1
1
  module RelationToStruct
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -1,6 +1,7 @@
1
1
  require "relation_to_struct/version"
2
2
  require "relation_to_struct/active_record_base_extension"
3
3
  require "relation_to_struct/active_record_relation_extension"
4
+ require "relation_to_struct/active_record_result_41_extension"
4
5
 
5
6
  module RelationToStruct
6
7
  end
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
+ spec.add_development_dependency "appraisal", "~> 2.1"
21
22
  spec.add_development_dependency "bundler", "~> 1.7"
22
23
  spec.add_development_dependency "rake", "~> 10.0"
23
24
  spec.add_development_dependency "sqlite3", "~> 1.3"
@@ -25,6 +26,6 @@ Gem::Specification.new do |spec|
25
26
  spec.add_development_dependency "pry-byebug"
26
27
  spec.add_development_dependency "pg"
27
28
 
28
- spec.add_dependency "activerecord", "~> 4.0"
29
- spec.add_dependency "activesupport", "~> 4.0"
29
+ spec.add_dependency "activerecord", "~> 4.1"
30
+ spec.add_dependency "activesupport", "~> 4.1"
30
31
  end
@@ -1,76 +1,115 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe RelationToStruct do
3
+ describe ActiveRecord::Base do
4
4
  before(:each) do
5
5
  Economist.delete_all
6
6
  EconomicSchool.delete_all
7
7
  end
8
8
 
9
- it 'ActiveRecord::Base should respond to :structs_from_sql' do
10
- expect(ActiveRecord::Base.respond_to?(:structs_from_sql)).to eq(true)
11
- end
9
+ describe "#pluck_from_sql" do
10
+ it 'allows plucking with SQL directly' do
11
+ sql = "SELECT 1 * 23"
12
+ expect(ActiveRecord::Base.pluck_from_sql(sql)).to eq([23])
13
+ end
12
14
 
13
- it 'should allow querying with SQL directly' do
14
- test_struct = Struct.new(:number)
15
- sql = "SELECT 1 * 23 AS number"
16
- expect(ActiveRecord::Base.structs_from_sql(test_struct, sql)).to eq([test_struct.new(23)])
15
+ it 'allows plucking multiple columns with SQL directly' do
16
+ sql = "SELECT 1 * 23, 25"
17
+ expect(ActiveRecord::Base.pluck_from_sql(sql)).to eq([[23, 25]])
18
+ end
17
19
  end
18
20
 
19
- it 'should allow plucking with SQL directly' do
20
- sql = "SELECT 1 * 23"
21
- expect(ActiveRecord::Base.pluck_from_sql(sql)).to eq([23])
22
- end
21
+ describe "#value_from_sql" do
22
+ it 'allows selecting a value with SQL directly' do
23
+ sql = "SELECT 1 * 23"
24
+ expect(ActiveRecord::Base.value_from_sql(sql)).to eq(23)
25
+ end
23
26
 
24
- it 'should allow plucking multiple columns with SQL directly' do
25
- sql = "SELECT 1 * 23, 25"
26
- expect(ActiveRecord::Base.pluck_from_sql(sql)).to eq([[23, 25]])
27
- end
27
+ it 'raises an error when multiple columns are selected' do
28
+ expect do
29
+ sql = "SELECT * FROM (VALUES (1), (2)) t"
30
+ ActiveRecord::Base.value_from_sql(sql)
31
+ end.to raise_error(ArgumentError, 'Expected only a single result to be returned')
32
+ end
33
+
34
+ it 'raises an error when multiple columns are selected' do
35
+ expect do
36
+ sql = "SELECT 1, 2"
37
+ ActiveRecord::Base.value_from_sql(sql)
38
+ end.to raise_error(ArgumentError, 'Expected exactly one column to be selected')
39
+ end
28
40
 
29
- it 'structs_from_sql should properly cast a single array column' do
30
- Economist.create!(name: 'F.A. Hayek')
31
- Economist.create!(name: 'Ludwig von Mises')
41
+ it 'supports binds' do
42
+ sql = ["SELECT 1 * ?", 5]
43
+ expect(ActiveRecord::Base.value_from_sql(sql)).to eq(5)
44
+ end
32
45
 
33
- pluck_results = Economist.select('name').order('id').limit(1).pluck('array[name]') rescue nil
34
- if pluck_results
35
- expect(pluck_results).to eq([['F.A. Hayek']]) # Verify ActiveRecord interface.
46
+ it 'supports arrays' do
47
+ if active_record_supports_arrays?
48
+ Economist.create!(name: 'F.A. Hayek')
49
+ Economist.create!(name: 'Ludwig von Mises')
36
50
 
37
- test_struct = Struct.new(:names)
38
- structs_results = ActiveRecord::Base.structs_from_sql(test_struct, 'SELECT ARRAY_AGG(name ORDER BY id) AS names FROM economists')
39
- expect(structs_results.first.names).to eq(['F.A. Hayek', 'Ludwig von Mises'])
40
- else
41
- skip "DB selection doesn't support ARRAY[]"
51
+ result = ActiveRecord::Base.value_from_sql('SELECT ARRAY_AGG(name ORDER BY id) AS names FROM economists')
52
+ expect(result).to eq(['F.A. Hayek', 'Ludwig von Mises'])
53
+ else
54
+ skip "DB selection doesn't support ARRAY[]"
55
+ end
42
56
  end
43
57
  end
44
58
 
45
- it 'structs_from_sql should raise an error when column count does not match struct size' do
46
- expect do
47
- test_struct = Struct.new(:id, :name, :extra_field)
48
- ActiveRecord::Base.structs_from_sql(test_struct, 'SELECT id, name FROM economists')
49
- end.to raise_error(ArgumentError, 'Expected column names (and their order) to match struct attribute names')
50
- end
59
+ describe "#structs_from_sql" do
60
+ it 'ActiveRecord::Base should respond to :structs_from_sql' do
61
+ expect(ActiveRecord::Base.respond_to?(:structs_from_sql)).to eq(true)
62
+ end
51
63
 
52
- it 'structs_from_sql should raise an error when column names are not unique' do
53
- expect do
54
- test_struct = Struct.new(:id, :id2)
55
- ActiveRecord::Base.structs_from_sql(test_struct, 'SELECT id, id FROM economists')
56
- end.to raise_error(ArgumentError, 'Expected column names to be unique')
57
- end
64
+ it 'allows querying with SQL directly' do
65
+ test_struct = Struct.new(:number)
66
+ sql = "SELECT 1 * 23 AS number"
67
+ expect(ActiveRecord::Base.structs_from_sql(test_struct, sql)).to eq([test_struct.new(23)])
68
+ end
69
+
70
+ it 'properly casts a single array column' do
71
+ if active_record_supports_arrays?
72
+ Economist.create!(name: 'F.A. Hayek')
73
+ Economist.create!(name: 'Ludwig von Mises')
74
+
75
+ test_struct = Struct.new(:names)
76
+ structs_results = ActiveRecord::Base.structs_from_sql(test_struct, 'SELECT ARRAY_AGG(name ORDER BY id) AS names FROM economists')
77
+ expect(structs_results.first.names).to eq(['F.A. Hayek', 'Ludwig von Mises'])
78
+ else
79
+ skip "DB selection doesn't support ARRAY[]"
80
+ end
81
+ end
82
+
83
+ it 'raises an error when column count does not match struct size' do
84
+ expect do
85
+ test_struct = Struct.new(:id, :name, :extra_field)
86
+ ActiveRecord::Base.structs_from_sql(test_struct, 'SELECT id, name FROM economists')
87
+ end.to raise_error(ArgumentError, 'Expected column names (and their order) to match struct attribute names')
88
+ end
89
+
90
+ it 'raises an error when column names are not unique' do
91
+ expect do
92
+ test_struct = Struct.new(:id, :id2)
93
+ ActiveRecord::Base.structs_from_sql(test_struct, 'SELECT id, id FROM economists')
94
+ end.to raise_error(ArgumentError, 'Expected column names to be unique')
95
+ end
58
96
 
59
- it 'structs_from_sql should raise an error when the column names do not match the struct attribute names' do
60
- Economist.create!(name: 'F.A. Hayek')
61
- expect do
62
- test_struct = Struct.new(:value_a, :value_b)
63
- ActiveRecord::Base.structs_from_sql(test_struct, 'SELECT 1 AS value_a, 2 AS value_b FROM economists')
64
- end.not_to raise_error
65
-
66
- expect do
67
- test_struct = Struct.new(:value_a, :value_b)
68
- ActiveRecord::Base.structs_from_sql(test_struct, 'SELECT 1 AS value_b, 2 AS value_a FROM economists')
69
- end.to raise_error(ArgumentError, 'Expected column names (and their order) to match struct attribute names')
70
-
71
- expect do
72
- test_struct = Struct.new(:value_a, :value_b)
73
- ActiveRecord::Base.structs_from_sql(test_struct, 'SELECT 1 AS value_a, 2 AS value_c FROM economists')
74
- end.to raise_error(ArgumentError, 'Expected column names (and their order) to match struct attribute names')
97
+ it 'raises an error when the column names do not match the struct attribute names' do
98
+ Economist.create!(name: 'F.A. Hayek')
99
+ expect do
100
+ test_struct = Struct.new(:value_a, :value_b)
101
+ ActiveRecord::Base.structs_from_sql(test_struct, 'SELECT 1 AS value_a, 2 AS value_b FROM economists')
102
+ end.not_to raise_error
103
+
104
+ expect do
105
+ test_struct = Struct.new(:value_a, :value_b)
106
+ ActiveRecord::Base.structs_from_sql(test_struct, 'SELECT 1 AS value_b, 2 AS value_a FROM economists')
107
+ end.to raise_error(ArgumentError, 'Expected column names (and their order) to match struct attribute names')
108
+
109
+ expect do
110
+ test_struct = Struct.new(:value_a, :value_b)
111
+ ActiveRecord::Base.structs_from_sql(test_struct, 'SELECT 1 AS value_a, 2 AS value_c FROM economists')
112
+ end.to raise_error(ArgumentError, 'Expected column names (and their order) to match struct attribute names')
113
+ end
75
114
  end
76
115
  end
@@ -1,82 +1,81 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe RelationToStruct do
3
+ describe ActiveRecord::Relation do
4
4
  before(:each) do
5
5
  Economist.delete_all
6
6
  EconomicSchool.delete_all
7
7
  end
8
8
 
9
- it 'should respond to :to_structs' do
10
- expect(Economist.all.respond_to?(:to_structs)).to eq(true)
11
- end
12
-
13
- it '#to_structs should raise an error when the relation has no select_values' do
14
- expect do
15
- Economist.all.to_structs(Struct.new(:test_struct))
16
- end.to raise_error
17
- end
9
+ describe "#to_structs" do
10
+ it 'responds to :to_structs' do
11
+ expect(Economist.all.respond_to?(:to_structs)).to eq(true)
12
+ end
18
13
 
19
- it '#to_structs should return an empty array when no results are returned' do
20
- expect(Economist.where('1 = 0').select(:id).to_structs(Struct.new(:test_struct))).to eq([])
21
- end
14
+ it 'raises an error when the relation has no select_values' do
15
+ expect do
16
+ Economist.all.to_structs(Struct.new(:test_struct))
17
+ end.to raise_error(ArgumentError, 'Expected select_values to be present')
18
+ end
22
19
 
23
- it '#to_structs should return an array with struct instances' do
24
- hayek = Economist.create!(name: 'F.A. Hayek')
25
- id_struct = Struct.new(:id)
26
- expect(Economist.all.select(:id).to_structs(id_struct)).to eq([id_struct.new(hayek.id)])
27
- end
20
+ it 'returns an empty array when no results are returned' do
21
+ expect(Economist.where('1 = 0').select(:id).to_structs(Struct.new(:test_struct))).to eq([])
22
+ end
28
23
 
29
- it '#to_structs should handle joined elements properly' do
30
- austrian = EconomicSchool.create!(name: 'Austrian Economics')
31
- hayek = Economist.create!(name: 'F.A. Hayek', economic_school: austrian)
32
- test_struct = Struct.new(:name, :school)
33
- expect(
34
- Economist
35
- .joins(:economic_school)
36
- .select('economists.name', 'economic_schools.name as school_name')
37
- .to_structs(test_struct)
38
- ).to eq([test_struct.new(hayek.name, austrian.name)])
39
- end
24
+ it 'returns an array with struct instances' do
25
+ hayek = Economist.create!(name: 'F.A. Hayek')
26
+ id_struct = Struct.new(:id)
27
+ expect(Economist.all.select(:id).to_structs(id_struct)).to eq([id_struct.new(hayek.id)])
28
+ end
40
29
 
41
- it '#to_structs should properly cast values from arbitrary calculated columns' do
42
- hayek = Economist.create!(name: 'F.A. Hayek')
43
- scope = Economist.all
44
- pluck_results = scope.pluck("date('now')")
45
- pluck_column_klass = pluck_results.first.class
30
+ it 'handles joined elements properly' do
31
+ austrian = EconomicSchool.create!(name: 'Austrian Economics')
32
+ hayek = Economist.create!(name: 'F.A. Hayek', economic_school: austrian)
33
+ test_struct = Struct.new(:name, :school)
34
+ expect(
35
+ Economist
36
+ .joins(:economic_school)
37
+ .select('economists.name', 'economic_schools.name as school_name')
38
+ .to_structs(test_struct)
39
+ ).to eq([test_struct.new(hayek.name, austrian.name)])
40
+ end
46
41
 
47
- date_struct = Struct.new(:date)
48
- struct_scope = scope.select("date('now')")
49
- structs_results = struct_scope.to_structs(date_struct)
50
- struct_column_klass = structs_results.first.date.class
51
- expect(pluck_column_klass).to eq(struct_column_klass)
52
- end
42
+ it 'properly casts values from arbitrary calculated columns' do
43
+ hayek = Economist.create!(name: 'F.A. Hayek')
44
+ scope = Economist.all
45
+ pluck_results = scope.pluck("date('now')")
46
+ pluck_column_klass = pluck_results.first.class
53
47
 
54
- it '#to_structs should properly cast a single array column' do
55
- Economist.create!(name: 'F.A. Hayek')
48
+ date_struct = Struct.new(:date)
49
+ struct_scope = scope.select("date('now')")
50
+ structs_results = struct_scope.to_structs(date_struct)
51
+ struct_column_klass = structs_results.first.date.class
52
+ expect(pluck_column_klass).to eq(struct_column_klass)
53
+ end
56
54
 
57
- pluck_results = Economist.select('name').pluck('array[name]') rescue nil
58
- if pluck_results
59
- expect(pluck_results).to eq([['F.A. Hayek']]) # Verify ActiveRecord interface.
55
+ it 'properly casts a single array column' do
56
+ Economist.create!(name: 'F.A. Hayek')
60
57
 
61
- test_struct = Struct.new(:names)
62
- structs_results = Economist.select('array[name]').to_structs(test_struct)
63
- expect(structs_results.first.names).to eq(['F.A. Hayek'])
64
- else
65
- skip "DB selection doesn't support ARRAY[]"
58
+ if active_record_supports_arrays?
59
+ test_struct = Struct.new(:names)
60
+ structs_results = Economist.select('array[name]').to_structs(test_struct)
61
+ expect(structs_results.first.names).to eq(['F.A. Hayek'])
62
+ else
63
+ skip "DB selection doesn't support ARRAY[]"
64
+ end
66
65
  end
67
- end
68
66
 
69
- it '#to_structs should raise an error when column count does not match struct size' do
70
- expect do
71
- test_struct = Struct.new(:id, :name, :extra_field)
72
- Economist.select('id, name').to_structs(test_struct)
73
- end.to raise_error(ArgumentError, 'Expected struct fields and columns lengths to be equal')
74
- end
67
+ it 'raises an error when column count does not match struct size' do
68
+ expect do
69
+ test_struct = Struct.new(:id, :name, :extra_field)
70
+ Economist.select('id, name').to_structs(test_struct)
71
+ end.to raise_error(ArgumentError, 'Expected struct fields and columns lengths to be equal')
72
+ end
75
73
 
76
- it '#to_structs should raise an error when column names are not unique' do
77
- expect do
78
- test_struct = Struct.new(:id, :id2)
79
- Economist.select('id, id').to_structs(test_struct)
80
- end.to raise_error(ArgumentError, 'Expected column names to be unique')
74
+ it 'raises an error when column names are not unique' do
75
+ expect do
76
+ test_struct = Struct.new(:id, :id2)
77
+ Economist.select('id, id').to_structs(test_struct)
78
+ end.to raise_error(ArgumentError, 'Expected column names to be unique')
79
+ end
81
80
  end
82
81
  end
data/spec/spec_helper.rb CHANGED
@@ -4,3 +4,24 @@ require 'active_support'
4
4
  require 'relation_to_struct'
5
5
  require 'active_record_helper/setup'
6
6
  require 'pry-byebug'
7
+
8
+ def active_record_supports_arrays?
9
+ if defined?(@active_record_supports_arrays)
10
+ @active_record_supports_arrays
11
+ else
12
+ supports_arrays = false
13
+ ActiveRecord::Base.transaction do
14
+ Economist.create!(name: 'F.A. Hayek')
15
+ Economist.create!(name: 'Ludwig von Mises')
16
+
17
+ pluck_results = Economist.select('name').order('id').limit(1).pluck('array[name]') rescue nil
18
+ if pluck_results
19
+ raise StandardError, "Unexpected array query results" unless pluck_results == [['F.A. Hayek']] # Verify ActiveRecord interface.
20
+ supports_arrays = true
21
+ end
22
+
23
+ raise ActiveRecord::Rollback
24
+ end
25
+ @active_record_supports_arrays = supports_arrays
26
+ end
27
+ end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relation_to_struct
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Coleman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-15 00:00:00.000000000 Z
11
+ date: 2016-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: appraisal
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.1'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.1'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -100,28 +114,28 @@ dependencies:
100
114
  requirements:
101
115
  - - "~>"
102
116
  - !ruby/object:Gem::Version
103
- version: '4.0'
117
+ version: '4.1'
104
118
  type: :runtime
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
107
121
  requirements:
108
122
  - - "~>"
109
123
  - !ruby/object:Gem::Version
110
- version: '4.0'
124
+ version: '4.1'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: activesupport
113
127
  requirement: !ruby/object:Gem::Requirement
114
128
  requirements:
115
129
  - - "~>"
116
130
  - !ruby/object:Gem::Version
117
- version: '4.0'
131
+ version: '4.1'
118
132
  type: :runtime
119
133
  prerelease: false
120
134
  version_requirements: !ruby/object:Gem::Requirement
121
135
  requirements:
122
136
  - - "~>"
123
137
  - !ruby/object:Gem::Version
124
- version: '4.0'
138
+ version: '4.1'
125
139
  description: ''
126
140
  email:
127
141
  - jtc331@gmail.com
@@ -131,13 +145,17 @@ extra_rdoc_files: []
131
145
  files:
132
146
  - ".gitignore"
133
147
  - ".rspec"
148
+ - Appraisals
134
149
  - Gemfile
135
150
  - LICENSE.txt
136
151
  - README.md
137
152
  - Rakefile
153
+ - gemfiles/rails_4_1.gemfile
154
+ - gemfiles/rails_4_2.gemfile
138
155
  - lib/relation_to_struct.rb
139
156
  - lib/relation_to_struct/active_record_base_extension.rb
140
157
  - lib/relation_to_struct/active_record_relation_extension.rb
158
+ - lib/relation_to_struct/active_record_result_41_extension.rb
141
159
  - lib/relation_to_struct/version.rb
142
160
  - relation_to_struct.gemspec
143
161
  - spec/active_record_base_spec.rb