Create Statistic model to house all appropriate data.
type:string - Class type for record (e.g. Standing)
record_id:integer - Id of record
key_name:variety - formatted, ordered key to retrieve value. Created through method to combine terms alphabetically. All keys should have separate column for simplicity and best practices:
def key(*args)
all = args.map { |arg| arg.to_s.downcase }
all.sort if all
all.join('_')
end
Create
Statistic
model to house all appropriate data.Standing
)key_name
:variety - formatted, ordered key to retrieve value. Created through method to combine terms alphabetically. All keys should have separate column for simplicity and best practices:Outputs: