instance method
column_for
Ruby on Rails 7.0.10
Since v5.2.8.1 Private — implementation detail, not part of the public APISignature
column_for(table_name, column_name)
No documentation comment.
Parameters
-
table_namereq -
column_namereq
Source
# File activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 779
def column_for(table_name, column_name)
column_name = column_name.to_s
columns(table_name).detect { |c| c.name == column_name } ||
raise(ActiveRecordError, "No such column: #{table_name}.#{column_name}")
end
Defined in activerecord/lib/active_record/connection_adapters/abstract_adapter.rb line 779
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::AbstractAdapter