ActiveRecord::Base.take_or_create instead of first_or_create


Rails 4 has introduced a take method to AR, which is like first without ordering. But there’s no equivalent method for first_or_create, first_or_initialize and friends.

Has this actually been considered or just accidentally missed? I don’t think I ever cared about ordering when calling first_or_create. What do you think? Would it make sense either to replace first_or_create with take_or_create, or have them both?

Well, there is no point in ordering, when all you care about is presence of any record

I see. This group is rather dead than alive :slight_smile: