Skip to content

Instantly share code, notes, and snippets.

@jdaviderb
Created July 13, 2018 01:01
Show Gist options
  • Save jdaviderb/2f29178e77e905b760f81584a96085eb to your computer and use it in GitHub Desktop.
Save jdaviderb/2f29178e77e905b760f81584a96085eb to your computer and use it in GitHub Desktop.
def filter
Budget::Investment
.where(mariquito, "valor del status")
end
def mariquito
<<-SQL
(SELECT status_id FROM budget_investment_milestones
WHERE investment_id = budget_investments.id ORDER BY created_at ASC LIMIT !) = ?
SQL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment