mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-29 03:01:58 +08:00
Add some additional nil guards
This commit is contained in:
parent
d023db16af
commit
c0da83c5de
1 changed files with 3 additions and 0 deletions
|
@ -5,6 +5,8 @@ class RepositoryTableStateColumnUpdateService
|
|||
# record, has EVERYTHING (booleans, symbols, keys, ...) saved as Strings.
|
||||
|
||||
def update_states_with_new_column(repository)
|
||||
raise ArgumentError, 'repository is empty' if repository.blank?
|
||||
|
||||
RepositoryTableState.where(
|
||||
repository: repository
|
||||
).find_each do |table_state|
|
||||
|
@ -24,6 +26,7 @@ class RepositoryTableStateColumnUpdateService
|
|||
end
|
||||
|
||||
def update_states_with_removed_column(repository, old_column_index)
|
||||
raise ArgumentError, 'repository is empty' if repository.blank?
|
||||
raise ArgumentError, 'old_column_index is empty' if old_column_index.blank?
|
||||
|
||||
RepositoryTableState.where(
|
||||
|
|
Loading…
Reference in a new issue