blueprint-generators-rails 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/blueprint/generators/rails/version.rb +1 -1
- data/lib/tasks/blueprint.rake +4 -4
- 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: 7979966a1179fb0151f24c2052504ae1002f828c
|
4
|
+
data.tar.gz: 8a0a20bfe69f69c88a77586816b9506df633ae5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84aa02824e5dde41c90d25a07eda14e6aded5624e972dffd1a755d355be4a368ae26fdd35b17767462f8fa74bbe6130c86d445861f8ac8401ca2a702f441a2df
|
7
|
+
data.tar.gz: ebfab1d789f8a3e7af73c77cd716f5997c0efc85ffa608c6837db531b6b8b582e63579038b2b02942df12edd1bc76e8c9ac19f7f1d92eeb8496f15802e88669e
|
data/lib/tasks/blueprint.rake
CHANGED
@@ -57,7 +57,7 @@ namespace :blueprint do
|
|
57
57
|
print_debug step_count, "Adding concept " + concept_name
|
58
58
|
step_count += 1
|
59
59
|
|
60
|
-
unless super_clazz == 'ActiveRecord::Base'
|
60
|
+
unless super_clazz.strip == 'ActiveRecord::Base'
|
61
61
|
is_a_name = super_clazz.singularize
|
62
62
|
|
63
63
|
# add the node relationship to the concept
|
@@ -71,7 +71,7 @@ namespace :blueprint do
|
|
71
71
|
# search for a 'has_one' or 'belongs_to' declaration
|
72
72
|
a, has_one_clazz = line.match(/(has_one|belongs_to) :([^,]+)/).try(:captures)
|
73
73
|
unless has_one_clazz.nil?
|
74
|
-
has_one_name = has_one_clazz.
|
74
|
+
has_one_name = has_one_clazz.classify.singularize.strip
|
75
75
|
|
76
76
|
# add the node relationship to the concept
|
77
77
|
model[concept_name].push({ :type => 'has one', :name => has_one_name })
|
@@ -83,7 +83,7 @@ namespace :blueprint do
|
|
83
83
|
# search for a 'has_many' declaration
|
84
84
|
b, has_many_clazz = line.match(/(has_many) :([^,]+)/).try(:captures)
|
85
85
|
unless has_many_clazz.nil?
|
86
|
-
has_many_name = has_many_clazz.
|
86
|
+
has_many_name = has_many_clazz.classify.pluralize.strip
|
87
87
|
|
88
88
|
# add the node relationship to the concept
|
89
89
|
model[concept_name].push({ :type => 'has many', :name => has_many_name })
|
@@ -96,7 +96,7 @@ namespace :blueprint do
|
|
96
96
|
c, habtm_clazz = line.match(/(has_and_belongs_to_many) :([^,]+)/).try(:captures)
|
97
97
|
unless habtm_clazz.nil?
|
98
98
|
# this is a many-to-many, so we add two 'has many' relationships (one of each side)
|
99
|
-
habtm_name = habtm_clazz.
|
99
|
+
habtm_name = habtm_clazz.classify.pluralize.strip
|
100
100
|
|
101
101
|
# add the first side of the 'has many' if it does not already exist
|
102
102
|
if model[concept_name].find { |v| v[:type] == 'has many' && v[:name] == habtm_name }.nil?
|