Module: Opinio::Controllers::Extensions::InstanceMethods

Defined in:
lib/opinio/controllers/extensions.rb

Instance Method Summary (collapse)

Instance Method Details

- (Boolean) can_destroy_opinio?(opinio)



25
26
27
# File 'lib/opinio/controllers/extensions.rb', line 25

def can_destroy_opinio?(opinio)
  self.instance_exec(opinio, &Opinio.destroy_conditions)
end

- (Object) opinio_after_create_path(resource)



29
30
31
# File 'lib/opinio/controllers/extensions.rb', line 29

def opinio_after_create_path(resource)
  resource.is_a?(Opinio.model_name.constantize) ? resource.commentable : resource
end

- (Object) opinio_after_destroy_path(comment)



33
34
35
# File 'lib/opinio/controllers/extensions.rb', line 33

def opinio_after_destroy_path(comment)
  comment.commentable
end