Skip to content

Instantly share code, notes, and snippets.

View StefSchenkelaars's full-sized avatar

Stef Schenkelaars StefSchenkelaars

View GitHub Profile
@StefSchenkelaars
StefSchenkelaars / list.rb
Created April 13, 2020 18:13
Idea for refactor acts_as_list
before_create :set_default_position
before_save :prepare_new_position
after_save :cleanup_new_position
after_save :cleanup_old_position
def set_default_position
return if self[position_column]
bottom_item =
acts_as_list_class
{
"info":{
"title":"StudyCoach",
"description":"Allows you to change roles in StudyCoach a.k.a. Canvan Dashboard.",
"contact":{
"name":"Stef Schenkelaars",
"email":"stef@drieam.nl",
"url":"https://drieam.com"
},
"version":"0.0.1"