small medium large xlarge

16 Apr 2016, 23:13
Brian D'Ostilio (1 post)

I don’t understand the code below. Why is the name of the method(ensure_not_…) symbolized (prepended with the colon) when it is called in the ‘before_destroy’ line? Why wouldn’t Rails just call it as a method like normal (i.e. without the prepended colon)? I tried to google the issue but I don’t really know what I am searching for. Thanks in advance! ~~~ before_destroy :ensure_not_referenced_by_any_line_item

def ensure_not_referenced_by_any_line_item #… end ~~~

You must be logged in to comment