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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9b6983191193091edf129496e971949a02941748
4
- data.tar.gz: 1f88be88d7d6366362543c054c2607cf4e8eb81d
3
+ metadata.gz: 61b76939419efbaf8a1ebaa16422655c9203ed1e
4
+ data.tar.gz: 76743e74389a170a94220a776f066225779069b0
5
5
  SHA512:
6
- metadata.gz: 64489f2281df7b119dbe0d2fc8d727dec44ff785bc9c45faa2d38b1176a165ddf36b84523ee4de18be14209376b2188209d828183660ba73e71c549dfbc64a2c
7
- data.tar.gz: 9965fd332e77a4823a822e70e9377a51af27c872bafb70aa3773c261edf60e417e2d5b78cad295cde981f93d3963fe0e8eccd47fb05c7f66386111d914332931
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
- ## Usage
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
- after registering Sinja:
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 does the following to your application:
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
- This is the most common use-case. **Note that including Helpers will
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 uses the first Sequel database to determine whether or not to
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
@@ -15,7 +15,7 @@ module Sinja
15
15
  register Resource
16
16
 
17
17
  helpers do
18
- def dataset
18
+ define_method(:dataset) do
19
19
  klass.dataset
20
20
  end
21
21
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Sinja
3
3
  module Sequel
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
  end
6
6
  end
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.2
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-18 00:00:00.000000000 Z
11
+ date: 2016-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel