I'm using ruby and activerecord to get information about a mysql table.
I was hoping I could get this information directly from my model class, is this possible?
Say I have my model:
class Product < ActiveRecord::Base
end
Is it now possible for me to get information regarding:
1. mysql table
2. columns
3. column types
Or do I have to look somewhere deeper into the ActiveRecord module to get this?
Product.table_name
Product.column_names
Product.columns_hash['title'].type
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With