class Philtre::Filter::Model
These define the interface as used by the views. So this class is available for custom predicates.
Public Class Methods
model_name()
click to toggle source
Name this as 'filter', so the parameters come back from the form as that.
# File lib/philtre-rails/philtre_model.rb, line 11 def self.model_name; ActiveModel::Name.new(Philtre); end
Public Instance Methods
errors()
click to toggle source
# File lib/philtre-rails/philtre_model.rb, line 19 def errors; @errors ||= ActiveModel::Errors.new(self); end
persisted?()
click to toggle source
Rest of ActiveModel compliance, because
include ActiveModel::Model
messes with initialize, which breaks OpenStruct
# File lib/philtre-rails/philtre_model.rb, line 16 def persisted?; false; end
to_key()
click to toggle source
# File lib/philtre-rails/philtre_model.rb, line 17 def to_key; nil; end
to_model()
click to toggle source
# File lib/philtre-rails/philtre_model.rb, line 21 def to_model; self; end
to_param()
click to toggle source
# File lib/philtre-rails/philtre_model.rb, line 18 def to_param; nil; end
to_partial_path()
click to toggle source
# File lib/philtre-rails/philtre_model.rb, line 20 def to_partial_path; self.class.model_name.param_key; end