method
klass
v2.3.8 -
Show latest stable
- Class:
ActiveRecord::Reflection::AssociationReflection
klass()public
Returns the target association’s class:
class Author < ActiveRecord::Base has_many :books end Author.reflect_on_association(:books).klass # => Book
Note: do not call klass.new or klass.create to instantiate a new association object. Use build_association or create_association instead. This allows plugins to hook into association object creation.