Class: UUIDField

Inherits:
AssociationField show all
Defined in:
lib/generators/hot_glue/fields/uuid_field.rb

Instance Attribute Summary

Attributes inherited from AssociationField

#alt_lookup, #assoc, #assoc_class, #assoc_name, #polymorphic_parents

Attributes inherited from Field

#alt_lookup, #assoc_class, #assoc_label, #assoc_model, #assoc_name, #associations, #attachment_data, #auth, #class_name, #default_boolean_display, #display_as, #form_labels_position, #form_placeholder_labels, #god, #hawk_keys, #hidden_create, #hidden_update, #layout_strategy, #limit, #modify_as, #name, #namespace, #object, #ownership_field, #plural, #polymorphic_parents, #pundit, #sample_file_path, #self_auth, #singular, #singular_class, #sql_type, #stimmify, #update_show_only

Instance Method Summary collapse

Methods inherited from AssociationField

#assoc_label, #field_error_name, #form_field_output, #form_show_only_output, #initialize, #line_field_output, #load_all_query_statement, #newline_after_field?, #prelookup_syntax, #raw_view_field, #search_field_output, #spec_make_assertion, #spec_related_column_lets, #spec_setup_and_change_act, #where_query_statement

Methods inherited from Field

#code_to_reset_match_if_search_is_blank, #display_boolean_as, #field_error_name, #field_output, #field_view_output, #form_field_output, #form_show_only_output, #getName, #hidden_output, #initialize, #label_class, #label_for, #line_field_output, #modified_display_output, #modify_binary?, #newline_after_field?, #prelookup_syntax, #spec_list_view_natural_assertion, #spec_make_assertion, #spec_random_data, #spec_related_column_lets, #spec_setup_and_change_act, #testing_name, #text_area_output, #viewable_output

Constructor Details

This class inherits a constructor from AssociationField

Instance Method Details

#spec_list_view_assertionObject



6
7
8
9
10
# File 'lib/generators/hot_glue/fields/uuid_field.rb', line 6

def spec_list_view_assertion
  assoc_name = name.to_s.gsub('_id','')
  association = eval("#{class_name}.reflect_on_association(:#{assoc_name})")
  "expect(page).to have_content(#{singular}#{1}.#{assoc_name}.#{HotGlue.derrive_reference_name(association.class_name)})"
end

#spec_setup_let_argObject



2
3
4
# File 'lib/generators/hot_glue/fields/uuid_field.rb', line 2

def spec_setup_let_arg
  "#{name.to_s.gsub('_id','')}: #{name.to_s.gsub('_id','')}1"
end