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
234 235 236 |
# File 'lib/easy_talk/model.rb', line 234 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
249 250 251 252 253 254 255 |
# File 'lib/easy_talk/model.rb', line 249 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
241 242 243 |
# File 'lib/easy_talk/model.rb', line 241 def schema_enhancements @schema_enhancements ||= {} end |