adds consistency and speed to auxiliary methods
This commit is contained in:
@@ -61,12 +61,12 @@ module Commentable
|
|||||||
@commentable ||= instance_variable_get("@#{commentable_name}")
|
@commentable ||= instance_variable_get("@#{commentable_name}")
|
||||||
end
|
end
|
||||||
|
|
||||||
def commentable_model
|
def commentable_name
|
||||||
@commentable_model ||= commentable_name.capitalize.constantize
|
@commentable_name ||= controller_name.singularize
|
||||||
end
|
end
|
||||||
|
|
||||||
def commentable_name
|
def commentable_model
|
||||||
controller_name.singularize
|
@commentable_model ||= commentable_name.capitalize.constantize
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_commentable_instance
|
def set_commentable_instance
|
||||||
|
|||||||
Reference in New Issue
Block a user