Ruby on Rails Thursday, February 15, 2018

I believe suffix is generally used when you're using polymorphic associations (for example, you may have Comment model that belongs_to :commentable). In DHH's video, I believe it's the case, because recordable is most likely used for variety of models in BC3.


On Thu, Feb 15, 2018, at 15:46, David McDonald wrote:
Why do I see includes often named with the suffix "able"? Is this a naming convention that's being utilized?  I also see other variations being used, such as "ed", but mostly it seems to be "able".  I'm currently refactoring code and would like to understand this more so I can possibly adopt the approach in my own projects.

An example is the following from @dhh in his new videos he's been posting on Youtube here.


class MessagesController < ApplicationController
  include
SetRecordable, BucketScoped
 
# ...
end


Thanks!


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment