active_generator 2.2.1 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_generator/version.rb +1 -1
- data/lib/generators/rails/model_generator.rb +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77da6787e317b3031644a9a2ef7750c942269249
|
4
|
+
data.tar.gz: 07cf65c3b30cd8a231d568454c7e6126d199bff4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f803e9bd1d2a9d8cd526abd90c28d5cfa29b1e940a3508f0788d939a520a05fc7c6c19a7155a720f13aec6c03243881dee0ec037c3fe593e47991d305967594
|
7
|
+
data.tar.gz: b5f62c66e32bdc35e892f02a6006ff4ab58692a65d3a3fa483bb5820f3b6aae304cbbe92aa6c001ce7baff2672937a279b71543d730f97b35c8541365de88d74
|
@@ -4,6 +4,12 @@ module ActiveRecord
|
|
4
4
|
module Generators
|
5
5
|
class ModelGenerator
|
6
6
|
|
7
|
+
def create_migration_file
|
8
|
+
return unless options[:migration] && options[:parent].nil?
|
9
|
+
attributes.each { |a| a.attr_options.delete(:index) if a.reference? && !a.has_index? } if options[:indexes] == false
|
10
|
+
migration_template "../../migration/templates/create_table_migration.rb", "db/migrate/create_#{table_name}.rb"
|
11
|
+
end
|
12
|
+
|
7
13
|
def generate_locale_file
|
8
14
|
invoke("locale:model", [name]) if ActiveGenerator.configuration.autoload_model_generator_locale
|
9
15
|
end
|