lib/ordered_list/active_record/list.rb
# Returns the position of the given record or id.
Returns the position of the given record or id.
Returns the position of the given record or id .
def position_of(id)
        return id if Position === id
        id = id.id if ::ActiveRecord::Base === id
        bound_equality(primary_key, id).retrieve_position
      end
def position_of ( id ) return id if Position === id id = id . id if :: ActiveRecord :: Base === id bound_equality ( primary_key , id ) . retrieve_position end
Returns the position of the given record or id.
Returns the position of the given record or id .
# TODO: Not sure if position_of() should accept Positions. # Get primary key (id) of given record, if the argument is a record. # We anticipate this query is going to used a lot, so we should # benefit from prepared statements. Make sure we use variable binding.
id