siuying / NanoStoreInMotion

RubyMotion wrapper for NanoStore, a lightweight schema-less key-value document database based on sqlite.
Other
103 stars 24 forks source link

find not returning anything #15

Closed malkomalko closed 11 years ago

malkomalko commented 12 years ago

I have a few different models and for some reason my Listing model will not return anything when I do a Listing.all.

Listing.count shows 0.

However if I look in the db file, it looks like the RBListing is there fine with all the values.

malkomalko commented 12 years ago

why did it save Listing as RBListing? That seems to be the problem.

class Listing < NanoStore::Model
  .... my attributes
end

Listing.bare_class_name => "Listing" Listing.store.objectsOfClassNamed(Listing.bare_class_name) => []

Listing.store.objectsOfClassNamed("RBListing") => [#Listing:0xc553e00]

siuying commented 12 years ago

I guess it has some name conflicts, somewhere else in rubymotion use the name Listing.

Can you try namespace the Listing class and try again?

malkomalko commented 12 years ago

namespaced to Models::Listing and it's doing the same thing. I changed it to Property and it worked fine, but it's very interesting.

siuying commented 11 years ago

can you send me a test case? I have tried to reproduce the error but no luck: 70633e3

siuying commented 11 years ago

closing this until we got update.