Update topic.rb
This commit is contained in:
parent
2c6da79df3
commit
479ccc9fd3
1 changed files with 5 additions and 0 deletions
|
@ -16,6 +16,7 @@ class Topic < ApplicationRecord
|
|||
|
||||
belongs_to :metacode
|
||||
|
||||
before_create :set_perm_by_defer
|
||||
before_create :create_metamap?
|
||||
after_update :after_updated
|
||||
|
||||
|
@ -134,6 +135,10 @@ class Topic < ApplicationRecord
|
|||
|
||||
protected
|
||||
|
||||
def set_perm_by_defer
|
||||
permission = defer_to_map.permission if defer_to_map
|
||||
end
|
||||
|
||||
def create_metamap?
|
||||
return unless (link == '') && (metacode.name == 'Metamap')
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue