ruby - Call task more than once in Rails 3 generator -
i'm writing rails 3 generator creates 2 different models. here's simplified example of i'm trying do:
def my_generator_task invoke "model", ["foo"] invoke "model", ["bar"] end
the problem thor invoke method invokes task once, second call "model" task never happens , "bar" model never created. know elegant way accomplish this, preferably in way doesn't break ability run "rails destroy" generator?
one more thought, way possible run multiple model generator without migration
rails::generators.invoke("active_record:model", ["foo", "--no-migration" ]) rails::generators.invoke("active_record:model", ["bar", "--no-migration" ])
Comments
Post a Comment