method
klass
v4.2.1 -
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.