Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shard updates, mysql uuid type, and api route bug fix #1319

Merged
merged 4 commits into from
May 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ dependencies:

micrate:
github: amberframework/micrate
version: ~> 0.12.0
version: ~> 0.15.0

pg:
github: will/crystal-pg
version: ~> 0.23.0
version: ~> 0.26.0

mysql:
github: crystal-lang/crystal-mysql
version: ~> 0.13.0
version: ~> 0.14.0

sqlite3:
github: crystal-lang/crystal-sqlite3
version: ~> 0.18.0
version: ~> 0.19.0

redis:
github: stefanwille/crystal-redis
Expand Down
13 changes: 7 additions & 6 deletions src/amber/cli/commands/routes.cr
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,21 @@ module Amber::CLI
if route_match = resource_string.to_s.match(RESOURCE_ROUTE_REGEX)
filter = route_match[4]?
filter_actions = route_match[5]?.to_s.gsub(/\:|\s/, "").split(",")

ACTION_MAPPING.each do |verb, v|
v.each do |action|
case filter
when "only"
next unless filter_actions.includes?(action)
when "except"
next if filter_actions.includes?(action)
else
build_route(
verb: verb, controller: route_match[3]?, action: action,
pipeline: current_pipe, scope: current_scope,
uri_pattern: build_uri_pattern(route_match[2]?, action, current_scope)
)
end

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to wrap my head around what's happening here and why it was in the else clause to begin with.

I'm going to roll with this for now, as long as CI passes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think it was a mistake. i dont see how it would have ever worked.

build_route(
verb: verb, controller: route_match[3]?, action: action,
pipeline: current_pipe, scope: current_scope,
uri_pattern: build_uri_pattern(route_match[2]?, action, current_scope)
)
end
end
end
Expand Down
1 change: 1 addition & 0 deletions src/amber/cli/generators/field.cr
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module Amber::CLI
password: ["password", "String", "VARCHAR(255)"],
time: ["time", "Time", "TIMESTAMP NULL"],
timestamp: ["time", "Time", "TIMESTAMP NULL"],
uuid: ["uuid", "UUID", "binary(16)"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

},
sqlite: {
int: ["bigint", "Int64", "INT"],
Expand Down