mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-04 19:53:19 +08:00
change to after_create
This commit is contained in:
parent
87dc76f4e3
commit
227fe9c284
2 changed files with 2 additions and 2 deletions
|
@ -15,7 +15,7 @@ class CustomField < ActiveRecord::Base
|
|||
class_name: 'User'
|
||||
has_many :sample_custom_fields, inverse_of: :custom_field
|
||||
|
||||
after_initialize :update_samples_table_state, if: :new_record?
|
||||
after_create :update_samples_table_state
|
||||
|
||||
def update_samples_table_state
|
||||
samples_table = SamplesTable.where(user: user,
|
||||
|
|
|
@ -10,7 +10,7 @@ class UserOrganization < ActiveRecord::Base
|
|||
belongs_to :organization, inverse_of: :user_organizations
|
||||
|
||||
before_destroy :destroy_associations
|
||||
after_initialize :create_samples_table_state, if: :new_record?
|
||||
after_create :create_samples_table_state
|
||||
|
||||
def role_str
|
||||
I18n.t("user_organizations.enums.role.#{role.to_s}")
|
||||
|
|
Loading…
Reference in a new issue