blacklight 5.13.0 → 5.13.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +16 -0
  3. data/.rubocop_hound.yml +1063 -0
  4. data/.rubocop_todo.yml +253 -0
  5. data/.travis.yml +7 -9
  6. data/Rakefile +1 -1
  7. data/VERSION +1 -1
  8. data/app/helpers/blacklight/blacklight_helper_behavior.rb +9 -13
  9. data/app/helpers/blacklight/catalog_helper_behavior.rb +14 -3
  10. data/app/helpers/blacklight/configuration_helper_behavior.rb +1 -1
  11. data/app/helpers/blacklight/facets_helper_behavior.rb +13 -13
  12. data/app/helpers/blacklight/render_partials_helper.rb +3 -0
  13. data/app/helpers/blacklight/search_history_constraints_helper_behavior.rb +3 -5
  14. data/app/helpers/blacklight/url_helper_behavior.rb +1 -1
  15. data/app/helpers/blacklight_configuration_helper.rb +1 -1
  16. data/app/helpers/blacklight_url_helper.rb +1 -1
  17. data/app/helpers/component_helper.rb +1 -1
  18. data/app/models/bookmark.rb +1 -1
  19. data/app/models/search.rb +2 -2
  20. data/app/views/catalog/_bookmark_control.html.erb +1 -1
  21. data/app/views/catalog/_document_default.atom.builder +2 -2
  22. data/app/views/catalog/_document_default.rss.builder +3 -3
  23. data/blacklight.gemspec +1 -1
  24. data/lib/blacklight.rb +10 -10
  25. data/lib/blacklight/bookmarks.rb +11 -10
  26. data/lib/blacklight/catalog.rb +7 -15
  27. data/lib/blacklight/catalog/component_configuration.rb +1 -1
  28. data/lib/blacklight/catalog/search_context.rb +1 -1
  29. data/lib/blacklight/configuration.rb +3 -3
  30. data/lib/blacklight/configuration/tool_config.rb +1 -1
  31. data/lib/blacklight/configuration/view_config.rb +1 -1
  32. data/lib/blacklight/controller.rb +0 -1
  33. data/lib/blacklight/document/active_model_shim.rb +1 -1
  34. data/lib/blacklight/document/dublin_core.rb +11 -6
  35. data/lib/blacklight/document/export.rb +5 -13
  36. data/lib/blacklight/document/schema_org.rb +1 -1
  37. data/lib/blacklight/document/semantic_fields.rb +9 -13
  38. data/lib/blacklight/document_presenter.rb +2 -2
  39. data/lib/blacklight/engine.rb +11 -0
  40. data/lib/blacklight/exceptions.rb +2 -2
  41. data/lib/blacklight/solr/document.rb +1 -2
  42. data/lib/blacklight/solr/document/more_like_this.rb +1 -1
  43. data/lib/blacklight/solr/document/schema_org.rb +1 -1
  44. data/lib/blacklight/solr/facet_paginator.rb +8 -5
  45. data/lib/blacklight/solr/request.rb +2 -3
  46. data/lib/blacklight/solr/search_builder_behavior.rb +14 -7
  47. data/lib/blacklight/solr_repository.rb +3 -3
  48. data/lib/blacklight/solr_response.rb +1 -1
  49. data/lib/blacklight/solr_response/group.rb +1 -1
  50. data/lib/blacklight/solr_response/group_response.rb +1 -1
  51. data/lib/blacklight/solr_response/more_like_this.rb +1 -1
  52. data/lib/blacklight/solr_response/pagination_methods.rb +1 -1
  53. data/lib/blacklight/solr_response/spelling.rb +1 -3
  54. data/lib/blacklight/token_based_user.rb +1 -3
  55. data/lib/blacklight/user.rb +1 -1
  56. data/lib/generators/blacklight/assets_generator.rb +22 -7
  57. data/lib/railties/blacklight.rake +5 -5
  58. data/spec/controllers/bookmarks_controller_spec.rb +1 -1
  59. data/spec/helpers/catalog_helper_spec.rb +3 -3
  60. data/spec/lib/blacklight/solr_response/facets_spec.rb +2 -2
  61. data/spec/lib/blacklight/solr_response/group_response_spec.rb +1 -1
  62. data/spec/lib/blacklight/solr_response/group_spec.rb +1 -1
  63. metadata +5 -2
@@ -20,11 +20,9 @@ module Blacklight::SearchHistoryConstraintsHelperBehavior
20
20
  # Render the search query constraint
21
21
  def render_search_to_s_q(params)
22
22
  return "".html_safe if params['q'].blank?
23
-
24
- label = (default_search_field && params[:search_field] == default_search_field[:key]) ?
25
- nil :
26
- label_for_search_field(params[:search_field])
27
-
23
+
24
+ label = label_for_search_field(params[:search_field]) unless default_search_field && params[:search_field] == default_search_field[:key]
25
+
28
26
  render_search_to_s_element(label , render_filter_value(params['q']) )
29
27
  end
30
28
 
@@ -25,7 +25,7 @@ module Blacklight::UrlHelperBehavior
25
25
  # catalog_path accepts a HashWithIndifferentAccess object. The solr query params are stored in the session,
26
26
  # so we only need the +counter+ param here. We also need to know if we are viewing to document as part of search results.
27
27
  def link_to_document(doc, field_or_opts = nil, opts={:counter => nil})
28
- if field_or_opts.kind_of? Hash
28
+ if field_or_opts.is_a? Hash
29
29
  opts = field_or_opts
30
30
  if opts[:label]
31
31
  Deprecation.warn self, "The second argument to link_to_document should now be the label."
@@ -1,3 +1,3 @@
1
1
  module BlacklightConfigurationHelper
2
2
  include Blacklight::ConfigurationHelperBehavior
3
- end
3
+ end
@@ -1,3 +1,3 @@
1
1
  module BlacklightUrlHelper
2
2
  include Blacklight::UrlHelperBehavior
3
- end
3
+ end
@@ -1,3 +1,3 @@
1
1
  module ComponentHelper
2
2
  include Blacklight::ComponentHelperBehavior
3
- end
3
+ end
@@ -4,7 +4,7 @@ class Bookmark < ActiveRecord::Base
4
4
  belongs_to :user, polymorphic: true
5
5
  belongs_to :document, polymorphic: true
6
6
 
7
- validates_presence_of :user_id, :scope=>:document_id
7
+ validates :user_id, presence: true
8
8
 
9
9
  if Blacklight::Utils.needs_attr_accessible?
10
10
  attr_accessible :id, :document_id, :document_type, :title
@@ -11,7 +11,7 @@ class Search < ActiveRecord::Base
11
11
 
12
12
  unless respond_to?(:none)
13
13
  # polyfill
14
- scope :none, where(id: nil).where("id IS NOT ?", nil)
14
+ scope :none, -> { where(id: nil).where("id IS NOT ?", nil) }
15
15
  end
16
16
 
17
17
  # A Search instance is considered a saved search if it has a user_id.
@@ -23,7 +23,7 @@ class Search < ActiveRecord::Base
23
23
  def self.delete_old_searches(days_old)
24
24
  raise ArgumentError.new('days_old is expected to be a number') unless days_old.is_a?(Numeric)
25
25
  raise ArgumentError.new('days_old is expected to be greater than 0') if days_old <= 0
26
- self.destroy_all(['created_at < ? AND user_id IS NULL', Date.today - days_old])
26
+ self.destroy_all(['created_at < ? AND user_id IS NULL', Time.zone.today - days_old])
27
27
  end
28
28
 
29
29
  end
@@ -4,7 +4,7 @@
4
4
  # but it was simpler to leave them seperate instead of DRYing them, got confusing trying that.
5
5
  # the data-doc-id attribute is used by our JS that converts to a checkbox/label.
6
6
  -%>
7
- <% unless is_bookmarked? document %>
7
+ <% unless bookmarked? document %>
8
8
 
9
9
  <%= form_tag( bookmark_path( document ), :method => :put, :class => "bookmark_toggle", "data-doc-id" => document.id, :'data-present' => t('blacklight.search.bookmarks.present'), :'data-absent' => t('blacklight.search.bookmarks.absent'), :'data-inprogress' => t('blacklight.search.bookmarks.inprogress')) do %>
10
10
  <%= submit_tag(t('blacklight.bookmarks.add.button'), :id => "bookmark_toggle_#{document.id.to_s.parameterize}", :class => "bookmark_add") %>
@@ -14,8 +14,8 @@ xml.entry do
14
14
  xml.id polymorphic_url(url_for_document(document))
15
15
 
16
16
 
17
- if document.to_semantic_values[:author][0]
18
- xml.author { xml.name(document.to_semantic_values[:author][0]) }
17
+ if document.to_semantic_values.key? :author
18
+ xml.author { xml.name(document.to_semantic_values[:author].first) }
19
19
  end
20
20
 
21
21
  with_format("html") do
@@ -1,5 +1,5 @@
1
1
  xml.item do
2
- xml.title( document.to_semantic_values[:title][0] || presenter(document).render_document_index_label(document_show_link_field(document)) )
3
- xml.link(polymorphic_url(url_for_document(document)))
4
- xml.author( document.to_semantic_values[:author][0] ) if document.to_semantic_values[:author][0]
2
+ xml.title(presenter(document).render_document_index_label(document_show_link_field(document)) || (document.to_semantic_values[:title].first if document.to_semantic_values.key?(:title)))
3
+ xml.link(polymorphic_url(url_for_document(document)))
4
+ xml.author( document.to_semantic_values[:author].first ) if document.to_semantic_values.key? :author
5
5
  end
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
9
9
  s.email = ["blacklight-development@googlegroups.com"]
10
10
  s.homepage = "http://projectblacklight.org/"
11
11
  s.summary = "Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr) index."
12
- s.description = %q{Blacklight is an open source Solr user interface discovery platform. You can use Blacklight to enable searching and browsing of your collections. Blacklight uses the Apache Solr search engine to search full text and/or metadata.}
12
+ s.description = %{Blacklight is an open source Solr user interface discovery platform. You can use Blacklight to enable searching and browsing of your collections. Blacklight uses the Apache Solr search engine to search full text and/or metadata.}
13
13
  s.license = "Apache 2.0"
14
14
 
15
15
  s.files = `git ls-files`.split("\n")
@@ -52,11 +52,11 @@ module Blacklight
52
52
 
53
53
  # @deprecated
54
54
  def self.solr_file
55
- "#{::Rails.root.to_s}/config/solr.yml"
55
+ "#{::Rails.root}/config/solr.yml"
56
56
  end
57
57
 
58
58
  def self.blacklight_config_file
59
- "#{::Rails.root.to_s}/config/blacklight.yml"
59
+ "#{::Rails.root}/config/blacklight.yml"
60
60
  end
61
61
 
62
62
  def self.add_routes(router, options = {})
@@ -100,14 +100,14 @@ module Blacklight
100
100
 
101
101
  begin
102
102
  blacklight_erb = ERB.new(IO.read(blacklight_config_file)).result(binding)
103
- rescue Exception => e
104
- raise("#{blacklight_config_file} was found, but could not be parsed with ERB. \n#{$!.inspect}")
103
+ rescue StandardError, SyntaxError => e
104
+ raise("#{blacklight_config_file} was found, but could not be parsed with ERB. \n#{e.inspect}")
105
105
  end
106
106
 
107
107
  begin
108
108
  @blacklight_yml = YAML::load(blacklight_erb)
109
- rescue StandardError => e
110
- raise("#{blacklight_config_file} was found, but could not be parsed.\n")
109
+ rescue => e
110
+ raise("#{blacklight_config_file} was found, but could not be parsed.\n#{e.inspect}")
111
111
  end
112
112
 
113
113
  if @blacklight_yml.nil? || !@blacklight_yml.is_a?(Hash)
@@ -128,14 +128,14 @@ module Blacklight
128
128
 
129
129
  begin
130
130
  @solr_erb = ERB.new(IO.read(solr_file)).result(binding)
131
- rescue Exception => e
132
- raise("solr.yml was found, but could not be parsed with ERB. \n#{$!.inspect}")
131
+ rescue StandardError, SyntaxError => e
132
+ raise("solr.yml was found, but could not be parsed with ERB. \n#{e.inspect}")
133
133
  end
134
134
 
135
135
  begin
136
136
  @solr_yml = YAML::load(@solr_erb)
137
- rescue StandardError => e
138
- raise("solr.yml was found, but could not be parsed.\n")
137
+ rescue => e
138
+ raise("solr.yml was found, but could not be parsed.\n#{e.inspect}")
139
139
  end
140
140
 
141
141
  if @solr_yml.nil? || !@solr_yml.is_a?(Hash)
@@ -98,20 +98,21 @@ module Blacklight::Bookmarks
98
98
  # Beware, :id is the Solr document_id, not the actual Bookmark id.
99
99
  # idempotent, as DELETE is supposed to be.
100
100
  def destroy
101
- bookmark = current_or_guest_user.bookmarks.where(document_id: params[:id], document_type: blacklight_config.document_model).first
101
+ bookmark = current_or_guest_user.bookmarks.find_by(document_id: params[:id], document_type: blacklight_config.document_model)
102
102
 
103
- success = bookmark && bookmark.delete && bookmark.destroyed?
104
-
105
- unless request.xhr?
106
- if success
107
- flash[:notice] = I18n.t('blacklight.bookmarks.remove.success')
103
+ if bookmark && bookmark.delete && bookmark.destroyed?
104
+ if request.xhr?
105
+ render(json: { bookmarks: { count: current_or_guest_user.bookmarks.count }})
108
106
  else
109
- flash[:error] = I18n.t('blacklight.bookmarks.remove.failure')
107
+ redirect_to :back, notice: I18n.t('blacklight.bookmarks.remove.success')
110
108
  end
111
- redirect_to :back
112
109
  else
113
- # ajaxy request needs no redirect and should not have flash set
114
- success ? render(json: { bookmarks: { count: current_or_guest_user.bookmarks.count }}) : render(:text => "", :status => "500")
110
+ if request.xhr?
111
+ # ajaxy request needs no redirect and should not have flash set
112
+ render(:text => "", :status => "500")
113
+ else
114
+ redirect_to :back, flash: { error: I18n.t('blacklight.bookmarks.remove.failure') }
115
+ end
115
116
  end
116
117
  end
117
118
 
@@ -14,7 +14,10 @@ module Blacklight::Catalog
14
14
  include Blacklight::Catalog::ComponentConfiguration
15
15
  include Blacklight::Facet
16
16
 
17
+ # rubocop:disable Style/ConstantName
18
+ # @deprecated use blacklight_config.search_history_window instead
17
19
  SearchHistoryWindow = 100 # how many searches to save in session history
20
+ # rubocop:enable Style/ConstantName
18
21
 
19
22
  # The following code is executed when someone includes blacklight::catalog in their
20
23
  # own controller.
@@ -159,8 +162,6 @@ module Blacklight::Catalog
159
162
  instance_exec &config
160
163
  when Symbol, String
161
164
  send config
162
- else
163
- # no-op, just render the page
164
165
  end
165
166
  end
166
167
  end
@@ -194,11 +195,9 @@ module Blacklight::Catalog
194
195
  # First, try to render an appropriate template (e.g. index.endnote.erb)
195
196
  # If that fails, just concatenate the document export responses with a newline.
196
197
  def render_document_export_format format_name
197
- begin
198
- render
199
- rescue ActionView::MissingTemplate
200
- render text: @response.documents.map { |x| x.export_as(format_name) if x.exports_as? format_name }.compact.join("\n"), layout: false
201
- end
198
+ render
199
+ rescue ActionView::MissingTemplate
200
+ render text: @response.documents.map { |x| x.export_as(format_name) if x.exports_as? format_name }.compact.join("\n"), layout: false
202
201
  end
203
202
 
204
203
  # override this method to change the JSON response from #index
@@ -278,14 +277,7 @@ module Blacklight::Catalog
278
277
  end
279
278
 
280
279
  def sms_mappings
281
- {'Virgin' => 'vmobl.com',
282
- 'AT&T' => 'txt.att.net',
283
- 'Verizon' => 'vtext.com',
284
- 'Nextel' => 'messaging.nextel.com',
285
- 'Sprint' => 'messaging.sprintpcs.com',
286
- 'T Mobile' => 'tmomail.net',
287
- 'Alltel' => 'message.alltel.com',
288
- 'Cricket' => 'mms.mycricket.com'}
280
+ Blacklight::Engine.config.sms_mappings
289
281
  end
290
282
 
291
283
  def validate_email_params
@@ -13,7 +13,7 @@ module Blacklight
13
13
  add_show_tools_partial(:refworks, if: :render_refworks_action?, modal: false)
14
14
  add_show_tools_partial(:endnote, if: :render_endnote_action?, modal: false, path: :single_endnote_catalog_path )
15
15
  add_show_tools_partial(:email, callback: :email_action, validator: :validate_email_params)
16
- add_show_tools_partial(:sms, callback: :sms_action, validator: :validate_sms_params)
16
+ add_show_tools_partial(:sms, if: :render_sms_action?, callback: :sms_action, validator: :validate_sms_params)
17
17
  add_show_tools_partial(:citation)
18
18
  add_show_tools_partial(:librarian_view, if: :render_librarian_view_control?)
19
19
 
@@ -62,7 +62,7 @@ module Blacklight::Catalog::SearchContext
62
62
 
63
63
  return if params_copy.reject { |k,v| [:action, :controller].include? k.to_sym }.blank?
64
64
 
65
- saved_search = searches_from_history.select { |x| x.query_params == params_copy }.first
65
+ saved_search = searches_from_history.find { |x| x.query_params == params_copy }
66
66
 
67
67
  saved_search ||= begin
68
68
  s = Search.create(:query_params => params_copy)
@@ -95,7 +95,7 @@ module Blacklight
95
95
  # what field, if any, to use to render grouped results
96
96
  group: false,
97
97
  # additional response formats for search results
98
- respond_to: OpenStructWithHashAccess.new()
98
+ respond_to: OpenStructWithHashAccess.new
99
99
  ),
100
100
  # Additional configuration when displaying a single document
101
101
  show: ViewConfig::Show.new(
@@ -244,7 +244,7 @@ module Blacklight
244
244
  # if not set, defaults to first defined search field
245
245
  def default_search_field
246
246
  field = super
247
- field ||= search_fields.values.select { |field| field.default == true }.first
247
+ field ||= search_fields.values.find { |f| f.default == true }
248
248
  field ||= search_fields.values.first
249
249
 
250
250
  field
@@ -255,7 +255,7 @@ module Blacklight
255
255
  # if not set, defaults to first defined sort field
256
256
  def default_sort_field
257
257
  field = super
258
- field ||= sort_fields.values.select { |field| field.default == true }.first
258
+ field ||= sort_fields.values.find { |f| f.default == true }
259
259
  field ||= sort_fields.values.first
260
260
 
261
261
  field
@@ -1,4 +1,4 @@
1
1
  module Blacklight
2
2
  class Configuration::ToolConfig < OpenStructWithHashAccess
3
3
  end
4
- end
4
+ end
@@ -68,4 +68,4 @@ class Blacklight::Configuration
68
68
 
69
69
  end
70
70
  end
71
- end
71
+ end
@@ -148,4 +148,3 @@ module Blacklight::Controller
148
148
  end
149
149
 
150
150
  end
151
-
@@ -59,4 +59,4 @@ module Blacklight::Document
59
59
  end
60
60
 
61
61
  end
62
- end
62
+ end
@@ -26,16 +26,21 @@ module Blacklight::Document::DublinCore
26
26
  'xmlns:dc' => "http://purl.org/dc/elements/1.1/",
27
27
  'xmlns:xsi' => "http://www.w3.org/2001/XMLSchema-instance",
28
28
  'xsi:schemaLocation' => %{http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd}) do
29
- self.to_semantic_values.select { |field, values| dublin_core_field_names.include? field.to_sym }.each do |field,values|
30
- values.each do |v|
31
- xml.tag! 'dc:' + field.to_s, v
32
- end
33
- end
34
- end
29
+ self.to_semantic_values.select { |field, values| dublin_core_field_name? field }.each do |field,values|
30
+ Array.wrap(values).each do |v|
31
+ xml.tag! "dc:#{field}", v
32
+ end
33
+ end
34
+ end
35
35
  xml.target!
36
36
  end
37
37
 
38
38
  alias_method :export_as_xml, :export_as_oai_dc_xml
39
39
  alias_method :export_as_dc_xml, :export_as_oai_dc_xml
40
40
 
41
+ private
42
+
43
+ def dublin_core_field_name? field
44
+ dublin_core_field_names.include? field.to_sym
45
+ end
41
46
  end
@@ -62,22 +62,14 @@ module Blacklight::Document::Export
62
62
  # type. But that's the only way to do the kind of check we need, sorry.
63
63
  if defined?(Mime) && Mime.const_defined?(short_name.to_s.upcase)
64
64
  mime_type = "Mime::#{short_name.to_s.upcase}".constantize
65
- content_type = mime_type.to_s unless content_type
65
+ content_type ||= mime_type.to_s
66
66
  else
67
67
  # not registered, we need to register. Use register_alias to be least
68
68
  # likely to interfere with host app.
69
69
  Mime::Type.register_alias(content_type, short_name)
70
70
  end
71
-
72
- # if content_type is nil, look it up from Rails Mime::Type
73
- if content_type.nil?
74
- # Accurate lookup in Rails Mime::Type is kind of pain, it doesn't
75
- # really provide the right API.
76
- if defined?(type_const_name)
77
- content_type = type_const_name.constantize.to_s
78
- end
79
- end
80
- export_formats[short_name] = {content_type: content_type}
71
+
72
+ export_formats[short_name] = { content_type: content_type }
81
73
  end
82
74
 
83
75
  # Collects formats that this doc can export as.
@@ -98,10 +90,10 @@ module Blacklight::Document::Export
98
90
  # on the convention, so clients should call this method so
99
91
  # they'll still keep working if we do that.
100
92
  def export_as(short_name)
101
- send("export_as_#{short_name.to_s}")
93
+ send("export_as_#{short_name}")
102
94
  end
103
95
 
104
96
  def exports_as? short_name
105
- respond_to? "export_as_#{short_name.to_s}"
97
+ respond_to? "export_as_#{short_name}"
106
98
  end
107
99
  end
@@ -4,4 +4,4 @@ module Blacklight::Document::SchemaOrg
4
4
  "http://schema.org/Thing"
5
5
  end
6
6
 
7
- end
7
+ end
@@ -33,19 +33,15 @@ module Blacklight::Document
33
33
  # but extensions should call super and modify hash returned, to avoid
34
34
  # unintentionally erasing values provided by other extensions.
35
35
  def to_semantic_values
36
- unless @semantic_value_hash
37
- @semantic_value_hash = Hash.new([]) # default to empty array
38
- self.class.field_semantics.each_pair do |key, field_name|
39
- value = self[field_name]
40
- # Make single and multi-values all arrays, so clients
41
- # don't have to know.
42
- unless value.nil?
43
- value = [value] unless value.kind_of?(Array)
44
- @semantic_value_hash[key] = value
45
- end
46
- end
36
+ @semantic_value_hash ||= self.class.field_semantics.each_with_object(Hash.new([])) do |(key, field_name), hash|
37
+ value = self[field_name]
38
+
39
+ # Make single and multi-values all arrays, so clients
40
+ # don't have to know.
41
+ hash[key] = Array.wrap(value) unless value.nil?
47
42
  end
48
- return @semantic_value_hash
43
+
44
+ @semantic_value_hash ||= {}
49
45
  end
50
46
  end
51
- end
47
+ end
@@ -76,7 +76,7 @@ module Blacklight
76
76
  # @option opts [String] :label Render the given string
77
77
  # @param [Symbol, Proc, String] field Render the given field or evaluate the proc or render the given string
78
78
  def render_document_index_label field, opts ={}
79
- if field.kind_of? Hash
79
+ if field.is_a? Hash
80
80
  Deprecation.warn DocumentPresenter, "Calling render_document_index_label with a hash is deprecated"
81
81
  field = field[:label]
82
82
  end
@@ -141,7 +141,7 @@ module Blacklight
141
141
  value = case
142
142
  when (field_config and field_config.highlight)
143
143
  # retrieve the document value from the highlighting response
144
- @document.highlight_field(field_config.field).map { |x| x.html_safe } if @document.has_highlight_field? field_config.field
144
+ @document.highlight_field(field_config.field).map(&:html_safe) if @document.has_highlight_field? field_config.field
145
145
  when (field_config and field_config.accessor)
146
146
  # implicit method call
147
147
  if field_config.accessor === true
@@ -28,5 +28,16 @@ module Blacklight
28
28
  end
29
29
  end
30
30
 
31
+ Blacklight::Engine.config.sms_mappings = {
32
+ 'Virgin' => 'vmobl.com',
33
+ 'AT&T' => 'txt.att.net',
34
+ 'Verizon' => 'vtext.com',
35
+ 'Nextel' => 'messaging.nextel.com',
36
+ 'Sprint' => 'messaging.sprintpcs.com',
37
+ 'T Mobile' => 'tmomail.net',
38
+ 'Alltel' => 'message.alltel.com',
39
+ 'Cricket' => 'mms.mycricket.com'
40
+ }
41
+
31
42
  end
32
43
  end