change to after_create

This commit is contained in:
Mojca Lorber 2016-12-07 17:43:00 +01:00
parent 87dc76f4e3
commit 227fe9c284
2 changed files with 2 additions and 2 deletions

View file

@ -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,

View file

@ -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}")