spec/dummy/config/initializers/commontator.rb in commontator-1.0.6 vs spec/dummy/config/initializers/commontator.rb in commontator-1.1.0
- old
+ new
@@ -6,16 +6,16 @@
# Name of the ApplicationController helper method that returns the current user
# Default: 'current_user'
config.current_user_method = 'current_user'
- # Proc that is called after any javascript runs (e.g. to clear flash)
+ # 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)
# 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| 'Dummy Javascript' }
+ # Default: lambda { |view| '$("#error_explanation").hide();' }
+ config.javascript_proc = lambda { |view| '' }
# User (acts_as_commontator) Configuration
# The name used if the user's name cannot be retrieved
@@ -24,15 +24,10 @@
# Whether the comment creator's name is clickable in the comment view
# If enabled, the link will point to the comment creator's show page
# Default: false
config.user_name_clickable = false
-
- # Whether automated emails are sent to the user whenever
- # a comment is posted on a thread they subscribe to
- # Default: true
- config.subscription_emails = true
# The method that returns the user's email address
# Default: 'email'
config.user_email_method = 'email'
@@ -43,10 +38,15 @@
# Proc called with user as argument that returns true if the user is an admin
# Admins can always delete other users' comments and close threads
# Note: user can be nil
# Default: lambda { |user| false } (no admins)
config.user_admin_proc = lambda { |user| user.try(:is_admin) }
+
+ # Proc called with user as argument that returns true
+ # if the user should receive subscription emails
+ # Default: lambda { |user| true } (always receive subscription emails)
+ config.subscription_email_enable_proc = lambda { |user| true }
# Commontable (acts_as_commontable) Configuration
# What a comment is called in your application
@@ -143,10 +143,15 @@
# (defaults to the commontable show url)
# Main application's routes can be accessed using main_app object
# Default: lambda { |main_app, commontable| main_app.polymorphic_url(commontable) }
config.commontable_url_proc = lambda { |main_app, commontable| main_app.polymorphic_url(commontable) }
- # Proc that returns the subscription email subject string
+ # Proc that returns the subscription email 'from' address
+ # Default:
+ # lambda { |params| 'no-reply@example.com' }
+ config.subscription_email_from_proc = lambda { |params| 'no-reply@example.com' }
+
+ # Proc that returns the subscription email 'subject' string
# Default:
# lambda do |params|
# "#{params[:creator_name]} #{params[:config].comment_create_verb_past} a " + \
# "#{params[:config].comment_name} on #{params[:commontable_name]} #{params[:commontable_id]}"
# end