Sha256: c83fd2edd89755039c6516de407e83e2433165f20dafd8b8df132b30fce35603

Contents?: true

Size: 794 Bytes

Versions: 2

Compression:

Stored size: 794 Bytes

Contents

require "generators/jive/oauth_token/oauth_token_generator"
require "generators/jive/oauth_token/next_migration_version"
require "rails/generators/migration"
require "rails/generators/active_record"

# Extend the HasDynamicColumnsGenerator so that it creates an AR migration
module Jive
	class OauthToken < ActiveRecord::Base
		class ActiveRecordGenerator < ::Jive::OauthToken::Generator
			include Rails::Generators::Migration
			extend NextMigrationVersion

			source_paths << File.join(File.dirname(__FILE__), "templates")

			def create_migration_file
				migration_template "migration_0.1.0.rb", "db/migrate/add_jive_oauth_tokens_0_1_0_migration.rb"
			end

			def self.next_migration_number(dirname)
				::ActiveRecord::Generators::Base.next_migration_number dirname
			end
		end
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jive-oauth_token-0.0.4 lib/generators/jive/oauth_token/active_record_generator.rb
jive-oauth_token-0.0.3 lib/generators/jive/oauth_token/active_record_generator.rb