Altair::CLI::Generators::Base
Shared filesystem and naming helpers for generators.
Constants
VALID_TYPES = [:string, :text, :integer, :bigint, :float, :decimal, :boolean, :datetime, :json] of ::Symbol
The column types a generator argument accepts, mapped to the
schema t.<type> method.
Instance methods
Converts a model name to its camelized class form (BlogPost).
Already-camelized names pass through untouched — capitalize
would otherwise lowercase the tail (BlogPost → Blogpost).
Parses ["title:string", "body:text"] into columns. A name
without a type defaults to :string. Raises on an unknown type.
The shared URL prefix for a table's resources, e.g. blog_posts.
Converts a model name to its singular attribute name (blog_post).