sinja-sequel 0.1.2 → 0.1.3
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 +4 -4
- data/README.md +14 -7
- data/lib/sinja/sequel.rb +1 -1
- data/lib/sinja/sequel/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61b76939419efbaf8a1ebaa16422655c9203ed1e
|
4
|
+
data.tar.gz: 76743e74389a170a94220a776f066225779069b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efe50baa560a0f3c7759700049463e98bc3a2c03d0bc77991eaf161202471167324b0cef4a8d5cf2839176049f140e2f1a7619a7160b759bfbf3584d760724ee
|
7
|
+
data.tar.gz: 66ad713a871bb5ab0cd28413a62118f6fd256121090492d65ee994a630f70ac675e61c336d5bb4f11f10665ad57d654c5bb288d314005700c10780db939a81af
|
data/README.md
CHANGED
@@ -25,6 +25,7 @@ out. Testers and community contributions welcome!
|
|
25
25
|
|
26
26
|
|
27
27
|
- [Installation](#installation)
|
28
|
+
- [Best Practices](#best-practices)
|
28
29
|
- [Usage](#usage)
|
29
30
|
- [Core](#core)
|
30
31
|
- [Helpers](#helpers)
|
@@ -60,7 +61,7 @@ Or install it yourself as:
|
|
60
61
|
$ gem install sinja-sequel
|
61
62
|
```
|
62
63
|
|
63
|
-
##
|
64
|
+
## Best Practices
|
64
65
|
|
65
66
|
Always return Sequel datasets (instead of arrays of objects) from your `index`
|
66
67
|
(e.g. `Foo.dataset`) and `fetch` (e.g. `resource.bars_dataset`) action
|
@@ -98,10 +99,17 @@ information.
|
|
98
99
|
Finally, enable the `:pagination` extension on your connection (before
|
99
100
|
prepending Core) to enable pagination!
|
100
101
|
|
102
|
+
## Usage
|
103
|
+
|
104
|
+
Progressively opt-in to Sinja::Sequel's features by enabling (1) Core, (2)
|
105
|
+
Helpers and Core (the most common use-case), or (3) Extension, Helpers, and
|
106
|
+
Core. (Pagination is automatically enabled with Core, but may need to be
|
107
|
+
manually enabled under certain circumstances, detailed below).
|
108
|
+
|
101
109
|
### Core
|
102
110
|
|
103
|
-
Prepend [Sinja::Sequel::Core](/lib/sinja/sequel/core.rb)
|
104
|
-
|
111
|
+
Prepend [Sinja::Sequel::Core](/lib/sinja/sequel/core.rb) after registering
|
112
|
+
Sinja:
|
105
113
|
|
106
114
|
```ruby
|
107
115
|
require 'sinja'
|
@@ -125,7 +133,7 @@ a normal module of Sinatra helpers) in order to ensure that the included
|
|
125
133
|
methods take precedence over Sinja's method stubs (e.g. `transaction`).
|
126
134
|
[This][4] will hopefully be fixed in a future version of Sinatra.
|
127
135
|
|
128
|
-
Prepending Core
|
136
|
+
Prepending Core has the following effects on your application:
|
129
137
|
|
130
138
|
* Configures `conflict_`, `not_found_`, and `validation_exceptions`, and
|
131
139
|
`validation_formatter`.
|
@@ -174,8 +182,7 @@ class MyApp < Sinatra::Base
|
|
174
182
|
end
|
175
183
|
```
|
176
184
|
|
177
|
-
|
178
|
-
automatically prepend Core!**
|
185
|
+
**Note that including Helpers will automatically prepend Core!**
|
179
186
|
|
180
187
|
#### `next_pk`
|
181
188
|
|
@@ -294,7 +301,7 @@ Pretty neat, huh?
|
|
294
301
|
|
295
302
|
### Pagination
|
296
303
|
|
297
|
-
Sinja::Sequel
|
304
|
+
Sinja::Sequel inspects the first Sequel database to determine whether or not to
|
298
305
|
enable pagination. If (and only if!) you have _multiple_ databases in your
|
299
306
|
application and only _some_ support pagination, you _may_ need to prepend
|
300
307
|
[Sinja::Sequel::Pagination](/lib/sinja/sequel/pagination.rb) after prepending
|
data/lib/sinja/sequel.rb
CHANGED
data/lib/sinja/sequel/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinja-sequel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Pastore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sequel
|