Class: Guise::GuiseForBuilder Private

Inherits:
Object
  • Object
show all
Defined in:
lib/guise/builders.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(association_class, options, association_options) ⇒ GuiseForBuilder

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of GuiseForBuilder.



80
81
82
83
84
85
# File 'lib/guise/builders.rb', line 80

def initialize(association_class, options, association_options)
  @association_class = association_class
  @options = options
  @association_options = association_options.reverse_merge!(@options.default_association_options)
  @define_validations = !@association_options.delete(:validate)
end

Instance Method Details

#build!Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



87
88
89
90
91
92
93
94
95
# File 'lib/guise/builders.rb', line 87

def build!
  update_guise_options!
  define_association!
  define_scopes!

  if define_validations?
    define_validations!
  end
end