Class: Edgarj::Search
- Inherits:
-
Object
- Object
- Edgarj::Search
- Extended by:
- ActiveModel::Conversion, ActiveModel::Naming, ActiveModel::Translation
- Includes:
- ActiveModel::Validations
- Defined in:
- app/models/edgarj/search.rb
Overview
Search condition
Abstract class to SearchForm and SearchPopup to provide common method ‘conditions’.
‘Search’ instance will be stored in view_status.model.
@errors will be used for error_messages_for helper in search-form.
Direct Known Subclasses
Defined Under Namespace
Classes: Cache
Instance Attribute Summary collapse
-
#_klass_str ⇒ Object
Returns the value of attribute _klass_str.
-
#errors ⇒ Object
Returns the value of attribute errors.
Instance Method Summary collapse
-
#conditions ⇒ Object
generate search-conditions from ActiveRecord attributes.
-
#initialize(klass) ⇒ Search
constructor
A new instance of Search.
- #persisted? ⇒ Boolean
Constructor Details
#initialize(klass) ⇒ Search
Returns a new instance of Search.
45 46 47 48 |
# File 'app/models/edgarj/search.rb', line 45 def initialize(klass) @errors = ActiveModel::Errors.new(self) @_klass_str = klass.to_s end |
Instance Attribute Details
#_klass_str ⇒ Object
Returns the value of attribute _klass_str.
43 44 45 |
# File 'app/models/edgarj/search.rb', line 43 def _klass_str @_klass_str end |
#errors ⇒ Object
Returns the value of attribute errors.
43 44 45 |
# File 'app/models/edgarj/search.rb', line 43 def errors @errors end |
Instance Method Details
#conditions ⇒ Object
generate search-conditions from ActiveRecord attributes
RETURN
- [condition_string, value_array]
-
values for :conditions option on model
54 55 56 |
# File 'app/models/edgarj/search.rb', line 54 def conditions raise "Not implemented" end |
#persisted? ⇒ Boolean
58 59 60 |
# File 'app/models/edgarj/search.rb', line 58 def persisted? false end |