Level 88
I would probably add a method to one of the models to calculate the price. The models are related to each other so you can use the relationship in that method to get all the database, calculate the price and return it.
Hi,
i have 2 models (seminars and seminar dates). The price of an seminar depends on data of the 2 models, e.g. there is an early bird price which depends on the start date in the the seminar_date model and the regular price in the seminar model. These 2 criterias i need in order to calculate the correct price. What is a good practice or pattern in order to solve this?
Please or to participate in this conversation.