diff --git a/app/models/tool_slot.rb b/app/models/tool_slot.rb index 98f834da6..5c510db47 100644 --- a/app/models/tool_slot.rb +++ b/app/models/tool_slot.rb @@ -3,7 +3,7 @@ # etc. class ToolSlot < ApplicationRecord belongs_to :tool - has_one :point, as: :pointer, dependent: :destroy + has_one :point, as: :pointer#, dependent: :destroy # has_many :sequence_dependencies, dependent: :destroy, as: :dependency validates_uniqueness_of :tool, allow_blank: true, diff --git a/db/migrate/20170518182029_add_polymorphic_constraints.rb b/db/migrate/20170518182029_add_polymorphic_constraints.rb index ac6fc357b..b9ae84913 100644 --- a/db/migrate/20170518182029_add_polymorphic_constraints.rb +++ b/db/migrate/20170518182029_add_polymorphic_constraints.rb @@ -1,7 +1,9 @@ class AddPolymorphicConstraints < ActiveRecord::Migration[5.1] def change - add_polymorphic_constraints :pointer, :tool_slots - add_polymorphic_constraints :pointer, :plants - add_polymorphic_constraints :pointer, :generic_pointers + add_polymorphic_constraints :pointer, + :points, + polymorphic_models: [:plant, + :tool_slot, + :generic_pointer] end end diff --git a/db/seeds.rb b/db/seeds.rb index 9fde94c68..440173f75 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -2,10 +2,10 @@ unless Rails.env == "production" ENV['MQTT_HOST'] = "blooper.io" ENV['OS_UPDATE_SERVER'] = "http://blah.com" ENV['FW_UPDATE_SERVER'] = "http://test.com" + Point.destroy_all ToolSlot.destroy_all Device.destroy_all User.destroy_all - Point.destroy_all Users::Create.run!(name: "Administrator", email: "notos@notos.com", password: "password123", diff --git a/latest_corpus.rb b/latest_corpus.rb index 02aa19f11..a18e2c258 100755 --- a/latest_corpus.rb +++ b/latest_corpus.rb @@ -139,6 +139,6 @@ result.push(enum_type :LegalKindString, HASH[:nodes].map{ |x| x[:name] }.sort.un result.push(enum_type :LegalSequenceKind, CeleryScriptSettingsBag::STEPS.sort) result.push(enum_type :DataChangeType, CeleryScriptSettingsBag::ALLOWED_CHAGES) result.push(enum_type :ResourceName, CeleryScriptSettingsBag::RESOURCE_NAME) -result.push(enum_type :PointType, CeleryScriptSettingsBag::ALLOWED_POINT_TYPE) +result.push(enum_type :PointType, CeleryScriptSettingsBag::ALLOWED_POINTER_TYPE) puts result.join.gsub("\n\n\n", "\n")