elight / acts_as_commentable_with_threading

Similar to acts_as_commentable; however, utilizes awesome_nested_set to provide threaded comments
MIT License
672 stars 167 forks source link

commentable_type character case issue #85

Closed mrdinghy closed 9 years ago

mrdinghy commented 10 years ago

I finally got this gem to work.... I had to not call the "load_commentable" method before the "def create" in order for new comments to load. However I wasn't able to read the new comments in my ariticle.show page. I noticed that the

def new
@comment = Comment.new
end

method inserts a "Lap" for the commentable type. I have to manually change them to lowecase "lap" in the db or them to load. I cannot locate where I would change the case during creation so that the data is in lowercase when inserted in the comments table.

Any ideas? thanks steve

petergoldstein commented 10 years ago

Polymorphic associations use a standard camel-case class name for the type, so 'Lap' is definitely the correct value if your commentable class is Lap. If you needed to change this to 'lap' it indicates that you've got a problem somewhere else in your code - you may be trying to load the comments using a bad custom query.

petergoldstein commented 9 years ago

Closing this issue based on my earlier comment.