DateTime with MongoDB/Mongoid and Rails 3 Not Populating?

Mongoid does not handle multiparameter attributes like Date yet, so you need to do the following.

Mongoid does not handle multiparameter attributes like Date yet, so you need to do the following: # copied from: https://gist.github. Com/315227 # add this to a new file in your lib directory module MultiParameterAttributes def filter_time(attributes, name) attrs = attributes. Collect do |key, value| if key =~ /^#{Regexp.

Escape(name. To_s)}\((\d+)(\w)\)$/ $1. To_i, value.

Send("to_#$2") end end.compact. Sort_by(&:first). Map(&:last) Time.zone.

Local(*attrs) unless attrs. Empty? End end # include the module above in your application_controller.

Rb class ApplicationController.

Recent versions of Mongoid do handle multi-parameter attributes, you just have to include the module in your model: include Mongoid::MultiParameterAttributes.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions