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

dm-migrations property type issue #1020

Closed
jeffreybasurto opened this issue Jan 25, 2013 · 7 comments · Fixed by #1273
Closed

dm-migrations property type issue #1020

jeffreybasurto opened this issue Jan 25, 2013 · 7 comments · Fixed by #1273
Milestone

Comments

@jeffreybasurto
Copy link
Contributor

When trying to run a migration with a type of Text: (which was generated from padrino generator for model)

db/migrate/002_create_interfaces.rb:5:in `block (3 levels) in <top (required)>': uninitialized constant Text (NameError)

Actually, not sure if this is a problem with padrino, how it generates the migration file, or dm-migrations.

I "fixed" the issue by changing the type to "TEXT":

property :something, "TEXT"

@dariocravero
Copy link

Thanks @jeffreybasurto, it's a funny case the one you've spotted!

It looks like dm-migrations doesn't support Text yet and whatever the DB takes underneath as a string for that field.

It might be something we have to address on the generator. Anyway, I'll add @DAddYE and @postmodern to the conversation because this issue datamapper/dm-migrations#20 is related and they participated a while ago.

@postmodern
Copy link
Contributor

It's a namespace issue. dm-migrations should use const_missing to lookup types in DataMapper::Property::. You can specify the full class: DataMapper::Property::Text, DataMapper::Property::Boolean, etc.

@nesquena
Copy link
Member

Ah I see, maybe we should just play it safe and specify the full class for now in migrations, it's not as pretty but maybe we can change it back later if dm-migrations supports this automatically in the future. Which version of dm did this happen with?

@rdpoor
Copy link

rdpoor commented Feb 9, 2013

Same thing happened to me. To answer @nesquena's question: dm 1.2.0.

@nesquena
Copy link
Member

OK, valid issue plan to fix soon (post 0.11.0) unless anyone wants to object otherwise.

@dariocravero
Copy link

👍

@postmodern
Copy link
Contributor

dm-migrations does extend DataMapper::Property::Lookup which adds a const_missing method. Not sure why it isn't resolving the classes. What version of DataMapper and Ruby is this occurring on?

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

Successfully merging a pull request may close this issue.

6 participants