Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sandip Ransing
committed
Feb 11, 2011
1 parent
ed0ed24
commit 51c2832
Showing
4 changed files
with
21 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
generators/rails_tiny_mce_migration/rails_tiny_mce_migration_generator.rb
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
class TinyMigrationGenerator < Rails::Generator::Base | ||
require 'rails/generators' | ||
require 'rails/generators/migration' | ||
|
||
include Rails::Generators::Migration | ||
source_root File.expand_path('../templates', __FILE__) | ||
# Implement the required interface for Rails::Generators::Migration. | ||
# taken from http://github.com/rails/rails/blob/master/activerecord/lib/generators/active_record.rb | ||
def self.next_migration_number(dirname) | ||
if ActiveRecord::Base.timestamped_migrations | ||
Time.now.utc.strftime("%Y%m%d%H%M%S") | ||
else | ||
"%.3d" % (current_migration_number(dirname) + 1) | ||
end | ||
end | ||
|
||
def create_migration_file | ||
migration_template 'migration.rb', 'db/migrate/create_tiny_media.rb' | ||
end | ||
end |