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

every attribute #43

Open
dudo opened this issue Sep 14, 2014 · 1 comment
Open

every attribute #43

dudo opened this issue Sep 14, 2014 · 1 comment

Comments

@dudo
Copy link

dudo commented Sep 14, 2014

Let's say I have an hstore that's all integers, or all booleans.

Could we do something like hstore_accessor :options, all: :boolean?

Maybe even something dynamic? If the attribute is 'true' or 'false', catch the boolean. If calling .to_i or .to_f/d evaluates to something greater than 0, catch the int or float. That might be a bit much... just thinking out loud.

@crismali
Copy link
Contributor

This could be convenient. For the type coercion, things should be in line with how Rails does it out of the box.

Anyway, pull requests are encouraged =)

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

No branches or pull requests

2 participants