aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/organisation.rb2
-rw-r--r--app/views/events/_form.html.erb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/organisation.rb b/app/models/organisation.rb
index aa67564..89ad982 100644
--- a/app/models/organisation.rb
+++ b/app/models/organisation.rb
@@ -1,3 +1,3 @@
class Organisation < ApplicationRecord
- has_many :events
+ has_many :events, dependent: :destroy
end
diff --git a/app/views/events/_form.html.erb b/app/views/events/_form.html.erb
index 98dd972..dbce3b1 100644
--- a/app/views/events/_form.html.erb
+++ b/app/views/events/_form.html.erb
@@ -39,7 +39,7 @@
<div>
<%= form.label "Organisation", style: "display: block" %>
- <%= form.select :organisation, Organisation.all.collect { |o| [ o.name, o.id ] }, include_blank: true %>
+ <%= form.select :organisation_id, Organisation.all.collect { |o| [ o.name, o.id ] }, include_blank: true %>
</div>
<div>