-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from zilverline/update-building-a-web-application
Update example blog application from guides
- Loading branch information
Showing
27 changed files
with
253 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.2.2 | ||
3.3.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,112 +1,131 @@ | ||
GIT | ||
remote: https://github.com/zilverline/sequent.git | ||
revision: 498812fb86edd319310be5b6ea2d53719e81cf14 | ||
specs: | ||
sequent (7.0.1) | ||
activemodel (>= 5.0, < 7.2) | ||
activerecord (>= 5.0, < 7.2) | ||
bcrypt (~> 3.1) | ||
i18n | ||
oj (~> 3) | ||
parallel (~> 1.20) | ||
parser (>= 2.6.5, < 3.3) | ||
pg (~> 1.2) | ||
postgresql_cursor (~> 0.6) | ||
thread_safe (~> 0.3.6) | ||
tzinfo (~> 2.0) | ||
|
||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
activemodel (7.0.8) | ||
activesupport (= 7.0.8) | ||
activerecord (7.0.8) | ||
activemodel (= 7.0.8) | ||
activesupport (= 7.0.8) | ||
activesupport (7.0.8) | ||
concurrent-ruby (~> 1.0, >= 1.0.2) | ||
activemodel (7.2.1.1) | ||
activesupport (= 7.2.1.1) | ||
activerecord (7.2.1.1) | ||
activemodel (= 7.2.1.1) | ||
activesupport (= 7.2.1.1) | ||
timeout (>= 0.4.0) | ||
activesupport (7.2.1.1) | ||
base64 | ||
bigdecimal | ||
concurrent-ruby (~> 1.0, >= 1.3.1) | ||
connection_pool (>= 2.2.5) | ||
drb | ||
i18n (>= 1.6, < 2) | ||
logger (>= 1.4.2) | ||
minitest (>= 5.1) | ||
tzinfo (~> 2.0) | ||
securerandom (>= 0.3) | ||
tzinfo (~> 2.0, >= 2.0.5) | ||
ast (2.4.2) | ||
bcrypt (3.1.19) | ||
concurrent-ruby (1.2.2) | ||
database_cleaner (2.0.1) | ||
database_cleaner-active_record (~> 2.0.0) | ||
database_cleaner-active_record (2.0.1) | ||
base64 (0.2.0) | ||
bcrypt (3.1.20) | ||
bigdecimal (3.1.8) | ||
concurrent-ruby (1.3.4) | ||
connection_pool (2.4.1) | ||
database_cleaner (2.0.2) | ||
database_cleaner-active_record (>= 2, < 3) | ||
database_cleaner-active_record (2.2.0) | ||
activerecord (>= 5.a) | ||
database_cleaner-core (~> 2.0.0) | ||
database_cleaner-core (2.0.1) | ||
diff-lcs (1.5.0) | ||
i18n (1.14.1) | ||
diff-lcs (1.5.1) | ||
drb (2.2.1) | ||
i18n (1.14.6) | ||
concurrent-ruby (~> 1.0) | ||
minitest (5.20.0) | ||
logger (1.6.1) | ||
minitest (5.25.1) | ||
multi_json (1.15.0) | ||
mustermann (3.0.0) | ||
mustermann (3.0.3) | ||
ruby2_keywords (~> 0.0.1) | ||
oj (3.16.1) | ||
parallel (1.23.0) | ||
parser (3.2.2.4) | ||
oj (3.16.6) | ||
bigdecimal (>= 3.0) | ||
ostruct (>= 0.2) | ||
ostruct (0.6.0) | ||
parallel (1.26.3) | ||
parser (3.3.5.0) | ||
ast (~> 2.4.1) | ||
racc | ||
pg (1.5.4) | ||
postgresql_cursor (0.6.8) | ||
pg (1.5.8) | ||
postgresql_cursor (0.6.9) | ||
activerecord (>= 6.0) | ||
racc (1.7.3) | ||
rack (2.2.8.1) | ||
rack-protection (3.0.4) | ||
rack | ||
rake (13.0.6) | ||
rspec (3.11.0) | ||
rspec-core (~> 3.11.0) | ||
rspec-expectations (~> 3.11.0) | ||
rspec-mocks (~> 3.11.0) | ||
rspec-core (3.11.0) | ||
rspec-support (~> 3.11.0) | ||
rspec-expectations (3.11.1) | ||
racc (1.8.1) | ||
rack (3.1.7) | ||
rack-protection (4.0.0) | ||
base64 (>= 0.1.0) | ||
rack (>= 3.0.0, < 4) | ||
rack-session (2.0.0) | ||
rack (>= 3.0.0) | ||
rackup (2.1.0) | ||
rack (>= 3) | ||
webrick (~> 1.8) | ||
rake (13.2.1) | ||
rspec (3.13.0) | ||
rspec-core (~> 3.13.0) | ||
rspec-expectations (~> 3.13.0) | ||
rspec-mocks (~> 3.13.0) | ||
rspec-core (3.13.1) | ||
rspec-support (~> 3.13.0) | ||
rspec-expectations (3.13.3) | ||
diff-lcs (>= 1.2.0, < 2.0) | ||
rspec-support (~> 3.11.0) | ||
rspec-mocks (3.11.1) | ||
rspec-support (~> 3.13.0) | ||
rspec-mocks (3.13.2) | ||
diff-lcs (>= 1.2.0, < 2.0) | ||
rspec-support (~> 3.11.0) | ||
rspec-support (3.11.1) | ||
rspec-support (~> 3.13.0) | ||
rspec-support (3.13.1) | ||
ruby2_keywords (0.0.5) | ||
sinatra (3.0.4) | ||
securerandom (0.3.1) | ||
sequent (7.1.1) | ||
activemodel (>= 6.0) | ||
activerecord (>= 6.0) | ||
bcrypt (~> 3.1) | ||
i18n | ||
oj (~> 3) | ||
parallel (~> 1.20) | ||
parser (>= 2.6.5, < 3.4) | ||
pg (~> 1.2) | ||
postgresql_cursor (~> 0.6) | ||
thread_safe (~> 0.3.6) | ||
tzinfo (>= 1.1) | ||
sinatra (4.0.0) | ||
mustermann (~> 3.0) | ||
rack (~> 2.2, >= 2.2.4) | ||
rack-protection (= 3.0.4) | ||
rack (>= 3.0.0, < 4) | ||
rack-protection (= 4.0.0) | ||
rack-session (>= 2.0.0, < 3) | ||
tilt (~> 2.0) | ||
sinatra-contrib (3.0.4) | ||
multi_json | ||
sinatra-contrib (4.0.0) | ||
multi_json (>= 0.0.2) | ||
mustermann (~> 3.0) | ||
rack-protection (= 3.0.4) | ||
sinatra (= 3.0.4) | ||
rack-protection (= 4.0.0) | ||
sinatra (= 4.0.0) | ||
tilt (~> 2.0) | ||
sinatra-flash (0.3.0) | ||
sinatra (>= 1.0.0) | ||
thread_safe (0.3.6) | ||
tilt (2.2.0) | ||
tilt (2.4.0) | ||
timeout (0.4.1) | ||
tzinfo (2.0.6) | ||
concurrent-ruby (~> 1.0) | ||
webrick (1.8.2) | ||
|
||
PLATFORMS | ||
ruby | ||
arm64-darwin-23 | ||
x86_64-linux | ||
|
||
DEPENDENCIES | ||
activemodel | ||
activerecord | ||
database_cleaner | ||
rackup | ||
rake | ||
rspec | ||
sequent! | ||
sequent | ||
sinatra | ||
sinatra-contrib | ||
sinatra-flash | ||
webrick | ||
|
||
RUBY VERSION | ||
ruby 3.2.2p53 | ||
ruby 3.3.5p100 | ||
|
||
BUNDLED WITH | ||
2.1.4 | ||
2.5.21 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,9 @@ | ||
require 'sequent' | ||
|
||
class Database | ||
class << self | ||
# def database_config(env = ENV['RACK_ENV']) | ||
# @config ||= YAML.safe_load(ERB.new(File.read('db/database.yml')).result, aliases: true)[env] | ||
# end | ||
|
||
def establish_connection(env = ENV['RACK_ENV']) | ||
def establish_connection(env = ENV['SEQUENT_ENV']) | ||
Sequent::Support::Database.connect!(env) | ||
# config = database_config(env) | ||
# yield(config) if block_given? | ||
# ActiveRecord::Base.configurations[env.to_s] = config.stringify_keys | ||
# ActiveRecord::Base.establish_connection config | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
class AuthorRecord < ActiveRecord::Base | ||
has_many :post_records, foreign_key: :author_aggregate_id, primary_key: :aggregate_id | ||
class AuthorRecord < Sequent::ApplicationRecord | ||
has_many :post_records, foreign_key: 'author_aggregate_id', primary_key: 'aggregate_id' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
class PostRecord < ActiveRecord::Base | ||
class PostRecord < Sequent::ApplicationRecord | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
<p> | ||
Back to <a href="/">index</a> | ||
</p> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>ID</th> | ||
<th>Name</th> | ||
<th>E-mail</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% @authors.each do |author| %> | ||
<tr> | ||
<td> | ||
<a href="/authors/id/<%= author.aggregate_id %>"><%= h author.aggregate_id %></a> | ||
</td> | ||
<td><%= h author.name %></td> | ||
<td><%= h author.email %></td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
<html> | ||
<body> | ||
<p> | ||
Back to <a href="/">index</a> | ||
</p> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>ID</th> | ||
<th>Name</th> | ||
<th>E-mail</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% @authors.each do |author| %> | ||
<tr> | ||
<td> | ||
<a href="/authors/<%= author.aggregate_id %>"><%= h author.aggregate_id %></a> | ||
</td> | ||
<td><%= h author.name %></td> | ||
<td><%= h author.email %></td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.