This is from the rails log: SELECT "district_sets".id FROM "district_sets" WHERE ("district_sets"."ident" = ''juris-60c8bcea56c0dfa02d121691e0e72152'' AND "district_sets".id <> 12) LIMIT 1 I am confused by the <> operator. Can anyone clarify that for me please? Thanks! -- Pito -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
http://dev.mysql.com/doc/refman/5.0/en/non-typed-operators.html not equals On Sep 4, 2:06 pm, Pito Salas <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> This is from the rails log: > > SELECT "district_sets".id FROM "district_sets" WHERE > ("district_sets"."ident" = ''juris-60c8bcea56c0dfa02d121691e0e72152'' AND > "district_sets".id <> 12) LIMIT 1 > > I am confused by the <> operator. Can anyone clarify that for me please? > Thanks! > > -- Pito > -- > Posted viahttp://www.ruby-forum.com/.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
!-- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Fernando Perez wrote:> !Thanks... The reason I didn''t think that is what it meant (although I believe you :) is that I saw it here: [Development]>> ap j #<DistrictSet:0x105568550> { :id => 3, :display_name => "ds2", :created_at => Sat, 04 Sep 2010 11:21:36 PDT -07:00, :updated_at => Sat, 04 Sep 2010 11:21:36 PDT -07:00, :secondary_name => nil, :icon_file_name => nil, :icon_content_type => nil, :icon_file_size => nil, :icon_updated_at => nil, :descriptive_text => nil, :ident => "juris-a88e89de29712642eaef324fd9bc03ed" } => nil ## in other words, j is assigned a DistrictSet object, that has j.id = 3 [Development]>> j.save! DistrictSet Load (0.3ms) SELECT "district_sets".id FROM "district_sets" WHERE ("district_sets"."ident" = ''juris-a88e89de29712642eaef324fd9bc03ed'' AND "district_sets".id <> 3) LIMIT 1 [paperclip] Saving attachments. => true ## And when I ask activerecord to save it, I see the very odd <> 3. Do you understand what it means? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 4 September 2010 20:49, Pito Salas <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Fernando Perez wrote: >> !> > Thanks... The reason I didn''t think that is what it meant (although I > believe you :) is that I saw it here: > > [Development]>> ap j > #<DistrictSet:0x105568550> { > :id => 3, > :display_name => "ds2", > :created_at => Sat, 04 Sep 2010 11:21:36 PDT -07:00, > :updated_at => Sat, 04 Sep 2010 11:21:36 PDT -07:00, > :secondary_name => nil, > :icon_file_name => nil, > :icon_content_type => nil, > :icon_file_size => nil, > :icon_updated_at => nil, > :descriptive_text => nil, > :ident => "juris-a88e89de29712642eaef324fd9bc03ed" > } > => nil > ## in other words, j is assigned a DistrictSet object, that has j.id = 3 > > [Development]>> j.save! > DistrictSet Load (0.3ms) SELECT "district_sets".id FROM > "district_sets" WHERE ("district_sets"."ident" > ''juris-a88e89de29712642eaef324fd9bc03ed'' AND "district_sets".id <> 3) > LIMIT 1 > [paperclip] Saving attachments. > => true > ## And when I ask activerecord to save it, I see the very odd <> 3. > > Do you understand what it means?I may be wrong but have you got a validates_uniqueness_of on ident? That query could be checking to see if there is already a matching ident. The id<>3 could be so that it does not find the one you are updating or creating. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> Do you understand what it means?It''s probably a validates_uniqueness_of that adds that additional query. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.