uses resource_class instead of controller_name
This commit is contained in:
@@ -62,7 +62,7 @@ module Commentable
|
|||||||
end
|
end
|
||||||
|
|
||||||
def commentable_name
|
def commentable_name
|
||||||
@commentable_name ||= controller_name.singularize
|
@commentable_name ||= resource_class.to_s.downcase.singularize
|
||||||
end
|
end
|
||||||
|
|
||||||
def commentable_model
|
def commentable_model
|
||||||
|
|||||||
@@ -22,4 +22,8 @@ class DebatesController < ApplicationController
|
|||||||
params.require(:debate).permit(:title, :description, :tag_list, :terms_of_service, :captcha, :captcha_key)
|
params.require(:debate).permit(:title, :description, :tag_list, :terms_of_service, :captcha, :captcha_key)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def resource_class
|
||||||
|
Debate
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -22,4 +22,7 @@ class ProposalsController < ApplicationController
|
|||||||
params.require(:proposal).permit(:title, :question, :summary, :description, :external_url, :video_url, :responsible_name, :tag_list, :terms_of_service, :captcha, :captcha_key)
|
params.require(:proposal).permit(:title, :question, :summary, :description, :external_url, :video_url, :responsible_name, :tag_list, :terms_of_service, :captcha, :captcha_key)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def resource_class
|
||||||
|
Proposal
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user