mysql - Query with Rails -


An ideal employee with the properties of my holidays I want to create a query that does not return the employee to the holidays.

For example:

  employee = employee. Where ("sickness =? And (the date passes  vacations.ed_at)", false) .dr ("Engagement ASC"). All   

Employee Model:

  Classroom staff & lt; ActiveRecord :: Base has has_many: Holidays: Dependent = & gt; : Delete after_initialize do self.acceso || = True ending   

The holiday model has : start_at,: ends_at ,: employee_id properties

You may be able to do something like

  current_holidays = holiday.where (("start_at" And_date = =: now ", {: now => time.nuh}]) employee_onlinehold = present_holy.You (& employee_id) employees_not_on_holiday = employee.where ((" id not? ")         / P>  

>

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -