occams-record 0.13.1 → 0.14.0

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
  SHA256:
3
- metadata.gz: dc337740ceaeaa0d79d2dd6c814ed3a6e41dcec152b550cd81219651d962225c
4
- data.tar.gz: 867b4ebdca2da0415d71e15708c918db2b8beea287441ef29865049612849e6b
3
+ metadata.gz: c38ef4286e850f0409ef60595a18e28dfce74f9b43b60fa776d782f899e800c9
4
+ data.tar.gz: 4960fa6e619bbc4e20dbaf94fb5d557ddd5f8ed50443b4ad5f5716fb4da1a383
5
5
  SHA512:
6
- metadata.gz: 71d0e5f03913c328e0f805519f4040d6049ed01db0471c857d0758f15e47792508d7faf05883772c57642485c624f5b843447ea46651ba3ca5157ec618d3df8a
7
- data.tar.gz: 1b3ffd2816691fb5fc5258ccfa69f22bf08b3d92403c222bc76a75db51f692f78eb902114b6e55fb8ad191e4db626276dd801fa41fd4ea496169195450eeecc6
6
+ metadata.gz: d7f32e7259a88470318e0aac8e89d62c993d443c4ff379392cc7eb731f7649c5cb958994e25be2f23386e0ee0b73d05fc07998a71be6faf7f224c3231560010f
7
+ data.tar.gz: 9ced85fba2d01430725e33d97984775b7a2a59f14a0fa11b03965302a528cd99a138fa913e4d0ec2b58f7fd9356bfffe79359b3a2ed3a25fa9a99bcff040ee7c
data/README.md CHANGED
@@ -159,12 +159,13 @@ widgets = OccamsRecord.
159
159
 
160
160
  **Using find_each/find_in_batches with raw SQL**
161
161
 
162
- To use `find_each` or `find_in_batches` with raw SQL you must provide the `LIMIT` and `OFFSET` statements yourself. The bind values for these will be filled in by OccamsRecord.
162
+ To use `find_each` or `find_in_batches` with raw SQL you must provide the `LIMIT` and `OFFSET` clauses yourself. The bind values for these will be filled in by OccamsRecord. Remember to always specific a consitent `ORDER BY` clause.
163
163
 
164
164
  ```ruby
165
165
  widgets = OccamsRecord.sql(%(
166
166
  SELECT * FROM widgets
167
167
  WHERE category_id = %{cat_id}
168
+ ORDER BY name, id
168
169
  LIMIT %{batch_limit}
169
170
  OFFSET %{batch_offset}
170
171
  ), {
@@ -20,7 +20,7 @@ module OccamsRecord
20
20
  #
21
21
  def self.klass(column_names, column_types, association_names = [], model: nil, modules: nil)
22
22
  Class.new(Results::Row) do
23
- Array(modules).each { |mod| include mod } if modules
23
+ Array(modules).each { |mod| prepend mod } if modules
24
24
 
25
25
  self.columns = column_names.map(&:to_s)
26
26
  self.associations = association_names.map(&:to_s)
@@ -3,5 +3,5 @@
3
3
  #
4
4
  module OccamsRecord
5
5
  # Library version
6
- VERSION = '0.13.1'.freeze
6
+ VERSION = '0.14.0'.freeze
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: occams-record
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.1
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Hollinger