On Jun 17, 2014, at 9:30 AM, Ronald Fischer wrote:
> Walter Davis wrote in post #1149912:
>> On Jun 17, 2014, at 8:34 AM, Ronald Fischer wrote:
>> It sounds to me as though maybe all of your idioms have the same value
>> (or null) in their kind column.
>
> No, they have correct values (1, 2 and 3). Actually, the logic of the
> application ensures that there are only those values (I should this
> place into the model too).
>
> Does it mean that in your opinion, my attempt to sort them would be
> correct?
>
Your code is correct: some_reference.order('kind DESC') is the correct way to
get the order you are asking for. Remember that if you only have three possible
values, the implicit sort of the members within each kind will probably be the
ID, all other things being equal. You should see the same behavior as if you
entered this explicitly:
some_reference.order('kind DESC, id ASC')
Walter
>
> Ronald
>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/d8dad43e8c45f6895da580a710bdf0f7%40ruby-forum.com.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/1C7DD1BC-FA70-48B8-850D-BD8AC47C8D68%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.