Remember one thing: you will need to clear UK immigration at Edinburgh, firstly because Edinburgh has no transit area, and secondly because UK-Ireland flights are treated as domestic (even though you will clear immigration in Dublin as well, because of the airport design).
The official rule states that you can only enter the UK for transit on the basis of an Irish biometric visa.
While I am aware that children below the age of 5 do not have their biometrics taken at Irish embassies, and can transit if accompanied by you (a holder of a biometric Irish visa), this is not suggested anywhere in Timatic.
As such, if the Airline decides to check the requirements in Timatic, it is highly likely you'd be denied Boarding.
I would clear this up with the airline as soon as possible if I were you, because the Problem won't be entering the UK to catch your connecting flight, but getting on the plane in Lagos.
Do NOT, under any circumstances, let them play their standard card: "we don't know, it's not our responsibility, ask the embassy". They do that all the time, but on the day of travel, suddenly they know exactly whether to let you board, and won't change their mind even if you call the embassy in front of them.
The truth is that they act on Timatic info they have, though they won't reveal it until it's time for you to board. Why? They simply don't care - all that matters to them is they've got the money you paid for the trip.