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

Fix breakages caused by Crystal 1.13 #231

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion src/clear/extensions/enum/migration.cr
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module Clear::Migration
end
end

module Clear::Migration::Helper
module Helper
def create_enum(name : Clear::SQL::Symbolic, arr : Enumerable(T)) forall T
self.add_operation(CreateEnum.new(name.to_s, arr.map(&.to_s)))
end
Expand Down
4 changes: 2 additions & 2 deletions src/clear/model/modules/has_relations.cr
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ module Clear::Model::HasRelations
polymorphic_type_column = "#{polymorphic_type_column.id}" if polymorphic_type_column

if name.type.is_a?(Union) # Nilable?
nilable = name.type.types.map { |x| "#{x.id}" }.includes?("Nil")
nilable = name.type.resolve.nilable?
type = name.type.types.first
else
type = name.type
Expand Down Expand Up @@ -173,7 +173,7 @@ module Clear::Model::HasRelations
nilable = false

if name.type.is_a?(Union) # Nilable?
nilable = name.type.types.map { |x| "#{x.id}" }.includes?("Nil")
nilable = name.type.resolve.nilable?
type = name.type.types.first
else
type = name.type
Expand Down
2 changes: 2 additions & 0 deletions src/clear/model/reflection/column.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require "./table"

# Reflection of the columns using information_schema in postgreSQL.
# TODO: Usage of view instead of model
class Clear::Reflection::Column
Expand Down