Module: Pose::ActiveRecordBaseAdditions
- Defined in:
- lib/pose/activerecord_base_additions.rb
Instance Method Summary collapse
-
#posify(*source_methods, &block) ⇒ Object
Defines the searchable content in ActiveRecord objects.
Instance Method Details
#posify(*source_methods, &block) ⇒ Object
Defines the searchable content in ActiveRecord objects.
6 7 8 9 10 11 12 13 14 |
# File 'lib/pose/activerecord_base_additions.rb', line 6 def posify *source_methods, &block include ModelClassAdditions self.pose_content = proc do text_chunks = source_methods.map { |source| send(source) } text_chunks << instance_eval(&block) if block text_chunks.reject(&:blank?).join(' ') end end |