occams-record 0.4.0 → 0.4.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 626b915405cadac96171e3283e1f05172ff5a272
4
- data.tar.gz: bb347409b11e0c9602520a2444b56bb751c1f0e8
3
+ metadata.gz: 1e3dd68bf71573d7c7d69b5ec5ac6bc9fcee04a3
4
+ data.tar.gz: a8fffb0ad9a3d03d725753f260ffe168f8290624
5
5
  SHA512:
6
- metadata.gz: 480de46340d39119a7e2b9b2734db2ac204d938e4313eef0b50d3ea39fb575683c84c78455a4f9492891f36074acdf611d634702f3d1d353df1722e60f75ed11
7
- data.tar.gz: 5ddc0ad13f4d214e921341e88428e2e40bfac204f6e377343110ac7ca875ac668722361261f7d35cc9cfa2f3fb70465082725db118c02467086d339727210b08
6
+ metadata.gz: 5358439480d4ad1cdd15635610b79bc389e1ca3cb32dd07292f54295bfa040e1c6e6f4f668f838e166ff3cf1396f0ff35096952df77aa4eaa999875083a812c8
7
+ data.tar.gz: 3d6396a193b98e4adc84c2e231329b02e1e02d479e65d7c46145375b99ba95f0aa0eca77feb3c16680325da08e2cd1c8c5e9bb350497428fb342fbe8ac77059e
data/README.md CHANGED
@@ -12,7 +12,7 @@ For those stuck with ActiveRecord, OccamsRecord seeks to solve these issues by m
12
12
  **What does this buy you?**
13
13
 
14
14
  * OccamsRecord results are **one-third the size** of ActiveRecord results.
15
- * OccamsRecord queries run **three times faster** than ActiveRecord queries, or more.
15
+ * OccamsRecord queries run **three to five times faster** than ActiveRecord queries.
16
16
  * When you're eager loading associations you may specify which columns to `SELECT`. (This can be a significant performance boost to both your database and Rails app, on top of the above numbers.)
17
17
 
18
18
  **What don't you give up?**
@@ -42,7 +42,8 @@ module OccamsRecord
42
42
  # Merge associations of type N into rows of model N.
43
43
  #
44
44
  def merge!(assoc_rows_of_type, rows)
45
- type = assoc_rows_of_type[0].class.try!(:model_name) || return
45
+ return if assoc_rows_of_type.empty?
46
+ type = assoc_rows_of_type[0].class.model_name
46
47
  rows_of_type = rows.select { |r| r.send(@foreign_type) == type }
47
48
  merge_model!(assoc_rows_of_type, rows_of_type, type.constantize)
48
49
  end
@@ -3,5 +3,5 @@
3
3
  #
4
4
  module OccamsRecord
5
5
  # Library version
6
- VERSION = '0.4.0'.freeze
6
+ VERSION = '0.4.1'.freeze
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: occams-record
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Hollinger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-29 00:00:00.000000000 Z
11
+ date: 2017-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord