instance method
klass
Ruby on Rails 4.0.13
Since v2.2.3Signature
klass()
Returns the class for the macro.
composed_of :balance, class_name: 'Money' returns the Money class has_many :clients returns the Client class
Source
# File activerecord/lib/active_record/reflection.rb, line 124
def klass
@klass ||= class_name.constantize
end
Defined in activerecord/lib/active_record/reflection.rb line 124
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Reflection::MacroReflection