refactor: change room offset_{x,y} to just {x,y}
This commit is contained in:
@@ -7,10 +7,10 @@ defmodule Localiser.Domain.Schema.Room do
|
||||
|
||||
schema "rooms" do
|
||||
field :name, :string
|
||||
field :width, :float
|
||||
field :height, :float
|
||||
field :offset_x, :float
|
||||
field :offset_y, :float
|
||||
field :width, :float, default: 1.0
|
||||
field :height, :float, default: 1.0
|
||||
field :x, :float, default: 0.0
|
||||
field :y, :float, default: 0.0
|
||||
|
||||
belongs_to :floor, Floor
|
||||
has_many :sensors, Sensor
|
||||
@@ -21,7 +21,7 @@ defmodule Localiser.Domain.Schema.Room do
|
||||
@doc false
|
||||
def changeset(room, attrs) do
|
||||
room
|
||||
|> cast(attrs, [:name, :floor_id, :width, :height, :offset_x, :offset_y])
|
||||
|> cast(attrs, [:name, :floor_id, :width, :height, :x, :y])
|
||||
|> validate_required([:name, :floor_id])
|
||||
|> assoc_constraint(:floor)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user