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

Are Converter docs right? #349

Closed
EnricoMonese opened this issue Jul 17, 2019 · 10 comments
Closed

Are Converter docs right? #349

EnricoMonese opened this issue Jul 17, 2019 · 10 comments

Comments

@EnricoMonese
Copy link
Contributor

Are the Converter docs right, is there anything else to do to use this feature?
I even tried the example provided but it doesn't seem to work

no overload matches 'Array(Array(Bool) | Array(Float32) | Array(Float64) | Array(Int16) | Array(Int32) | Array(Int64) | Array(String) | Bool | Float32 | Float64 | Int32 | Int64 | Slice(UInt8) | String | Time | Nil)#<<' with type (OrderStatus | Nil)
Overloads are:
 - Array(T)#<<(value : T)
Couldn't find overloads for these types:
 - Array(Array(Bool) | Array(Float32) | Array(Float64) | Array(Int16) | Array(Int32) | Array(Int64) | Array(String) | Bool | Float32 | Float64 | Int32 | Int64 | Slice(UInt8) | String | Time | Nil)#<<(value : OrderStatus)
@Blacksmoke16
Copy link
Contributor

Blacksmoke16 commented Jul 17, 2019

They should be. Be sure you're using master. The converter stuff isn't released yet so would have to do like:

dependencies:
  granite:
    github: amberframework/granite
    branch: master

@EnricoMonese
Copy link
Contributor Author

Ah yes, now it works. Does it default to the latest release tag otherwise?

Also I've had some minor things to fix though.
The \ at the end of the line here was giving errors, removing it fixed it.
And I had to add require "uuid" here because it couldn't find it .
Should I make PRs for these?

@Blacksmoke16
Copy link
Contributor

Yea if you would. Kinda concerning CI didnt pick these up?

@EnricoMonese
Copy link
Contributor Author

This can be closed then

@EnricoMonese
Copy link
Contributor Author

The weird thing about the \ is that it should be needed for the multiline string

@Blacksmoke16
Copy link
Contributor

Blacksmoke16 commented Jul 17, 2019

Oh, then there must be something else going on. What was the granite version you're using? (Can look in your shard.lock for this).

Also what crystal/os?

I'm mainly wondering why CI didn't error but it did for you. Might be worth looking into.

@EnricoMonese
Copy link
Contributor Author

EnricoMonese commented Jul 17, 2019

Granite version in shard.lock

  granite:
    github: amberframework/granite
    commit: c4bc435fc9a24a132ff349367ba2b324d22d8948

Crystal version

Crystal 0.29.0 (2019-06-06)

LLVM: 6.0.1
Default target: x86_64-apple-macosx

And I'm on macOS 10.13.6 (High Sierra)
Edit: Same on Ubuntu 16.04.4 LTS (GNU/Linux 4.4.0-141-generic x86_64)


This is the error:

Error in src/api.cr:6: while requiring "granite"

require "granite"
^

in lib/granite/src/granite.cr:9: while requiring "./granite/base"

require "./granite/base"
^

in lib/granite/src/granite/base.cr:2: while requiring "./association_collection"

require "./association_collection"
^

Syntax error in lib/granite/src/granite/association_collection.cr:41: unknown token: '\r'

      "JOIN #{through.to_s} ON #{through.to_s}.#{Target.to_s.underscore}_id = #{Target.table_name}.#{Target.primary_name} " \
                                                                                                                             ^


@EnricoMonese
Copy link
Contributor Author

Could be related to crystal-lang/crystal#5831 ?

@EnricoMonese
Copy link
Contributor Author

Yes that is the problem, I converted the line endings and now it works

@Blacksmoke16
Copy link
Contributor

Blacksmoke16 commented Jul 17, 2019

That would do it.

I'll fix the uuid thing in the PR i have open. Think I know why CI didn't pick it up.

EDIT: NVM i see you already made one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants