rooble 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -2
  3. data/lib/rooble/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b8584c96b7c4cee5648017142702d8651e82950b6b3b80b98280adb754f82ef
4
- data.tar.gz: 87c83e64ec2c56dc5e2fd5b69e0b590edb25bfcc5ac2a2c4518688e6db839965
3
+ metadata.gz: e683f6845e705f291401d02c4fd35f75a2d95e6ec16136d08da48f2139df5e80
4
+ data.tar.gz: e5062b8a337dda95aea3b3e83e3505170af431eadf792aeda70625ae32245679
5
5
  SHA512:
6
- metadata.gz: 3c1b12e7af88715295362eeb3604b1ef24f8e7094555c08a45f229faa7216d9495c774c07c7756de822b90c073311daf9ea629a20f3cda1466f6c2c67f253d88
7
- data.tar.gz: fc35839dc9590e582c23d98409c3747a83281c131d9f2502f2e0048eb7a6a3ac8bc1792bedb3b8eda5ba463ecc5a2029393b76bb66f20173749f80106d76528e
6
+ metadata.gz: c8bebea75a21a281536f243755a37e62573b23c318ae53ffb52a80f336cc5cffbf2fd6baf916a28bd45aa6934745f9b5709fd6e5a8394bae553e10cd70252432
7
+ data.tar.gz: ec614c44c7d1f0e0afc14527400b2e57d84a7fd76b498f0c401b27cce5745421e1fbad8377a430c28ab88c11d66421b85d4af25d176f9a866ca8ef3ae14dc7d6
data/README.md CHANGED
@@ -61,13 +61,14 @@ We can override the `max_records_per_page` as well on the first argument which i
61
61
  ```
62
62
 
63
63
  ``` ruby
64
- Model.paginate(page=1, max_records_per_page=nil)
64
+ Model.paginate(page=1, max_records_per_page=nil, order_by: {id: :asc})
65
65
  ```
66
66
 
67
67
  **Arguments:**
68
68
 
69
69
  - `page` the page to pull records from
70
70
  - `max_records_per_page` how many records to generate per page, this overrides the initializer option
71
+ - `order_by` how records will be ordered, defaults to the ID in Ascending order
71
72
 
72
73
  `Model.paginate` will pull records for the first page. The first argument is the page number and you can also override the `max_records_per_page` config option on the second argument so that you paginate a specific page with a different amount of max records, for instance:
73
74
 
@@ -93,13 +94,14 @@ Note that in the 3rd example we override the `max_records_per_page` so we will g
93
94
  The search method will lookup for keyword matches within columns or records that match a given id, this means that you can essentially use it only to search in text fields or in the primary key. So for instance if you try to search against numeric columns it won't work but for that type of specific search you are better off using ActiveRecord directly. The rational behind this is that most application _open_ searches will lookup for id's, names or codes, rarely against numeric values.
94
95
 
95
96
  ``` ruby
96
- Model.search(fields, search_term, options={})
97
+ Model.search(fields, search_term, options={}, order_by: {id: :asc})
97
98
  ```
98
99
 
99
100
  **Arguments:**
100
101
 
101
102
  - `fields` a string with a field name or string/symbol array with field names to make the query against
102
103
  - `search_term` string with the term to search
104
+ - `order_by` how records will be ordered, defaults to the ID in Ascending order
103
105
  - `options` a hash with a set of options. Please se below for more info.
104
106
 
105
107
  `Model.search("name", "John")` will look for records which have **John** within the `name` attribute.
@@ -1,3 +1,3 @@
1
1
  module Rooble
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rooble
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gustavo Rubio