Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
## A Patch by Overbryd for acts_as_xapian Range Searching # in lib/acts_as_xapian.rb, at line 597: # Extract value of a field from the model def xapian_value(field, type = nil) value = self[field] || self.send(field.to_sym) if type == :date if value.kind_of?(Time) value.utc.strftime("%Y%m%d") elsif value.kind_of?(Date) value.to_time.utc.strftime("%Y%m%d") else raise "Only Time or Date types supported by acts_as_xapian for :date fields, got " + value.class.to_s end + elsif type == :number + Xapian::sortable_serialise(value) elsif type == :boolean value ? true : false else value.to_s end end
This paste will be private.
From the Design Piracy series on my blog: