Andrew Timberlake wrote:
> On Fri, Jun 19, 2009 at 12:08 PM, Hemant
> Bhargava<[email protected]> wrote:
>>
>> 1) Area.find(:all, :conditions => ['name = lower(?)', area_name.downcase])
>>
> 
> This really should be working. Check the SQL generated in the log file
> and test that directly against your database.
> I would then tweak the SQL statement until you find what's working,
> then work it back into ActiveRecord
> 
> Andrew Timberlake
> http://ramblingsonrails.com
> 
> http://MyMvelope.com - The SIMPLE way to manage your savings

Dude .. Sql itself is not generating ..
Actually what happens is i had given the creation of sql in if condition 
..
I mean if this matches then only save ..
I'll tell u people the whole scenerio ..
Area is a model name ..

Area.exists?(:name => area_name) .. area name is coming from mine 
textbox value and i am cheking it against to the records name of the 
area table .. fine ..

Lets suppose now that my area table have a field Bangalore and mine 
value coming from textbox is bangalore or may be banGalore .. i mean 
whatever ..  So how can i map this .. ?
And also if m giving Bangalore value it get stored ..
If this will map then only it'll save to the database ..
This is my question ..

Float your opinions ..
-- 
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to