diff --git a/lib/generators/associated/associated_generator.rb b/lib/generators/associated/associated_generator.rb index 4813578..b63084a 100644 --- a/lib/generators/associated/associated_generator.rb +++ b/lib/generators/associated/associated_generator.rb @@ -11,7 +11,7 @@ def connect_associated_object raise "Record class '#{record_klass}' does not exist" unless File.exist?(record_file) inject_into_class record_file, record_klass do - indent "has_object :#{associated_object_path}\n\n" + optimize_indentation "has_object :#{associated_object_path}", 2 end end diff --git a/test/lib/generators/associated_generator_test.rb b/test/lib/generators/associated_generator_test.rb index f5012aa..28b15e8 100644 --- a/test/lib/generators/associated_generator_test.rb +++ b/test/lib/generators/associated_generator_test.rb @@ -38,7 +38,6 @@ class Organization::Seats < ActiveRecord::AssociatedObject assert_file "app/models/organization.rb", <<~RUBY class Organization has_object :seats - end RUBY end