Module: LedgerSync::ResourceAttribute::Reference::One::Mixin::ClassMethods
- Defined in:
- lib/ledger_sync/resource_attribute/reference/one.rb
Instance Method Summary collapse
Instance Method Details
#references_one(name, to: nil) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/ledger_sync/resource_attribute/reference/one.rb', line 16 def references_one(name, to: nil) to ||= begin require "#{inferred_config.root_path}/resources/#{name}" inferred_config.client_class.resources[name] end resource_attribute = ResourceAttribute::Reference::One.new( name: name, resource_class: self, to: to ) resource_attributes.add resource_attribute _define_attribute_methods(name) end |