RailsCasts Pro episodes are now free!

Learn more or hide this

Joel Grannas's Profile

GitHub User: jgrannas

Site: http://www.jqueryjoel.com

Comments by Joel Grannas

Avatar

Any advice on generating a dynamic clause... for example, "saved search" where a user could select which column, operator, value which could be multiple as well... for example:

column, operator, value, next_operator
make == ford |
make == pontiac &
year == 1993..1998

Avatar

anyone have tips on creating a dynamic query with Squeel. for example if i have an array of conditions [[column,operator,value],[column,operator,value]]

How would i iterate over those and dynamically build a query in squeel?

in ultra basic format

ruby
def self.with_conditions(conditions)
    where do
        conditions.each do |column,operator,value|
            (column operator value)
        end
    end
end
Avatar

I agree... would love to see a version of this gallery has_many photos association

Avatar

agree... would love to see a change password, remember me as well