Class: FuzzyWhere::Generators::PredicateGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/fuzzy_where/predicate_generator.rb

Overview

Generate a new fuzzy predicate

Instance Method Summary collapse

Instance Method Details

#add_fuzzy_predicateObject

Add Fuzzy predicate



13
14
15
16
17
# File 'lib/generators/fuzzy_where/predicate_generator.rb', line 13

def add_fuzzy_predicate
  return if attributes.empty?
  append_to_file 'config/fuzzy_predicates.yml',
                 predicate_content(name, attributes)
end