peritor / simply_stored

A convenience wrapper around CouchDB (using CouchPotato) that supports relations and S3 attachments
Other
140 stars 16 forks source link

find_by_fixnum expects string parameter #10

Open michaelkirk opened 13 years ago

michaelkirk commented 13 years ago

The generated find_by view doesn't know that my field is a Fixnum. Is that possible with simply_stored?

class Product 
  include SimplyStored::Couch
  property :quantity, :type => Fixnum, :default => 0
  validates_numericality_of :quantity, :allow_nil => true
end

Product.find_by_quantity(123) # => nil
Product.find_by_quantity("123") # => #<Product (etc.) quantity: 123 >