Module: FixtureRecord
- Extended by:
- ActiveSupport::Concern
- Includes:
- AssociationTraversal, BelongsToUpdation, FilterableAttributes, Naming, Sanitizable
- Defined in:
- lib/fixture_record.rb,
lib/fixture_record/cache.rb,
lib/fixture_record/naming.rb,
lib/fixture_record/railtie.rb,
lib/fixture_record/version.rb,
lib/fixture_record/belongs_to_updation.rb,
lib/fixture_record/association_traversal.rb,
lib/fixture_record/filterable_attributes.rb,
lib/fixture_record/sanitizers/simple_timestamp.rb
Defined Under Namespace
Modules: AssociationTraversal, BelongsToUpdation, FilterableAttributes, Generators, Naming, Sanitizable, Sanitizers
Classes: Cache, Data, Railtie
Constant Summary
collapse
- Sanitizer =
FixtureRecord::Sanitizable::Base
- VERSION =
"1.0"
Instance Attribute Summary
#_traversed_fixture_record_associations
Attributes included from Naming
#fixture_record_prefix, #fixture_record_suffix
Class Method Summary
collapse
Instance Method Summary
collapse
#update_belongs_to_fixture_record_associations
#sanitize_attributes_for_fxiture_record, #sanitize_value_for_test_fixture
#filter_attributes_for_fxiture_record
#traverse_fixture_record_associations
Methods included from Naming
#test_fixture_name
Class Method Details
.base_path ⇒ Object
48
49
50
|
# File 'lib/fixture_record.rb', line 48
def base_path
@@base_path.is_a?(String) ? @@base_path : @@base_path.call
end
|
44
45
46
|
# File 'lib/fixture_record.rb', line 44
def configure
yield self
end
|
.locked? ⇒ Boolean
71
72
73
|
# File 'lib/fixture_record.rb', line 71
def locked?
@@_locked_by.present?
end
|
.locked_by?(owner) ⇒ Boolean
85
86
87
|
# File 'lib/fixture_record.rb', line 85
def locked_by?(owner)
@@_locked_by == owner
end
|
.name_handler=(proc_or_klass) ⇒ Object
52
53
54
|
# File 'lib/fixture_record.rb', line 52
def name_handler=(proc_or_klass)
@@name_handler = proc_or_klass.is_a?(Class) ? proc_or_klass.new : proc_or_klass
end
|
.release!(owner) ⇒ Object
75
76
77
78
79
80
81
82
83
|
# File 'lib/fixture_record.rb', line 75
def release!(owner)
if locked_by?(owner)
@@_locked_by = nil
@@_cache = nil
true
else
false
end
end
|
.sanitize_column_regex(col_regex, with:) ⇒ Object
56
57
58
59
60
61
|
# File 'lib/fixture_record.rb', line 56
def sanitize_column_regex(col_regex, with:)
registry_name_or_klass = with
klass = registry_name_or_klass.is_a?(Symbol) ? FixtureRecord.registry[registry_name_or_klass] : registry_name_or_klass
klass_instance = klass.is_a?(Class) ? klass.new : klass
FixtureRecord.registry.sanitize_pattern col_regex, with: klass_instance
end
|
Instance Method Details
#to_fixture_record(*associations) ⇒ Object