Module: Opinio

Defined in:
lib/opinio.rb,
lib/opinio/rails.rb,
lib/opinio/schema.rb,
lib/opinio/version.rb,
lib/opinio/railtie.rb,
lib/opinio/opinio_model.rb,
lib/opinio/opinio_subjectum.rb,
lib/opinio/orm/active_record.rb,
lib/opinio/controllers/replies.rb,
lib/opinio/controllers/helpers.rb,
lib/opinio/controllers/extensions.rb,
lib/opinio/opinio_model/validations.rb,
lib/opinio/controllers/internal_helpers.rb,
lib/opinio/controllers/current_commenter.rb,
lib/generators/opinio/views/views_generator.rb,
lib/generators/opinio/install/install_generator.rb

Defined Under Namespace

Modules: Controllers, Generators, OpinioModel, OpinioSubjectum, Orm, Schema Classes: CommentsController, Engine, Railtie, Version

Constant Summary

@@model_name =
"Comment"
@@owner_class_name =
"User"
@@use_title =
false
@@accept_replies =
false
@@custom_identifiers =
Array.new
@@interval_between_comments =
false
@@destroy_conditions =
Proc.new { false }
@@current_user_method =
:current_user
@@strip_html_tags_on_save =
true
@@sort_order =
'DESC'
@@set_flash =
true

Class Method Summary collapse

Class Method Details

.check_custom_identifiers(params) ⇒ Object



60
61
62
63
64
65
66
# File 'lib/opinio.rb', line 60

def self.check_custom_identifiers(params)
  self.custom_identifiers.each do |identifier|
    identified = identifier.call(params)
    return identified unless identified.nil?
  end
  nil
end

.opinio_identifier(block) ⇒ Object



52
53
54
# File 'lib/opinio.rb', line 52

def self.opinio_identifier(block)
  @@custom_identifiers << block
end

.set_destroy_conditions(&block) ⇒ Object



56
57
58
# File 'lib/opinio.rb', line 56

def self.set_destroy_conditions(&block)
  @@destroy_conditions = block
end

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Opinio)

    the object that the method was called on



48
49
50
# File 'lib/opinio.rb', line 48

def self.setup
  yield self
end