Class: Trello::AssociationBuilder::HasOne

Inherits:
Object
  • Object
show all
Defined in:
lib/trello/association_builder/has_one.rb

Class Method Summary collapse

Class Method Details

.build(model_klass, name, options) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/trello/association_builder/has_one.rb', line 5

def build(model_klass, name, options)
  model_klass.class_eval do
    define_method(name) do |*args|
      has_one_fetcher = AssociationFetcher::HasOne.new(self, name, options)
      has_one_fetcher.fetch
    end
  end
end