Created
December 11, 2011 22:44
-
-
Save hramos/1463251 to your computer and use it in GitHub Desktop.
parse_resource query for PFObject with DateTime column
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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