Class: Spanner::Translator::Rules::Translation::ReplaceApplicationRecord
- Inherits:
-
BaseRule
- Object
- Parser::AST::Processor
- BaseRule
- Spanner::Translator::Rules::Translation::ReplaceApplicationRecord
- Defined in:
- lib/spanner/translator/rules/translation/replace_application_record.rb
Overview
replace ApplicationRecord with the configured class during translation of models
Constant Summary
Constants inherited from BaseRule
Instance Attribute Summary
Attributes inherited from BaseRule
Instance Method Summary collapse
Methods inherited from BaseRule
#any_index?, #capture_column_nullity, #capture_primary_key_argument, #capture_table_name, #conditionally_propagate_argument, #create_range, #initialize, #unless_seen
Constructor Details
This class inherits a constructor from Spanner::Translator::Rules::BaseRule
Instance Method Details
#on_class(node) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/spanner/translator/rules/translation/replace_application_record.rb', line 9 def on_class(node) return unless node.inherits_from?(:ApplicationRecord) return unless [:class] @rewriter.replace(node.superclass_loc, [:class]) end |