Module: Polivalente::Visibility

Extended by:
ActiveSupport::Concern
Defined in:
app/models/concerns/polivalente/visibility.rb

Instance Method Summary collapse

Instance Method Details

#public?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'app/models/concerns/polivalente/visibility.rb', line 20

def public?
  !is_private
end

#set_privateObject



12
13
14
# File 'app/models/concerns/polivalente/visibility.rb', line 12

def set_private
  update_attribute :is_private, true
end

#set_publicObject



16
17
18
# File 'app/models/concerns/polivalente/visibility.rb', line 16

def set_public
  update_attribute :is_private, false
end