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

Read_attribute does not work when column is array #396

Closed
msa7 opened this issue May 1, 2020 · 1 comment · Fixed by #397
Closed

Read_attribute does not work when column is array #396

msa7 opened this issue May 1, 2020 · 1 comment · Fixed by #397

Comments

@msa7
Copy link
Contributor

msa7 commented May 1, 2020

In lib/granite/src/granite/columns.cr:146:58

 146 | def read_attribute(attribute_name : Symbol | String) : DB::Any
                                                              ^------
Error: method must return (Bool | Float32 | Float64 | Int32 | Int64 | Slice(UInt8) | String | Time | Nil) but it is returning (Array(Int32) | Array(Int64) | Bool | Int32 | Int64 | String | Time | Nil)
@Blacksmoke16
Copy link
Contributor

Probably just need to update

def read_attribute(attribute_name : Symbol | String) : DB::Any
to be Type not DB::Any.

msa7 added a commit to msa7/granite that referenced this issue May 4, 2020
msa7 added a commit to msa7/granite that referenced this issue May 4, 2020
msa7 added a commit to msa7/granite that referenced this issue May 5, 2020
drujensen pushed a commit that referenced this issue May 5, 2020
* Fix read_attribute, see #396

* Fix typo

Co-authored-by: George Dietrich <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants