Module: Supernova
- Defined in:
- lib/supernova.rb
Defined Under Namespace
Modules: AttrInitializer, ClassMethods, Solr Classes: Circle, Collection, Condition, Coordinate, Criteria, SolrCriteria, SolrIndexer
Constant Summary collapse
- KM_TO_METER =
1000.0
- MILE_TO_METER =
1609.3472
- DEG_TO_RADIAN =
Math::PI / 180.0
- RADIAN_TO_REG =
1 / DEG_TO_RADIAN
Class Method Summary collapse
Class Method Details
.build_ar_like_record(clazz, attributes, original_search_doc = nil) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/supernova.rb', line 29 def build_ar_like_record(clazz, attributes, original_search_doc = nil) record = clazz.new record.instance_variable_set("@attributes", attributes) record.instance_variable_set("@readonly", true) record.instance_variable_set("@new_record", false) record.instance_variable_set("@original_search_doc", original_search_doc) if original_search_doc record end |