search for: my_model_instance

Displaying 4 results from an estimated 4 matches for "my_model_instance".

2006 May 18
2
acts_as_ferret 0.2.1
...l: You can tell it to index the result of any instance method of your model class. * Further customization of the indexing process can be achieved by overriding the to_doc instance method in your model class, which is supposed to return the Ferret document object to be stored in the index. * Use my_model_instance#more_like_this to retrieve objects having similar contents like my_model_instance. Great for suggesting related pages to your readers, or related products to your customers. -- Posted via http://www.ruby-forum.com/.
2006 Feb 24
6
Duplicate entry - how to check if an id exist before saving?
How do I check if an entry exists before saving? Someone one told me to use the method find_or_create (or something like that) but it didn''t work because I think the version of rails that we have is not the most recent. I need a way to check if an id exists in the db before saving. Any suggestions? Thank you -- Posted via http://www.ruby-forum.com/.
2006 Dec 29
3
Functional test a "create" action when a validation fails
I''m trying to write a functional test of a "create" action in one of my controllers. In the corresponding model I have a "validates_uniqueness_of :location". In the test case I am constructing I have the create fail with the error "Location has already been taken". Is there a way I can write an assertion like: assert_equal "Location has already been
2011 Mar 26
2
How to deserialize an array from XML
Hi, to serialize an array to xml we can use: an_array = [ 1, 2, 3] an_array.to_xml But to I can''t find a way to convert back XML to array. I didn''t find a method Array.from_xml like Hash.from_xml. Any ideas? Thanks, Gustavo -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email