Reputation: 2156
I have the following code:
@anatomy = Anatomy.find_by_sql(" some long sql here")
I want to perform a search on the @anatomy resultset.
I tried the code below but it does not seem to work.
@anatomy_subset = @anatomy.find :first, :conditions => ["public_id = ?", public_id ]
It is giving me:
wrong number of arguments (2 for 1)
How do I search for something on the @anatomy instance object?
Thank a lot for your help.
Upvotes: 1
Views: 53
Reputation: 2679
You can't make SQL search out of SQL server, do this instead:
subset = @anatomy.select { |entity| entity.public_id == public_id }
Upvotes: 1