Skip to content

Commit 7bbb778

Browse files
committed
Ensure that calls for interest can be created without an "interestable" association
1 parent 385cfae commit 7bbb778

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

app/models/better_together/call_for_interest.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class CallForInterest < ApplicationRecord
1111

1212
slugged :name
1313

14-
belongs_to :interestable, polymorphic: true
14+
belongs_to :interestable, polymorphic: true, optional: true
1515

1616
has_one_attached :cover_image do |attachable|
1717
attachable.variant :optimized_jpeg, resize_to_limit: [2400, 1200],

app/views/better_together/calls_for_interest/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
If you have an idea or want to see what others are interested in, check back soon or start a new call for interest!
4242
</p>
4343
<% if policy(resource_class).create? %>
44-
<a href="<%= new_call_for_interest_path %>" class="btn btn-primary mt-3">Publish an Call For Interest</a>
44+
<a href="<%= new_call_for_interest_path %>" class="btn btn-primary mt-3">Publish a Call For Interest</a>
4545
<% end %>
4646
</div>
4747
</div>

config/locales/en.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,8 @@ en:
576576
buildings:
577577
add: Add
578578
title: Title
579+
calls_for_interest:
580+
save_call_for_interest: Save Call for Interest
579581
communities:
580582
index:
581583
new_btn_text: New btn text

0 commit comments

Comments
 (0)