old_sql 1.31.1 → 1.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,7 @@ module OldSql
5
5
  class InstallDeviseMigrationsGenerator < Rails::Generators::Base
6
6
  include Rails::Generators::Migration
7
7
  source_root File.expand_path('../templates', __FILE__)
8
+ argument :model_name, :type => :string, :default => 'user'
8
9
 
9
10
  def self.next_migration_number(dirname)
10
11
  if ActiveRecord::Base.timestamped_migrations
@@ -17,7 +18,9 @@ module OldSql
17
18
  end
18
19
 
19
20
  def create_migration_file
20
- migration_template 'add_devise_to_users_migration.rb', 'db/migrate/add_devise_to_users.rb' rescue p $!.message
21
+ migration_template 'add_devise_to_users_migration.rb', "db/migrate/add_devise_to_#{model_name}.rb" rescue p $!.message
22
+ gsub_file "db/migrate/add_devise_to_#{model_name}.rb", /:users/, ":#{model_name}"
23
+
21
24
  #sleep 1 # ensure scripts have different timestamps
22
25
  end
23
26
  end
@@ -82,10 +82,10 @@ module OldSql
82
82
  invoke 'devise:install'
83
83
 
84
84
  if !devise_table_exists?
85
- puts 'User Model Does Not Exist'
85
+ puts 'Devise Model Does Not Exist'
86
86
  set_devise
87
87
  elsif !model_has_devise?
88
- puts 'User Model Does Not Have Devise Support'
88
+ puts 'Devise Model Does Not Have Devise Support'
89
89
  invoke 'old_sql:install_devise_migrations'
90
90
  create_model_class unless model_exists?
91
91
  add_devise_to_routes
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: old_sql
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.31.1
5
+ version: 1.32.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Eddie Gonzales
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-06-28 00:00:00 Z
13
+ date: 2011-06-29 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: devise
@@ -198,7 +198,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
198
198
  requirements:
199
199
  - - ">="
200
200
  - !ruby/object:Gem::Version
201
- hash: -2031933056678451368
201
+ hash: 1250668305898490841
202
202
  segments:
203
203
  - 0
204
204
  version: "0"