Skip to content
New issue

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

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

Already on GitHub? # to your account

Rails 4.2.0: Array/Hash typecast #25

Closed
shlima opened this issue Jan 23, 2015 · 1 comment
Closed

Rails 4.2.0: Array/Hash typecast #25

shlima opened this issue Jan 23, 2015 · 1 comment

Comments

@shlima
Copy link

shlima commented Jan 23, 2015

  attribute :product_bindings, :hash, default: proc { Hash.new }

Raises the error:

ERROR:  syntax error at or near "array"
LINE 1: SELECT 'array'::regtype::oid
               ^
CONTEXT:  invalid type name "array"
@kratob
Copy link
Member

kratob commented Jan 23, 2015

ActiveType does not do any type casting on arrays or hashes, so you can simply drop the type and use

attribute :product_bindings, default: proc { Hash.new }

I'll release a fix, so ActiveType just ignores such data types, instead of crashing.

@kratob kratob closed this as completed in df45087 Jan 23, 2015
kratob pushed a commit that referenced this issue Jan 23, 2015
[fixes #25] dont crash for database types without casting rules
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants