monban-generators 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 00d80f1e96ab44b86da187cd55d9bffc15ace4e4
4
- data.tar.gz: 8945678e07a9094de6813feccc5b342f59fdf2ec
3
+ metadata.gz: 7a02b0fbdaf4fb2600709ccff2251df3e109e482
4
+ data.tar.gz: ded56388860f51bb3e9d338b96e78e44e97c3958
5
5
  SHA512:
6
- metadata.gz: bf595a7ee13300ff3c4e7eb4372fb3b624424800110e841475cbbe31dbc114cd2f6cb3d2d0e99da4668d146d7ff886a18ea8d9066dc467ebaf2112ff2154c870
7
- data.tar.gz: 7afacc274c9213fbbdf27f16e387a593712aaaa75e8de929844e64542d2637faa9c3139aa819aabaea6097f4132ebe84257171107098c6a83b43e55078597d41
6
+ metadata.gz: 2b741ab5fb182a24cd473d0f7c1efeea9a3de6beee2012ba437fee139aa26ad358881fc2d75035d60247df9bb5ad38a0242e531aa2ca92e84d03b8192ba6c6ed
7
+ data.tar.gz: e6e7d55326337827b33d5ef05f90b933e57c2638ad9d4eac8ce2044724fb58efad23e85e6239d650e11b79c8720501c66377bdc13b070205ff5528dd85b71c34
data/NEWS.rdoc CHANGED
@@ -1,3 +1,6 @@
1
+ ## 1.0.1
2
+ * Add backwards compatibility for Rails 4 migrations
3
+
1
4
  ## 1.0.0
2
5
  * Update migrations to include migration version
3
6
 
@@ -1,9 +1,12 @@
1
1
  require 'rails/generators/active_record'
2
+ require 'generators/monban/migration/version'
2
3
 
3
4
  module Monban
4
5
  module Generators
5
6
  class GoogleOauth2Generator < Rails::Generators::Base
6
7
  include Rails::Generators::Migration
8
+ include Monban::Generators::Migration
9
+
7
10
  source_root File.expand_path("../../templates", __FILE__)
8
11
 
9
12
  def add_gems
@@ -32,7 +35,7 @@ module Monban
32
35
 
33
36
  def add_model
34
37
  template 'app/models/external_credential.rb', 'app/models/external_credential.rb'
35
- migration_template "db/migrate/create_external_credentials.rb", "db/migrate/create_external_credentials.rb"
38
+ migration_template "db/migrate/create_external_credentials.rb", "db/migrate/create_external_credentials.rb", migration_version: migration_version
36
39
  end
37
40
 
38
41
  def display_readme
@@ -0,0 +1,11 @@
1
+ module Monban
2
+ module Generators
3
+ module Migration
4
+ def migration_version
5
+ if Rails.version.start_with? '5'
6
+ "[#{ActiveRecord::Migration.current_version}]"
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,9 +1,12 @@
1
1
  require 'rails/generators/active_record'
2
+ require 'generators/monban/migration/version'
2
3
 
3
4
  module Monban
4
5
  module Generators
5
6
  class PasswordResetGenerator < Rails::Generators::Base
6
7
  include Rails::Generators::Migration
8
+ include Monban::Generators::Migration
9
+
7
10
  source_root File.expand_path("../../templates", __FILE__)
8
11
 
9
12
  def add_config_options
@@ -39,7 +42,7 @@ module Monban
39
42
 
40
43
  def add_model
41
44
  template 'app/models/password_reset.rb', 'app/models/password_reset.rb'
42
- migration_template "db/migrate/create_password_resets.rb", "db/migrate/create_password_resets.rb"
45
+ migration_template "db/migrate/create_password_resets.rb", "db/migrate/create_password_resets.rb", migration_version: migration_version
43
46
  end
44
47
 
45
48
  def display_readme
@@ -1,9 +1,12 @@
1
1
  require 'rails/generators/active_record'
2
+ require 'generators/monban/migration/version'
2
3
 
3
4
  module Monban
4
5
  module Generators
5
6
  class ScaffoldGenerator < Rails::Generators::Base
6
7
  include Rails::Generators::Migration
8
+ include Monban::Generators::Migration
9
+
7
10
  source_root File.expand_path("../../templates", __FILE__)
8
11
 
9
12
  def add_routes
@@ -31,7 +34,7 @@ module Monban
31
34
 
32
35
  def add_model
33
36
  template 'app/models/user.rb', 'app/models/user.rb'
34
- migration_template "db/migrate/create_users.rb", "db/migrate/create_users.rb"
37
+ migration_template "db/migrate/create_users.rb", "db/migrate/create_users.rb", migration_version: migration_version
35
38
  end
36
39
 
37
40
  def add_translations
@@ -1,4 +1,4 @@
1
- class CreateExternalCredentials < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
1
+ class CreateExternalCredentials < ActiveRecord::Migration<%= migration_version %>
2
2
  def change
3
3
  create_table :external_credentials do |t|
4
4
  t.string :uid
@@ -1,4 +1,4 @@
1
- class CreatePasswordResets < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
1
+ class CreatePasswordResets < ActiveRecord::Migration<%= migration_version %>
2
2
  def change
3
3
  create_table :password_resets do |t|
4
4
  t.belongs_to :user, index: true
@@ -1,4 +1,4 @@
1
- class CreateUsers < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
1
+ class CreateUsers < ActiveRecord::Migration<%= migration_version %>
2
2
  def change
3
3
  create_table :users do |t|
4
4
  t.string :email, null: false
@@ -1,5 +1,5 @@
1
1
  module Monban
2
2
  module Generators
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: monban-generators
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - halogenandtoast
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-05 00:00:00.000000000 Z
11
+ date: 2017-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -67,6 +67,7 @@ files:
67
67
  - README.md
68
68
  - Rakefile
69
69
  - lib/generators/monban/google_oauth2/google_oauth2_generator.rb
70
+ - lib/generators/monban/migration/version.rb
70
71
  - lib/generators/monban/password_reset/password_reset_generator.rb
71
72
  - lib/generators/monban/scaffold/scaffold_generator.rb
72
73
  - lib/generators/monban/templates/app/controllers/external_credentials_controller.rb
@@ -115,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
116
  version: '0'
116
117
  requirements: []
117
118
  rubyforge_project:
118
- rubygems_version: 2.6.8
119
+ rubygems_version: 2.5.1
119
120
  signing_key:
120
121
  specification_version: 4
121
122
  summary: Rails generators for the monban authentication library