hint is added when generated a relationship between 2 content types

did committed Jan 27, 2015
commit 951bb0073649aa50e9a1277bf3d4975352b3fc29
Showing 3 changed files with 8 additions and 1 deletions
locomotive/wagon/generators/relationship.rb b/lib/locomotive/wagon/generators/relationship.rb +3 -0
@@ @@ -56,6 +56,7 @@ module Locomotive
in_yaml({
target_class.singularize => {
'label' => target_class.singularize.humanize,
+ 'hint' => 'A description of the relationship for the editors',
'type' => 'belongs_to',
'class_name' => target_class
}
@@ @@ -66,6 +67,7 @@ module Locomotive
in_yaml({
target_class => {
'label' => target_class.humanize,
+ 'hint' => 'A description of the relationship for the editors',
'type' => 'has_many',
'class_name' => target_class,
'inverse_of' => source_class.singularize,
@@ @@ -78,6 +80,7 @@ module Locomotive
in_yaml({
target_class => {
'label' => target_class.humanize,
+ 'hint' => 'A description of the relationship for the editors',
'type' => 'many_to_many',
'class_name' => target_class,
'inverse_of' => source_class,
locomotive/wagon/version.rb b/lib/locomotive/wagon/version.rb +1 -1
@@ @@ -1,5 +1,5 @@
module Locomotive
module Wagon
- VERSION = '1.5.1'
+ VERSION = '1.5.2'
end
end
spec/integration/generators/relationship_spec.rb +4 -0
@@ @@ -46,6 +46,7 @@ describe 'Locomotive::Wagon::Generators::Relationship' do
read_content_type(:comments).should include <<-EXPECTED
- post:
label: Post
+ hint: A description of the relationship for the editors
type: belongs_to
class_name: posts
EXPECTED
@@ @@ -55,6 +56,7 @@ EXPECTED
read_content_type(:posts).should include <<-EXPECTED
- comments:
label: Comments
+ hint: A description of the relationship for the editors
type: has_many
class_name: comments
inverse_of: post
@@ @@ -73,6 +75,7 @@ EXPECTED
read_content_type(:comments).should include <<-EXPECTED
- posts:
label: Posts
+ hint: A description of the relationship for the editors
type: many_to_many
class_name: posts
inverse_of: comments
@@ @@ -83,6 +86,7 @@ EXPECTED
read_content_type(:posts).should include <<-EXPECTED
- comments:
label: Comments
+ hint: A description of the relationship for the editors
type: many_to_many
class_name: comments
inverse_of: posts