spec/dummy/config/initializers/commontator.rb in commontator-4.1.2 vs spec/dummy/config/initializers/commontator.rb in commontator-4.2.0
- old
+ new
@@ -6,17 +6,18 @@
# Proc that is passed the current controller as argument
# Returns the current user
# Default: lambda { |controller| controller.current_user }
config.current_user_proc = lambda { |controller| controller.current_user }
- # Proc that is called after any javascript runs (e.g. to display/clear flash messages)
- # It is passed the view_context object (self from the view template), so you should be able to
- # access anything you normally could in a view template (by using, e.g. view.flash)
- # However, be aware that it does not have access to the main application's helpers
- # Should return a string containing JS to be appended to all Commontator JS responses
- # Default: lambda { |view| '$("#error_explanation").remove();' }
- config.javascript_proc = lambda { |view| '' }
+ # Proc called with the view_context object as argument
+ # Returns a string to be appended to all JavaScript responses from commontator
+ # Can be used, for example, to display/clear Rails error messages
+ # Objects visible in view templates can be accessed through
+ # the view_context object (for example, view_context.flash)
+ # However, the view_context does not include the main application's helpers
+ # Default: lambda { |view_context| '$("#error_explanation").remove();' }
+ config.javascript_proc = lambda { |view_context| '' }
# User (acts_as_commontator) Configuration
# Whether the comment creator's name is clickable in the comment view
@@ -112,14 +113,18 @@
# Whether to display upvotes and downvotes
# combined or separately
# Default: true
config.combine_upvotes_and_downvotes = true
- # Whether comments should be ordered by vote score
- # instead of by order posted
- # Default: false
- config.comments_ordered_by_votes = false
+ # What order to use for comments
+ # Valid values:
+ # :e (earliest comment first)
+ # :l (latest comment first)
+ # :ve (highest voted first; earliest first if tied)
+ # :vl (highest voted first; latest first if tied)
+ # Default: :e (earliest comment first)
+ config.comments_order = :e
# Whether users can read threads closed by moderators
# Default: true
config.closed_threads_are_readable = true
@@ -151,9 +156,17 @@
# Return the url that contains the commontable's thread to be used in the subscription email
# The application's routes can be accessed using the main_app object
# Default: lambda { |main_app, commontable| main_app.polymorphic_url(commontable) }
# (defaults to the commontable's show url)
config.commontable_url_proc = lambda { |main_app, commontable| main_app.polymorphic_url(commontable) }
+
+ # Proc called with params from the subscription mailer as arguments
+ # Returns the subscription email 'to' addresses
+ # Available params can be seen in the subscription mailer
+ # Note that the actual addresses are already set in the BCC field
+ # Default:
+ # lambda { |params| 'Undisclosed Recipients' }
+ config.subscription_email_to_proc = lambda { |params| 'Undisclosed Recipients' }
# Proc called with params from the subscription mailer as arguments
# Returns the subscription email 'from' address
# Available params can be seen in the subscription mailer
# Default: