ruby on rails - Changing position of options via the admin panel -


i have below method rearranging position of radio , checkbox images app.

def change_position if !self.position.blank? existing_model=part.where("ancestry = #{self.ancestry} , position = #{self.position}")   if !existing_model[0].blank?    if !self.changes['position'].blank?        existing_model[0].update_columns(position: self.changes['position'][0])     end end end   end 

but when trying change position of parent option, getting below error in rails admin panel.

sqlite3::sqlexception: near "and": syntax error: select "parts".* "parts" (ancestry = , position = 2) order created_at asc

why not able save position parent options position here?

any here?


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -