Module: EasyTalk::Model::ActiveRecordClassMethods
- Defined in:
- lib/easy_talk/model.rb
Overview
Module containing ActiveRecord-specific methods for schema generation
Instance Method Summary collapse
-
#active_record_schema_definition ⇒ SchemaDefinition
Gets a SchemaDefinition that’s built from the ActiveRecord database schema.
-
#enhance_schema(enhancements) ⇒ void
Enhance the generated schema with additional information.
-
#schema_enhancements ⇒ Hash
Store enhancements to be applied to the schema.
Instance Method Details
#active_record_schema_definition ⇒ SchemaDefinition
Gets a SchemaDefinition that’s built from the ActiveRecord database schema
173 174 175 |
# File 'lib/easy_talk/model.rb', line 173 def active_record_schema_definition @active_record_schema_definition ||= ActiveRecordSchemaBuilder.new(self).build_schema_definition end |
#enhance_schema(enhancements) ⇒ void
This method returns an undefined value.
Enhance the generated schema with additional information
188 189 190 191 192 193 194 |
# File 'lib/easy_talk/model.rb', line 188 def enhance_schema(enhancements) @schema_enhancements = enhancements # Clear cached values to force regeneration @active_record_schema_definition = nil @schema = nil @json_schema = nil end |
#schema_enhancements ⇒ Hash
Store enhancements to be applied to the schema
180 181 182 |
# File 'lib/easy_talk/model.rb', line 180 def schema_enhancements @schema_enhancements ||= {} end |