Solve the NotImplementedError for Rails 3 generators with migrations
While making a generator/gem that relied on creating migrations I ran into this error:
`nextmigrationnumber': NotImplementedError (NotImplementedError)
After doing some searching I realized it is up to you to create this method in your generator. Here is what I am using:
def self.next_migration_number(path)
@migration_number = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i.to_s
end
Written by Larry Scott
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#