Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

document application_record work around #91

Open
@catmando

Description

@catmando
  1. Add this file to app/models/application_record.rb
# app/models/application_record.rb
# the presence of this file prevents rails migrations from recreating application_record.rb see https://github.com/rails/rails/issues/29407
require 'models/000_application_record.rb'
  1. Then your real application_record should be named 000_application_record.rb, and placed in hyperloop/models directory.
 # app/hyperloop/models/000_application_record.rb
class ApplicationRecord < ActiveRecord::Base
   # whatever you want
end

This accomplishes 2 things
First - the app/models/application_record.rb prevents rails generators from recreating it. If you just move the application record to app/hyperloop/models, then every time you use the rails generator to create a model, it will think application record does not exist, and add another one!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions