Project

querier

0.0
The project is in a healthy, maintained state
Active Record queries with variable number of params
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
 Dependencies
 Project Readme

Active Record Querier

class UserQuerier < Querier

@active_record_class = ApplicationRecord
def initialize user_name:, active:

@query_template = "SELECT * FROM users WHERE name = ${user_name} AND active = ${active/no_quote}"
super

end

end

UserQuerier.new(user_name: 'foo', active: true).execute