>
>
> > Palani Kannan. K,
>
> Impossible.
>
> You're defining author_yr in a ruby model, but expecting the DATABASE to
> know what that is. Doesn't work that way.
>
> As Fred mentioned, you need to use a database function that looks at the
> "author_year" field (the last 4 characters) to order upon
Ar Chron wrote in post #957266:
> PalaniKannan K wrote in post #957235:
>>
>> I tried
>> def author_yr
>> "#{self.author_year.last(4)}"
>> end.
>>
>> But it shows "Undefined local variable or method 'author_yr'"
>>
>> when i use author_yr in find by
>>
>> ":order => ["author_year like = ?", author
PalaniKannan K wrote in post #957235:
>
> I tried
> def author_yr
> "#{self.author_year.last(4)}"
> end.
>
> But it shows "Undefined local variable or method 'author_yr'"
>
> when i use author_yr in find by
>
> ":order => ["author_year like = ?", author_yr]". Please suggest me some
> idea
> in ord
PalaniKannan K wrote in post #956892:
> Hi Ar Chron,
>
> Thank you for reply
>
> On 25 October 2010 14:55, Ar Chron wrote:
>
>> Refactor the DB to have those fields available separately. You have two
>> distinct pieces of data munged together in one field.
>>
>
> I shouldn't edit or modify the da
4 matches
Mail list logo