bridgetown_sequel 1.0.0 → 1.1.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 +4 -4
- data/CHANGELOG.md +7 -1
- data/README.md +10 -9
- data/lib/bridgetown_sequel/version.rb +1 -1
- data/lib/bridgetown_sequel.rb +5 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a51b222272301ffe21bf60c4df11cc34d7b18116290d81fc2cb6e280b541a13
|
4
|
+
data.tar.gz: 8cd7b635fe90fafce9f88e55d1d6ea7ecd08d5aae157b2f8a6f75cd25ce486c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8295e0430b6fde6c4990faa7f70b16420d1a8adc4790ceb8c4b7e1653d7cb9c90c074ca14fc6c0720d59c047b7d531dd8728f4c3913aac893b5d21c190582888
|
7
|
+
data.tar.gz: 9a05d4c484a77b44dbd85d7f62bf1f35411948913e2996888d68a8090bcb0dfc90ca57e6647a757b273be70677fdb51aa82ab58715c93a159fec8adf8524b27e
|
data/CHANGELOG.md
CHANGED
@@ -7,7 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
-
-
|
10
|
+
## [1.1.1] - 2024-04-03
|
11
|
+
|
12
|
+
- Fix lambda error in initializer
|
13
|
+
|
14
|
+
## [1.1.0] - 2024-04-03
|
15
|
+
|
16
|
+
- Fix incorrect namespacing for loading tasks: `Bridgetown::Sequel` -> `BridgetownSequel`
|
11
17
|
|
12
18
|
## [1.0.0] - 2024-04-03
|
13
19
|
|
data/README.md
CHANGED
@@ -6,9 +6,10 @@ It's been tested only with PostgreSQL, but it should support any of the database
|
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
|
-
Run
|
9
|
+
Run these commands to add this plugin along with the database adapter of your choice to your site's Gemfile:
|
10
10
|
|
11
11
|
```shell
|
12
|
+
bundle add pg # or sqlite3, etc.
|
12
13
|
bundle add bridgetown_sequel
|
13
14
|
```
|
14
15
|
|
@@ -30,7 +31,7 @@ Bridgetown.load_tasks
|
|
30
31
|
|
31
32
|
# Now add this:
|
32
33
|
require "bridgetown_sequel"
|
33
|
-
|
34
|
+
BridgetownSequel.load_tasks
|
34
35
|
```
|
35
36
|
|
36
37
|
Finally, you'll want to create a `models` folder at the top-level of your site repo, as well as a `migrations` folder.
|
@@ -50,7 +51,7 @@ end
|
|
50
51
|
Next, you'll want to create a migration. Run the following command:
|
51
52
|
|
52
53
|
```shell
|
53
|
-
bin/bridgetown db::migrations:new
|
54
|
+
bin/bridgetown db::migrations:new filename=create_projects
|
54
55
|
```
|
55
56
|
|
56
57
|
And modify the new `migrations/001_create_projects.rb` file to look something like this:
|
@@ -129,12 +130,7 @@ Raw SQL statements won't be logged out-of-the-box, but you can attach Bridgetown
|
|
129
130
|
Bridgetown.db.loggers << Bridgetown.logger
|
130
131
|
```
|
131
132
|
|
132
|
-
For a quick reference on what you can do with the Sequel DSL, check out this [handy cheat sheet](https://
|
133
|
-
|
134
|
-
## Testing
|
135
|
-
|
136
|
-
* Run `bundle exec rake test` to run the test suite
|
137
|
-
* Or run `script/cibuild` to validate with Rubocop and Minitest together.
|
133
|
+
For a quick reference on what you can do with the Sequel DSL, check out this [handy cheat sheet](https://devhints.io/sequel).
|
138
134
|
|
139
135
|
## Contributing
|
140
136
|
|
@@ -144,3 +140,8 @@ For a quick reference on what you can do with the Sequel DSL, check out this [ha
|
|
144
140
|
4. Commit your changes (`git commit -am 'Add some feature'`)
|
145
141
|
5. Push to the branch (`git push origin my-new-feature`)
|
146
142
|
6. Create a new Pull Request
|
143
|
+
|
144
|
+
## Testing
|
145
|
+
|
146
|
+
* Run `bundle exec rake test` to run the test suite
|
147
|
+
* Or run `script/cibuild` to validate with Rubocop and Minitest together.
|
data/lib/bridgetown_sequel.rb
CHANGED
@@ -6,12 +6,10 @@ require "bridgetown"
|
|
6
6
|
# See: https://stackoverflow.com/questions/52671926/rails-may-have-been-in-progress-in-another-thread-when-fork-was-called
|
7
7
|
require "sequel"
|
8
8
|
|
9
|
-
module
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
load File.expand_path("tasks/sequel_database.rake", __dir__)
|
14
|
-
end
|
9
|
+
module BridgetownSequel
|
10
|
+
def self.load_tasks(models_dir: "models")
|
11
|
+
ENV["BRIDGETOWN_SEQUEL_MODELS_DIR"] ||= models_dir
|
12
|
+
load File.expand_path("tasks/sequel_database.rake", __dir__)
|
15
13
|
end
|
16
14
|
end
|
17
15
|
|
@@ -19,7 +17,7 @@ Bridgetown.initializer :bridgetown_sequel do |
|
|
19
17
|
config,
|
20
18
|
models_dir: ENV.fetch("BRIDGETOWN_SEQUEL_MODELS_DIR", "models"),
|
21
19
|
skip_autoload: false,
|
22
|
-
model_setup: -> {},
|
20
|
+
model_setup: ->(model) {},
|
23
21
|
connection_options: {}
|
24
22
|
|
|
25
23
|
unless skip_autoload
|