trusty-cms 4.1.2 → 4.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -2
  3. data/Gemfile.lock +25 -25
  4. data/Rakefile +7 -7
  5. data/app/assets/stylesheets/admin/partials/_content.scss +1 -2
  6. data/app/controllers/admin/assets_controller.rb +22 -21
  7. data/app/controllers/admin/configuration_controller.rb +9 -11
  8. data/app/controllers/admin/extensions_controller.rb +3 -3
  9. data/app/controllers/admin/layouts_controller.rb +3 -4
  10. data/app/controllers/admin/page_attachments_controller.rb +5 -5
  11. data/app/controllers/admin/page_fields_controller.rb +3 -4
  12. data/app/controllers/admin/page_parts_controller.rb +4 -5
  13. data/app/controllers/admin/pages_controller.rb +55 -56
  14. data/app/controllers/admin/references_controller.rb +1 -1
  15. data/app/controllers/admin/resource_controller.rb +132 -130
  16. data/app/controllers/admin/sites_controller.rb +4 -4
  17. data/app/controllers/admin/snippets_controller.rb +3 -4
  18. data/app/controllers/admin/users_controller.rb +16 -16
  19. data/app/controllers/application_controller.rb +47 -48
  20. data/app/controllers/site_controller.rb +51 -48
  21. data/app/controllers/social_mailer_controller.rb +13 -16
  22. data/app/helpers/admin/configuration_helper.rb +19 -20
  23. data/app/helpers/admin/layouts_helper.rb +0 -1
  24. data/app/helpers/admin/node_helper.rb +27 -24
  25. data/app/helpers/admin/pages_helper.rb +2 -2
  26. data/app/helpers/admin/preferences_helper.rb +0 -1
  27. data/app/helpers/admin/references_helper.rb +9 -10
  28. data/app/helpers/admin/regions_helper.rb +3 -3
  29. data/app/helpers/application_helper.rb +32 -33
  30. data/app/helpers/rad_social_helper.rb +8 -11
  31. data/app/helpers/scoped_helper.rb +1 -3
  32. data/app/helpers/sites_helper.rb +4 -4
  33. data/app/mailers/devise_mailer.rb +3 -4
  34. data/app/mailers/rad_social_mailer.rb +8 -8
  35. data/app/models/asset.rb +62 -63
  36. data/app/models/asset_type.rb +38 -39
  37. data/app/models/deprecated_tags.rb +3 -4
  38. data/app/models/file_not_found_page.rb +1 -3
  39. data/app/models/haml_filter.rb +1 -1
  40. data/app/models/layout.rb +4 -5
  41. data/app/models/legacy_user.rb +2 -2
  42. data/app/models/menu_renderer.rb +16 -18
  43. data/app/models/page.rb +96 -93
  44. data/app/models/page_attachment.rb +1 -2
  45. data/app/models/page_context.rb +11 -12
  46. data/app/models/page_part.rb +3 -4
  47. data/app/models/rails_page.rb +10 -12
  48. data/app/models/site.rb +22 -21
  49. data/app/models/snippet.rb +6 -8
  50. data/app/models/snippet_finder.rb +3 -3
  51. data/app/models/snippet_tags.rb +4 -4
  52. data/app/models/standard_tags.rb +258 -252
  53. data/app/models/status.rb +8 -8
  54. data/app/models/trusty_cms/config.rb +25 -25
  55. data/app/models/trusty_cms/page_response_cache_director.rb +2 -3
  56. data/app/models/user.rb +15 -14
  57. data/app/models/user_action_observer.rb +3 -3
  58. data/bin/rails +4 -4
  59. data/bin/trusty_cms +3 -5
  60. data/config.ru +1 -1
  61. data/config/application.rb +14 -15
  62. data/config/boot.rb +1 -2
  63. data/config/environment.rb +1 -1
  64. data/config/environments/production.rb +0 -1
  65. data/config/environments/test.rb +1 -2
  66. data/config/initializers/devise.rb +1 -1
  67. data/config/initializers/kraken.rb +2 -2
  68. data/config/initializers/tmp.rb +1 -1
  69. data/config/initializers/trusty_cms_config.rb +48 -48
  70. data/config/routes.rb +6 -6
  71. data/lib/active_record_extensions/active_record_extensions.rb +1 -2
  72. data/lib/annotatable.rb +3 -5
  73. data/lib/configuration_extensions/configuration_extensions.rb +1 -1
  74. data/lib/inheritable_class_attributes.rb +13 -9
  75. data/lib/login_system.rb +73 -73
  76. data/lib/method_observer.rb +13 -12
  77. data/lib/ostruct.rb +7 -10
  78. data/lib/simpleton.rb +0 -4
  79. data/lib/string_extensions/string_extensions.rb +3 -3
  80. data/lib/symbol_extensions/symbol_extensions.rb +1 -1
  81. data/lib/tasks/database.rake +28 -28
  82. data/lib/tasks/extensions.rake +18 -18
  83. data/lib/tasks/framework.rake +68 -68
  84. data/lib/tasks/radiant_config.rake +4 -4
  85. data/lib/tasks/snippets_extension_tasks.rake +11 -11
  86. data/lib/tasks/translate.rake +14 -14
  87. data/lib/tasks/upgrade_to_devise.rake +1 -1
  88. data/lib/translation_support.rb +22 -22
  89. data/lib/trusty_cms.rb +2 -2
  90. data/lib/trusty_cms/admin_ui.rb +19 -16
  91. data/lib/trusty_cms/admin_ui/region_partials.rb +4 -3
  92. data/lib/trusty_cms/admin_ui/region_set.rb +4 -5
  93. data/lib/trusty_cms/available_locales.rb +2 -4
  94. data/lib/trusty_cms/config/definition.rb +11 -8
  95. data/lib/trusty_cms/engine.rb +14 -14
  96. data/lib/trusty_cms/extension.rb +14 -16
  97. data/lib/trusty_cms/extension_loader.rb +6 -6
  98. data/lib/trusty_cms/extension_migrator.rb +42 -41
  99. data/lib/trusty_cms/extension_path.rb +20 -19
  100. data/lib/trusty_cms/initializer.rb +5 -8
  101. data/lib/trusty_cms/pagination/controller.rb +7 -10
  102. data/lib/trusty_cms/pagination/link_renderer.rb +2 -2
  103. data/lib/trusty_cms/resource_responses.rb +3 -3
  104. data/lib/trusty_cms/setup.rb +130 -132
  105. data/lib/trusty_cms/taggable.rb +19 -22
  106. data/lib/trusty_cms/task_support.rb +9 -6
  107. data/public/dispatch.fcgi +1 -1
  108. data/public/dispatch.rb +2 -2
  109. data/script/extension +1 -1
  110. data/script/rails +2 -2
  111. data/trusty_cms.gemspec +23 -23
  112. metadata +32 -32
@@ -1,3 +1,2 @@
1
1
  module Admin::LayoutsHelper
2
-
3
2
  end
@@ -1,18 +1,16 @@
1
1
  module Admin::NodeHelper
2
-
3
2
  def render_nodes(page, starting_index, parent_index = nil, simple = false)
4
- @rendered_html = ""
3
+ @rendered_html = ''
5
4
  render_node page, starting_index, parent_index, simple
6
5
  @rendered_html
7
6
  end
8
7
 
9
8
  def render_node(page, index, parent_index = nil, simple = false)
10
-
11
9
  @current_node = prepare_page(page)
12
10
 
13
- @rendered_html += (render :partial => 'admin/pages/node',
14
- :locals => {level: index, index: index, parent_index: parent_index,
15
- page: page, simple: simple, branch: (page.children.count > 0) })
11
+ @rendered_html += (render partial: 'admin/pages/node',
12
+ locals: { level: index, index: index, parent_index: parent_index,
13
+ page: page, simple: simple, branch: (page.children.count > 0) })
16
14
  index
17
15
  end
18
16
 
@@ -35,14 +33,19 @@ module Admin::NodeHelper
35
33
 
36
34
  def expanded_rows
37
35
  unless @expanded_rows
38
- @expanded_rows = case
39
- when rows = cookies[:expanded_rows]
40
- rows.split(',').map { |x| Integer(x) rescue nil }.compact
41
- else
42
- []
36
+ @expanded_rows = if rows = cookies[:expanded_rows]
37
+ rows.split(',').map do |x|
38
+ begin
39
+ Integer(x)
40
+ rescue StandardError
41
+ nil
42
+ end
43
+ end .compact
44
+ else
45
+ []
43
46
  end
44
47
 
45
- if homepage and !@expanded_rows.include?(homepage.id)
48
+ if homepage && !@expanded_rows.include?(homepage.id)
46
49
  @expanded_rows << homepage.id
47
50
  end
48
51
  end
@@ -54,37 +57,37 @@ module Admin::NodeHelper
54
57
  end
55
58
 
56
59
  def expander(level)
57
- unless @current_node.children.empty? or level == 0
58
- image((expanded ? "collapse" : "expand"),
59
- :class => "expander", :alt => 'toggle children',
60
- :title => '')
60
+ if @current_node.children.empty? || (level == 0)
61
+ ''
61
62
  else
62
- ""
63
+ image((expanded ? 'collapse' : 'expand'),
64
+ class: 'expander', alt: 'toggle children',
65
+ title: '')
63
66
  end
64
67
  end
65
68
 
66
69
  def icon
67
70
  icon_name = @current_node.virtual? ? 'virtual_page' : 'page'
68
- image(icon_name, :class => "icon", :alt => '', :title => '')
71
+ image(icon_name, class: 'icon', alt: '', title: '')
69
72
  end
70
73
 
71
74
  def node_title
72
- %{<span class="title">#{ h(@current_node.title) }</span>}.html_safe
75
+ %{<span class="title">#{h(@current_node.title)}</span>}.html_safe
73
76
  end
74
77
 
75
78
  def page_type
76
79
  display_name = @current_node.class.display_name
77
80
  if display_name == 'Page'
78
- ""
81
+ ''
79
82
  else
80
- %{<span class="info">(#{ h(display_name) })</span>}.html_safe
83
+ %{<span class="info">(#{h(display_name)})</span>}.html_safe
81
84
  end
82
85
  end
83
86
 
84
87
  def spinner
85
88
  image('spinner.gif',
86
- :class => 'busy', :id => "busy_#{@current_node.id}",
87
- :alt => "", :title => "",
88
- :style => 'display: none;')
89
+ class: 'busy', id: "busy_#{@current_node.id}",
90
+ alt: '', title: '',
91
+ style: 'display: none;')
89
92
  end
90
93
  end
@@ -16,10 +16,10 @@ module Admin::PagesHelper
16
16
 
17
17
  def status_to_display
18
18
  @page.status_id = 100 if @page.status_id == 90
19
- @display_status = Status.selectable.map{ |s| [I18n.translate(s.name.downcase), s.id] }
19
+ @display_status = Status.selectable.map { |s| [I18n.translate(s.name.downcase), s.id] }
20
20
  end
21
21
 
22
22
  def clean_page_description(page)
23
- page.description.to_s.strip.gsub(/\t/,'').gsub(/\s+/,' ')
23
+ page.description.to_s.strip.gsub(/\t/, '').gsub(/\s+/, ' ')
24
24
  end
25
25
  end
@@ -1,3 +1,2 @@
1
1
  module Admin::PreferencesHelper
2
-
3
2
  end
@@ -1,27 +1,26 @@
1
- require "RedCloth"
1
+ require 'RedCloth'
2
2
 
3
3
  module Admin::ReferencesHelper
4
4
  def tag_reference
5
5
  String.new.tap do |output|
6
6
  class_of_page.tag_descriptions.sort.each do |tag_name, description|
7
- value = t("desc.#{tag_name.gsub(':','-')}").match('desc') ? description : t("desc.#{tag_name.gsub(':','-')}")
8
- output << render(:partial => "admin/references/tag_reference.haml",
9
- :locals => {:tag_name => tag_name,
10
- :description => RedCloth.new(TrustyCms::Taggable::Util.strip_leading_whitespace(value)).to_html
11
- })
7
+ value = t("desc.#{tag_name.gsub(':', '-')}").match('desc') ? description : t("desc.#{tag_name.gsub(':', '-')}")
8
+ output << render(partial: 'admin/references/tag_reference.haml',
9
+ locals: { tag_name: tag_name,
10
+ description: RedCloth.new(TrustyCms::Taggable::Util.strip_leading_whitespace(value)).to_html })
12
11
  end
13
12
  end
14
13
  end
15
14
 
16
15
  def filter_reference
17
- unless filter.blank?
16
+ if filter.blank?
17
+ 'There is no filter on the current page part.'
18
+ else
18
19
  if filter.description.blank?
19
- "There is no documentation on this filter."
20
+ 'There is no documentation on this filter.'
20
21
  else
21
22
  filter.description
22
23
  end
23
- else
24
- "There is no filter on the current page part."
25
24
  end
26
25
  end
27
26
 
@@ -1,14 +1,14 @@
1
1
  module Admin::RegionsHelper
2
- def render_region(region, options={}, &block)
2
+ def render_region(region, options = {}, &block)
3
3
  lazy_initialize_region_set
4
4
  default_partials = TrustyCms::AdminUI::RegionPartials.new(self)
5
5
  if block_given?
6
6
  block.call(default_partials)
7
- (options[:locals] ||= {}).merge!(:defaults => default_partials)
7
+ (options[:locals] ||= {}).merge!(defaults: default_partials)
8
8
  end
9
9
  output = @region_set[region].compact.map do |partial|
10
10
  begin
11
- render options.merge(:partial => partial)
11
+ render options.merge(partial: partial)
12
12
  rescue ::ActionView::MissingTemplate # couldn't find template
13
13
  default_partials[partial]
14
14
  rescue ::ActionView::TemplateError => e # error in template
@@ -22,26 +22,26 @@ module ApplicationHelper
22
22
  end
23
23
 
24
24
  def onsubmit_status(model)
25
- model.new_record? ? t('creating_status', :model => t(model.class.name.downcase)) : "#{I18n.t('saving_changes')}&#8230;"
25
+ model.new_record? ? t('creating_status', model: t(model.class.name.downcase)) : "#{I18n.t('saving_changes')}&#8230;"
26
26
  end
27
27
 
28
28
  def save_model_button(model, options = {})
29
29
  model_name = model.class.name.underscore
30
30
  human_model_name = model_name.humanize.titlecase
31
31
  options[:label] ||= model.new_record? ?
32
- t('buttons.create', :name => t(model_name, :default => human_model_name), :default => 'Create ' + human_model_name) :
33
- t('buttons.save_changes', :default => 'Save Changes')
34
- options[:class] ||= "button"
32
+ t('buttons.create', name: t(model_name, default: human_model_name), default: 'Create ' + human_model_name) :
33
+ t('buttons.save_changes', default: 'Save Changes')
34
+ options[:class] ||= 'button'
35
35
  options[:accesskey] ||= 'S'
36
36
  submit_tag options.delete(:label), options
37
37
  end
38
38
 
39
- def save_model_and_continue_editing_button(model)
40
- submit_tag t('buttons.save_and_continue'), :name => 'continue', :class => 'button', :accesskey => "s"
39
+ def save_model_and_continue_editing_button(_model)
40
+ submit_tag t('buttons.save_and_continue'), name: 'continue', class: 'button', accesskey: 's'
41
41
  end
42
42
 
43
43
  def current_item?(item)
44
- if item.tab && item.tab.many? {|i| current_url?(i.relative_url) }
44
+ if item.tab&.many? { |i| current_url?(i.relative_url) }
45
45
  # Accept only stricter URL matches if more than one matches
46
46
  current_page?(item.url)
47
47
  else
@@ -50,7 +50,7 @@ module ApplicationHelper
50
50
  end
51
51
 
52
52
  def current_tab?(tab)
53
- @current_tab ||= tab if tab.any? {|item| current_url?(item.relative_url) }
53
+ @current_tab ||= tab if tab.any? { |item| current_url?(item.relative_url) }
54
54
  @current_tab == tab
55
55
  end
56
56
 
@@ -70,7 +70,7 @@ module ApplicationHelper
70
70
  end
71
71
 
72
72
  def admin?
73
- current_user and current_user.admin?
73
+ current_user&.admin?
74
74
  end
75
75
 
76
76
  def designer?
@@ -82,7 +82,7 @@ module ApplicationHelper
82
82
  updated_by = (model.updated_by || model.created_by)
83
83
  name = updated_by ? updated_by.name : nil
84
84
  time = (model.updated_at || model.created_at)
85
- if name or time
85
+ if name || time
86
86
  html = %{<div class="updated_line">#{t('timestamp.last_updated')} }
87
87
  html << %{#{t('timestamp.by')} <strong>#{name}</strong> } if name
88
88
  html << %{#{t('timestamp.at')} #{timestamp(time)}} if time
@@ -94,7 +94,7 @@ module ApplicationHelper
94
94
 
95
95
  def timestamp(time)
96
96
  # time.strftime("%I:%M %p on %B %e, %Y").sub("AM", 'am').sub("PM", 'pm')
97
- I18n.localize(time, :format => :timestamp)
97
+ I18n.localize(time, format: :timestamp)
98
98
  end
99
99
 
100
100
  def meta_errors?
@@ -122,11 +122,11 @@ module ApplicationHelper
122
122
  end
123
123
 
124
124
  def translate_with_default(name)
125
- t(name.underscore.downcase, :default => name)
125
+ t(name.underscore.downcase, default: name)
126
126
  end
127
127
 
128
128
  def available_locales_select
129
- [[t('select.default'),'']] + TrustyCms::AvailableLocales.locales
129
+ [[t('select.default'), '']] + TrustyCms::AvailableLocales.locales
130
130
  end
131
131
 
132
132
  def stylesheet_overrides
@@ -147,12 +147,12 @@ module ApplicationHelper
147
147
 
148
148
  # Returns a Gravatar URL associated with the email parameter.
149
149
  # See: http://douglasfshearer.com/blog/gravatar-for-ruby-and-ruby-on-rails
150
- def gravatar_url(email, options={})
150
+ def gravatar_url(email, options = {})
151
151
  # Default to highest rating. Rating can be one of G, PG, R X.
152
- options[:rating] ||= "G"
152
+ options[:rating] ||= 'G'
153
153
 
154
154
  # Default size of the image.
155
- options[:size] ||= "32px"
155
+ options[:size] ||= '32px'
156
156
 
157
157
  # Default image url to be used when no gravatar is found
158
158
  # or when an image exceeds the rating parameter.
@@ -160,7 +160,9 @@ module ApplicationHelper
160
160
  default_avatar_url = "#{request.protocol}#{request.host_with_port}#{ActionController::Base.relative_url_root}#{local_avatar_url}"
161
161
  options[:default] ||= default_avatar_url
162
162
 
163
- unless email.blank?
163
+ if email.blank?
164
+ local_avatar_url
165
+ else
164
166
  # Build the Gravatar url.
165
167
  url = '//gravatar.com/avatar/'
166
168
  url << "#{Digest::MD5.new.update(email)}?"
@@ -169,31 +171,29 @@ module ApplicationHelper
169
171
  url << "&default=#{options[:default]}" if options[:default]
170
172
  # Test the Gravatar url
171
173
  require 'open-uri'
172
- begin; open "http:#{url}", :proxy => true
173
- rescue; local_avatar_url
174
+ begin; open "http:#{url}", proxy: true
175
+ rescue StandardError; local_avatar_url
174
176
  else; url
175
177
  end
176
- else
177
- local_avatar_url
178
178
  end
179
179
  end
180
180
 
181
181
  # returns the usual set of pagination links.
182
182
  # options are passed through to will_paginate
183
183
  # and a 'show all' depagination link is added if relevant.
184
- def pagination_for(list, options={})
184
+ def pagination_for(list, options = {})
185
185
  if list.respond_to? :total_pages
186
186
  options = {
187
- :max_per_page => @trusty_config['pagination.max_per_page'] || 500,
188
- :depaginate => true
187
+ max_per_page: @trusty_config['pagination.max_per_page'] || 500,
188
+ depaginate: true,
189
189
  }.merge(options.symbolize_keys)
190
190
  depaginate = options.delete(:depaginate) # supply :depaginate => false to omit the 'show all' link
191
191
  depagination_limit = options.delete(:max_per_page) # supply :max_per_page => false to include the 'show all' link no matter how large the collection
192
192
  html = will_paginate(list, will_paginate_options.merge(options))
193
193
  if depaginate && list.total_pages > 1 && (!depagination_limit.blank? || list.total_entries <= depagination_limit.to_i)
194
- html << content_tag(:div, link_to(t('show_all'), :pp => 'all'), :class => 'depaginate')
194
+ html << content_tag(:div, link_to(t('show_all'), pp: 'all'), class: 'depaginate')
195
195
  elsif depaginate && list.total_entries > depagination_limit.to_i
196
- html = content_tag(:div, link_to("paginate", :p => 1), :class => 'pagination')
196
+ html = content_tag(:div, link_to('paginate', p: 1), class: 'pagination')
197
197
  end
198
198
  html
199
199
  end
@@ -201,12 +201,11 @@ module ApplicationHelper
201
201
 
202
202
  private
203
203
 
204
- def append_image_extension(name)
205
- unless name =~ /\.(.*?)$/
206
- name + '.png'
207
- else
208
- name
204
+ def append_image_extension(name)
205
+ if name =~ /\.(.*?)$/
206
+ name
207
+ else
208
+ name + '.png'
209
209
  end
210
- end
211
-
210
+ end
212
211
  end
@@ -1,7 +1,6 @@
1
1
  module RadSocialHelper
2
-
3
2
  def rad_test_method
4
- "SURPRISE SURPRISE SURPRISE"
3
+ 'SURPRISE SURPRISE SURPRISE'
5
4
  end
6
5
 
7
6
  def rad_share_widget(options)
@@ -9,15 +8,13 @@ module RadSocialHelper
9
8
  message = options[:message].nil? ? "Check out #{options[:title]}." : options[:message]
10
9
  email_subject = options[:email_subject].nil? ? options[:title] : options[:email_subject]
11
10
  email_message = options[:email_message].nil? ? "I thought you might be interested in this: #{url}" : "#{options[:email_message]} #{url}"
12
- email_action_url = options[:email_action_url].nil? ? "/rad_social/mail" : options[:email_action_url]
11
+ email_action_url = options[:email_action_url].nil? ? '/rad_social/mail' : options[:email_action_url]
13
12
 
14
- render :partial => "widget/horizontal_widget",
15
- :locals => { :url => url,
16
- :message => message,
17
- :email_subject => email_subject,
18
- :email_message => email_message,
19
- :email_action_url => email_action_url
20
- }
13
+ render partial: 'widget/horizontal_widget',
14
+ locals: { url: url,
15
+ message: message,
16
+ email_subject: email_subject,
17
+ email_message: email_message,
18
+ email_action_url: email_action_url }
21
19
  end
22
-
23
20
  end
@@ -1,9 +1,8 @@
1
1
  module ScopedHelper
2
2
  def self.included(base)
3
-
4
3
  base.module_eval do
5
4
  def title
6
- t = current_site.name
5
+ t = current_site.name
7
6
  t = TrustyCms::Config['admin.title'] || 'TrustyCMS' if t.blank?
8
7
  t
9
8
  end
@@ -13,7 +12,6 @@ module ScopedHelper
13
12
  st = TrustyCms::Config['admin.subtitle'] || 'publishing for small teams' if st.blank?
14
13
  st
15
14
  end
16
-
17
15
  end
18
16
  end
19
17
  end
@@ -1,10 +1,10 @@
1
1
  module SitesHelper
2
2
  def order_links(site)
3
3
  String.new.tap do |output|
4
- output << link_to(image("move_to_top.png", :alt => "Move to top"), move_to_top_admin_site_path(site), :method => :put)
5
- output << link_to(image("move_higher.png", :alt => "Move up"), move_higher_admin_site_path(site), :method => :post)
6
- output << link_to(image("move_lower.png", :alt => "Move down"), move_lower_admin_site_path(site), :method => :post)
7
- output << link_to(image("move_to_bottom.png", :alt => "Move to bottom"), move_to_bottom_admin_site_path(site), :method => :put)
4
+ output << link_to(image('move_to_top.png', alt: 'Move to top'), move_to_top_admin_site_path(site), method: :put)
5
+ output << link_to(image('move_higher.png', alt: 'Move up'), move_higher_admin_site_path(site), method: :post)
6
+ output << link_to(image('move_lower.png', alt: 'Move down'), move_lower_admin_site_path(site), method: :post)
7
+ output << link_to(image('move_to_bottom.png', alt: 'Move to bottom'), move_to_bottom_admin_site_path(site), method: :put)
8
8
  end
9
9
  end
10
10
  end
@@ -1,8 +1,7 @@
1
1
  class DeviseMailer < Devise::Mailer
2
-
3
- def reset_password_instructions(record, token, opts={})
2
+ def reset_password_instructions(record, token, opts = {})
4
3
  mail = super
5
- mail.subject = "Reset Password for TrustyCMS"
4
+ mail.subject = 'Reset Password for TrustyCMS'
6
5
  mail
7
- end
6
+ end
8
7
  end
@@ -3,7 +3,7 @@ require 'roadie-rails'
3
3
  class RadSocialMailer < ApplicationMailer
4
4
  include Roadie::Rails::Automatic
5
5
 
6
- def social_mail options
6
+ def social_mail(options)
7
7
  from_address = Mail::Address.new options[:from] # ex: "john@example.com"
8
8
  from_address.display_name = options[:from_name] # ex: "John Doe"
9
9
 
@@ -14,12 +14,12 @@ class RadSocialMailer < ApplicationMailer
14
14
  @actual_from = from_address if @actual_from.nil?
15
15
 
16
16
  mail({
17
- to: options[:to],
18
- from: @actual_from,
19
- reply_to: @from_email,
20
- subject: options[:subject],
21
- text: @message,
22
- content_type: "text/html"
23
- })
17
+ to: options[:to],
18
+ from: @actual_from,
19
+ reply_to: @from_email,
20
+ subject: options[:subject],
21
+ text: @message,
22
+ content_type: 'text/html',
23
+ })
24
24
  end
25
25
  end