Skip to content

Commit

Permalink
Reuse some of the naming methods and go through object reader
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspth committed May 14, 2024
1 parent 33613c8 commit c276c01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/generators/associated/templates/associated.rb.tt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class <%= record_klass %>::<%= associated_object_class %> < ActiveRecord::AssociatedObject
class <%= name %> < ActiveRecord::AssociatedObject
extension do
# Extend <%= record_klass %> here
end
Expand Down
6 changes: 3 additions & 3 deletions lib/generators/associated/templates/associated_test.rb.tt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

require "test_helper"

class <%= record_klass %>::<%= associated_object_class %>Test < ActiveSupport::TestCase
class <%= name %>Test < ActiveSupport::TestCase
setup do
# @<%= record_klass.downcase.underscore %> = <%= record_klass.downcase.underscore.pluralize %>(:TODO_fixture_name)
# @<%= associated_object_class.downcase.underscore %> = <%= record_klass %>::<%= associated_object_class %>.new(@<%= record_klass.downcase.underscore %>)
# @<%= record_path %> = <%= record_path.pluralize %>(:TODO_fixture_name)
# @<%= associated_object_path %> = @<%= record_path %>.<%= associated_object_path %>
end
end

0 comments on commit c276c01

Please sign in to comment.