Skip to content

Instantly share code, notes, and snippets.

@hramos
Created December 11, 2011 22:44
Show Gist options
  • Save hramos/1463251 to your computer and use it in GitHub Desktop.
Save hramos/1463251 to your computer and use it in GitHub Desktop.
parse_resource query for PFObject with DateTime column
# Class setup. We already have quite a few rows of data in Parse
# someDate is a DateTime column
# someIdentifier is a String column
class MyParseClassObject < ParseResource::Base
fields :someDate, :someIdentifier
validates_presence_of :someIdentifier
end
MyParseClassObject.where(:someIdentifier => "51").all
## calling above line results in following error
NoMethodError: undefined method `nested_under_indifferent_access' for {"__type"=>"Date", "iso"=>"2011-07-05T12:00:00.000Z"}:Hash
from /Users/hramos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/hash_with_indifferent_access.rb:154:in `convert_value'
from /Users/hramos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/hash_with_indifferent_access.rb:70:in `block in update'
from /Users/hramos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/hash_with_indifferent_access.rb:70:in `each_pair'
from /Users/hramos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/hash_with_indifferent_access.rb:70:in `update'
from /Users/hramos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/hash_with_indifferent_access.rb:22:in `initialize'
from /Users/hramos/.rvm/gems/ruby-1.9.2-p290/gems/parse_resource-1.6.2/lib/base.rb:34:in `new'
from /Users/hramos/.rvm/gems/ruby-1.9.2-p290/gems/parse_resource-1.6.2/lib/base.rb:34:in `initialize'
from /Users/hramos/.rvm/gems/ruby-1.9.2-p290/gems/parse_resource-1.6.2/lib/query.rb:47:in `new'
from /Users/hramos/.rvm/gems/ruby-1.9.2-p290/gems/parse_resource-1.6.2/lib/query.rb:47:in `block in execute'
from /Users/hramos/.rvm/gems/ruby-1.9.2-p290/gems/parse_resource-1.6.2/lib/query.rb:47:in `map'
from /Users/hramos/.rvm/gems/ruby-1.9.2-p290/gems/parse_resource-1.6.2/lib/query.rb:47:in `execute'
from /Users/hramos/.rvm/gems/ruby-1.9.2-p290/gems/parse_resource-1.6.2/lib/query.rb:52:in `all'
from (irb):58
from /Users/hramos/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment