Would you like to remove the object that contains var3?
var3 isn' at the nested array, it's a nested property of an object that is in there.
If you wanted to remove it, it would be like this:
var1[0].var2.delete_at( 0 )
Would you like to remove the object that contains var3?
var3 isn' at the nested array, it's a nested property of an object that is in there.
If you wanted to remove it, it would be like this:
var1[0].var2.delete_at( 0 )
Maurício Linhares wrote:
Would you like to remove the object that contains var3?
var3 isn' at the nested array, it's a nested property of an object that is in there.
If you wanted to remove it, it would be like this:
var1[0].var2.delete_at( 0 )
- Maur�o Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en)
On Mon, Jan 26, 2009 at 5:50 AM, Ukrit Himakoon
not really what I want is removing element inside an array built from query (use in display purpose). but when I'm trying to delete the element inside database also deleted.
for more clearer explanation please see this:
I've got database contains stuff like this:
var1 - has_many var2
var2 - belongs to var1 and belongs to var2
var3 - has_many var2
So what I'm doing is
variable1 = var1.find(:all)
but I need only var1 which not contains some contents in var3 that's why I need to trace and remove from var3 element. any Idea?
var1.all(:select => 'var1.*', :include => {:var2 => var3}, :conditions => ['var3.something = ?', some_value])