bridgetown_sequel 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +10 -9
- data/lib/bridgetown_sequel/version.rb +1 -1
- data/lib/bridgetown_sequel.rb +4 -6
- 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: 70cd461dfd896b044b8d4da851ec6d46f77c6c2a3281972639c95b66304ce09e
|
4
|
+
data.tar.gz: a18800f8eb6f969449135505113f333282513ed9671f54a279ee8aa2446cf344
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec0c23201849152224130240238288681aadd94d92253874a2e78b1f0a37de7ac6fed484b11994cc963d1dc8454e7d75af49cd5657dc3a8bbaaa4045d3fe4407
|
7
|
+
data.tar.gz: 6018c48d4c697c7e54c8b9e7da5eedacde1e16b874e5b8100b4cac87d4c07742077c0eb861ca281dd7a301423f5f38a2f67a44eeb5bbe979a2e125cef151b554
|
data/CHANGELOG.md
CHANGED
@@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
9
9
|
|
10
10
|
- ...
|
11
11
|
|
12
|
+
## [1.1.0] - 2024-04-03
|
13
|
+
|
14
|
+
- Fix incorrect namespacing for loading tasks: `Bridgetown::Sequel` -> `BridgetownSequel`
|
15
|
+
|
12
16
|
## [1.0.0] - 2024-04-03
|
13
17
|
|
14
18
|
- First version of the Bridgetown Sequel gem.
|
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
|
|