Update synapse.rb
This commit is contained in:
parent
479ccc9fd3
commit
3f75e436ba
1 changed files with 7 additions and 0 deletions
|
@ -22,6 +22,7 @@ class Synapse < ApplicationRecord
|
|||
where(topic1_id: topic_id).or(where(topic2_id: topic_id))
|
||||
}
|
||||
|
||||
before_create :set_perm_by_defer
|
||||
after_update :after_updated
|
||||
|
||||
delegate :name, to: :user, prefix: true
|
||||
|
@ -62,6 +63,12 @@ class Synapse < ApplicationRecord
|
|||
output += %(\n)
|
||||
output
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def set_perm_by_defer
|
||||
permission = defer_to_map.permission if defer_to_map
|
||||
end
|
||||
|
||||
def after_updated
|
||||
attrs = %w(desc category permission defer_to_map_id)
|
||||
|
|
Loading…
Add table
Reference in a new issue