If you look at the scaffold generator, it is able to apply the correct model/migration generator depending on the orm setting in application.rb. This is handled transparently as I see it. It simply calls the correct migration and model generators with a name corresponding to the orm setting. Check out my http://github.com/kristianmandrup/mongo_model_r3 for an example. This can be used by http://github.com/kristianmandrup/very_nifty_generators Which contains a scaffold generator. This calls the mongo_mapper generator if orm is set to :mongo_mapper and so on... Something similar should be possible with migrations.
Also see: http://guides.rails.info/generators.html for more details ;) Good luck! Kristian On Jan 29, 9:54 pm, szimek <szi...@gmail.com> wrote: > Hi, > > I'd like to add Rails 3 compatible generator to acts_as_taggable_on > gem (all it does is call "migration_template" method) and got a > problem with "next_migration_number" method not being implemented. > > For ActiveRecord this method is defined in > ActiveRecord::Generators::Base class, which inherits from NamedBase > class. How can I use it inside my generator, which inherits from > Rails::Generators::Base? How to use "hook_for :orm" here, so that the > proper "next_migration_number" method definition is be used? > > Cheers, > Szymek -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.