Skip to content

Commit

Permalink
improvement(user): add ui_theme field
Browse files Browse the repository at this point in the history
  • Loading branch information
caspiano committed Mar 22, 2020
1 parent 91c7a77 commit 353567a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/models/driver.cr
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ module PlaceOS::Model
self.modules.each &.destroy
end

# Reload all modules to update their settings
# Reload all modules to update their name
#
protected def update_modules
self.modules.each do |mod|
Expand Down
4 changes: 3 additions & 1 deletion src/models/module.cr
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module PlaceOS::Model
# Remove the module from associated (if any) ControlSystem
before_destroy :remove_module

# ensure the fields are set correctly
# Ensure fields inherited from Driver are set correctly
before_save :set_name_and_role

# Finds the systems for which this module is in use
Expand Down Expand Up @@ -229,6 +229,8 @@ module PlaceOS::Model
# TODO: log if there were failures
end

# Set the name/role from the associated Driver
#
protected def set_name_and_role
driver_ref = driver.not_nil!
self.role = driver_ref.role
Expand Down
1 change: 1 addition & 0 deletions src/models/user.cr
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module PlaceOS::Model
attribute phone : String
attribute country : String
attribute image : String
attribute ui_theme : String
attribute metadata : String

attribute login_name : String
Expand Down

0 comments on commit 353567a

Please sign in to comment.