Module: Tapioca::Dsl::Compilers::Extensions::ActiveRecord
- Defined in:
- lib/tapioca/dsl/extensions/active_record.rb
Instance Attribute Summary collapse
-
#__tapioca_delegated_types ⇒ Object
readonly
Returns the value of attribute __tapioca_delegated_types.
-
#__tapioca_secure_tokens ⇒ Object
readonly
Returns the value of attribute __tapioca_secure_tokens.
-
#__tapioca_stored_attributes ⇒ Object
readonly
Returns the value of attribute __tapioca_stored_attributes.
Instance Method Summary collapse
- #delegated_type(role, types:, **options) ⇒ Object
- #has_secure_token(attribute = :token) ⇒ Object
- #store_accessor(store_attribute, *keys, prefix: nil, suffix: nil) ⇒ Object
Instance Attribute Details
#__tapioca_delegated_types ⇒ Object (readonly)
Returns the value of attribute __tapioca_delegated_types.
15 16 17 |
# File 'lib/tapioca/dsl/extensions/active_record.rb', line 15 def __tapioca_delegated_types @__tapioca_delegated_types end |
#__tapioca_secure_tokens ⇒ Object (readonly)
Returns the value of attribute __tapioca_secure_tokens.
24 25 26 |
# File 'lib/tapioca/dsl/extensions/active_record.rb', line 24 def __tapioca_secure_tokens @__tapioca_secure_tokens end |
#__tapioca_stored_attributes ⇒ Object (readonly)
Returns the value of attribute __tapioca_stored_attributes.
33 34 35 |
# File 'lib/tapioca/dsl/extensions/active_record.rb', line 33 def __tapioca_stored_attributes @__tapioca_stored_attributes end |
Instance Method Details
#delegated_type(role, types:, **options) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/tapioca/dsl/extensions/active_record.rb', line 17 def delegated_type(role, types:, **) @__tapioca_delegated_types ||= {} @__tapioca_delegated_types[role] = { types: types, options: } super end |
#has_secure_token(attribute = :token) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/tapioca/dsl/extensions/active_record.rb', line 26 def has_secure_token(attribute = :token, **) @__tapioca_secure_tokens ||= [] @__tapioca_secure_tokens << attribute super end |
#store_accessor(store_attribute, *keys, prefix: nil, suffix: nil) ⇒ Object
35 36 37 38 39 40 |
# File 'lib/tapioca/dsl/extensions/active_record.rb', line 35 def store_accessor(store_attribute, *keys, prefix: nil, suffix: nil) @__tapioca_stored_attributes ||= [] @__tapioca_stored_attributes << [store_attribute, keys, prefix, suffix] super end |