byroot / activerecord-typedstore

ActiveRecord::Store but with type definition
MIT License
439 stars 57 forks source link

Type :text is not in the dsl list of valid attributes #17

Closed davoclavo closed 10 years ago

davoclavo commented 10 years ago

The list of attributes is missing the :text type.

https://github.com/byroot/activerecord-typedstore/blob/55a15106f6c7f0a7597cf2226b23be9c9fd7ca6d/lib/active_record/typed_store/dsl.rb#L17

byroot commented 10 years ago

Right. But there is no point to add it because there would be no difference with the string type.

Feel free to reopen if I missed something.

davoclavo commented 10 years ago

I tried using it to have it automatically create a textarea when using it in a form.

byroot commented 10 years ago

You mean using simple_form or something like that?

davoclavo commented 10 years ago

Yes. Even with normal form_for method. If the attribute is a type :text it adds a textarea instead of a one line input.

Anyhow, if it is not gonna be used, there is a value check that it is using it, it should be removed: https://github.com/byroot/activerecord-typedstore/blob/55a15106f6c7f0a7597cf2226b23be9c9fd7ca6d/lib/active_record/typed_store/column.rb#L41

byroot commented 10 years ago

Well, I guess I could add it, but form_for won't see the difference because I can't expose store field like real column otherwise it would mess with activerecord see #15 and #16.

I actually want to support that case, but have no idea how for now :sob:

But Ok, I'll add an alias.

byroot commented 10 years ago

If you don't mind using master, the text type is in it.

davoclavo commented 10 years ago

sweet!