views:

53

answers:

2

With HoboFields, I can declare fields for my model in its own file, like this:

class User < ActiveRecord::Base

  fields do
    login :string
    persistence_token :string
  end

end

I'd like to know if there's equivalent syntax for the add_index command I can use in vanilla Rails migrations.

A: 

This doesn't exist yet in HoboFields, but I've suggested it on this thread and it seems it's going to be implemented in a future release.

Edit: it's been implemented and is currently in this experimental branch: http://github.com/tablatom/hobo/tree/indexgen. I'll update the answer when it gets included in a release.

obvio171
+1  A: 
class User < ActiveRecord::Base 

  fields do 
    login :string 
    persistence_token :string, :index => true
  end 

end 
Ken Melton