After searching for an example table without tables, I came across this code, which seems to be a general consensus on how to create it.
class Item < ActiveRecord::Base class_inheritable_accessor :columns self.columns = [] def self.column(name, sql_type = nil, default = nil, null = true) columns << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null) end def all return [] end column :recommendable_type, :string #Other columns, validations and relations etc... end
However, I would also like it to function as a model, presenting a collection of an object, so that I can do Item.all.
The plan is to populate the elements with files, and each property element will be extracted from the files.
However, for now, if I do Item.all, I get
Mysql2::Error Table 'test_dev.items' doesn't exist...
error.
source share