Module: Regressor::Model::Nested::Attribute

Included in:
RegressionModel
Defined in:
lib/generators/regressor/model/nested/attribute.rb

Instance Method Summary collapse

Instance Method Details

#nested_attributesObject



5
6
7
8
9
10
11
# File 'lib/generators/regressor/model/nested/attribute.rb', line 5

def nested_attributes
  if @model.constantize.nested_attributes_options.present?
    @model.constantize.nested_attributes_options.keys.map do |key|
      "it { is_expected.to accept_nested_attributes_for :#{key} }"
    end.join("\n\t")
  end
end