Class: ActsAsSolr::Deprecation
- Inherits:
-
Object
- Object
- ActsAsSolr::Deprecation
- Defined in:
- lib/deprecation.rb
Class Method Summary collapse
-
.plog(text) ⇒ Object
This will print the text to stdout and log the text if rails logger is available.
-
.validate_index(options = {}) ⇒ Object
Validates the options passed during indexing.
-
.validate_query(options = {}) ⇒ Object
Validates the options passed during query.
Class Method Details
.plog(text) ⇒ Object
This will print the text to stdout and log the text if rails logger is available
55 56 57 58 |
# File 'lib/deprecation.rb', line 55 def self.plog text puts text RAILS_DEFAULT_LOGGER.warn text if defined? RAILS_DEFAULT_LOGGER end |
.validate_index(options = {}) ⇒ Object
Validates the options passed during indexing
46 47 48 49 50 51 |
# File 'lib/deprecation.rb', line 46 def self.validate_index ={} if [:background] plog "The :background option is being deprecated. There are better and more efficient " + "ways to handle delayed saving of your records." end end |
.validate_query(options = {}) ⇒ Object
Validates the options passed during query
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/deprecation.rb', line 26 def self.validate_query ={} if [:field_types] plog "The option :field_types for searching is deprecated. " + "The field types are automatically traced back when you specify a field type in your model." end if [:sort_by] plog "The option :sort_by is deprecated, use :order instead!" [:order] ||= [:sort_by] end if [:start] plog "The option :start is deprecated, use :offset instead!" [:offset] ||= [:start] end if [:rows] plog "The option :rows is deprecated, use :limit instead!" [:limit] ||= [:rows] end end |