When HoboFields is installed you can do the following:
require 'hobo_fields'
class Category < ActiveRecord::Base
fields do
name :string
description :text
timestamps
end
belongs_to :category
belongs_to :administration
end
Next, you just run:
ruby script/generate hobo_migration
And the migration will be generated. Now you may think that this is not a good thing, because by making your own migrations you could keep track of changes and roll updates to other environments, right? Well, this is not a problem because HoboFields will actually detect any changes made to the model and generate the migrations for you!
If you are interested in using HoboFields, you can install it as follows:
gem install hobofields
0 reacties:
Een reactie plaatsen