Sha256: 2d323226d5d4356036f35a9d665d9f27d1830f99994428a47564a57b2a62f847

Contents?: true

Size: 594 Bytes

Versions: 16

Compression:

Stored size: 594 Bytes

Contents

module AccessFixtureTestPatches

    def table_rows
        results = super
        if model_class && model_class < ActiveRecord::Base && model_class.record_modifications
            results[ table_name ].each do | row |
                # 135138680 is the 'admin' user
                row['created_by_id'] ||= 135138680 if model_class.column_names.include?('created_by_id')
                row['updated_by_id'] ||= 135138680 if model_class.column_names.include?('updated_by_id')
            end
        end
        results
    end
end

ActiveRecord::FixtureSet.prepend AccessFixtureTestPatches

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
hippo-fw-0.9.9 lib/hippo/access/test_fixture_extensions.rb
hippo-fw-0.9.8 lib/hippo/access/test_fixture_extensions.rb
hippo-fw-0.9.7 lib/hippo/access/test_fixture_extensions.rb
hippo-fw-0.9.6 lib/hippo/access/test_fixture_extensions.rb
hippo-fw-0.9.5 lib/hippo/access/test_fixture_extensions.rb
hippo-fw-0.9.4 lib/hippo/access/test_fixture_extensions.rb
hippo-fw-0.9.3 lib/hippo/access/test_fixture_extensions.rb
hippo-fw-0.9.2 lib/hippo/access/test_fixture_extensions.rb
hippo-fw-0.9.1 lib/hippo/access/test_fixture_extensions.rb
lanes-0.8.3 lib/lanes/access/test_fixture_extensions.rb
lanes-0.8.2 lib/lanes/access/test_fixture_extensions.rb
lanes-0.8.1 lib/lanes/access/test_fixture_extensions.rb
lanes-0.8.0 lib/lanes/access/test_fixture_extensions.rb
lanes-0.7.0 lib/lanes/access/test_fixture_extensions.rb
lanes-0.6.1 lib/lanes/access/test_fixture_extensions.rb
lanes-0.6.0 lib/lanes/access/test_fixture_extensions.rb