migration_and_model 0.1.0 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c31110316f2f0298efe49fc6c7929b9ad5126524ac5b9569d55485d7ad0423bd
4
- data.tar.gz: 80d4e6bbdfb57c91369f8773fe1bb5e6fc1e022f080ef2f74a477dc60945475a
3
+ metadata.gz: d70ea6f283ec89d477f1e26cff6ee3470fb12d6e599ca242caead34c180f3a39
4
+ data.tar.gz: 0535731aed7cb141a2d24a36880a8df3d6d26f0c3ecceaba4ea498a4b101e028
5
5
  SHA512:
6
- metadata.gz: 3620f4869da4455c6cebd00cf2cc0109e55ce5974c9c50e0ced20faa7543ca06e88e4c2e212239836eebae491d81718cc1c6476472d2f01b58ce98e83baa9b27
7
- data.tar.gz: 3b52faa75120e5aee9f4cd6d092af7b4b1d8c44d9263d77dc094dca378141ff3e56027ab5da41c2a5a7986efedefa77add0f120e0b163b40b6eeb6f25b33f661
6
+ metadata.gz: 6558ad0fe30cdc5f7948f8f2d084332d0d8f26cc46a6703abca3568011f8aecd69c17b402f179dc5cc81894ef746333855a7250c7e01813deb2dfe3e8b791e30
7
+ data.tar.gz: af9bd0a290a500ed7e903eae7b2bd2b71ea6f9b7ece17b99261849f90f30b251b91e3a7747eea16fe75325814ddd29e7071e450c5279eab34a99135c7eec2181
@@ -0,0 +1,25 @@
1
+ module MigrationAndModel
2
+ class InstallGenerator < Rails::Generators::NamedBase
3
+ source_root File.expand_path('templates', __dir__)
4
+ include Rails::Generators::Migration
5
+
6
+ desc "Create your own migrations"
7
+
8
+ def self.next_migration_number(path)
9
+ next_migration_number = current_migration_number(path) + 1
10
+ ActiveRecord::Migration.next_migration_number(next_migration_number)
11
+ end
12
+
13
+ def copy_migrations
14
+ migration_template "my_migration.rb", "db/migrate/create_#{file_name.pluralize}.rb"
15
+ end
16
+
17
+ def create_model
18
+ create_file "app/models/#{file_name}.rb", <<-FILE
19
+ class #{class_name} < ApplicationRecord
20
+ end
21
+ FILE
22
+ end
23
+ end
24
+
25
+ end
@@ -0,0 +1,5 @@
1
+ class Create<%= class_name.pluralize %> < ActiveRecord::Migration[5.2]
2
+ def change
3
+ # add content here
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module MigrationAndModel
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: migration_and_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shivam Jain
@@ -69,8 +69,11 @@ files:
69
69
  - Rakefile
70
70
  - bin/console
71
71
  - bin/setup
72
+ - lib/generators/migration_and_model/install_generator.rb
73
+ - lib/generators/migration_and_model/templates/my_migration.rb
72
74
  - lib/migration_and_model.rb
73
75
  - lib/migration_and_model/version.rb
76
+ - migration_and_model-0.1.0.gem
74
77
  - migration_and_model.gemspec
75
78
  homepage: https://www.github.com/shivamvinsol
76
79
  licenses: