Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

const RailsAdmin::Adapters::ActiveRecord missing every time I initial… #3088

Merged
merged 1 commit into from
Dec 5, 2018

Conversation

victor95pc
Copy link
Contributor

@victor95pc victor95pc commented Nov 15, 2018

Every time I enter on a page which has a model with associations on Mongoid, I always receive a const RailsAdmin::Adapters::ActiveRecord is missing error, so digging the code I found there isn't any require for this for file rails_admin/adapters/active_record/association, after I require the file the model started loading properly.

my specs:

Rails: 5.2.1
Ruby: 2.5.3p105

This is my models

class PatternConfig
  include Mongoid::Document

  field :patern_name, type: String
  field :token,       type: String
  field :service,     type: String

  index({ patern_name: 1 }, { unique: true })

  embeds_many :patterns

  accepts_nested_attributes_for :patterns, allow_destroy: true

  rails_admin do
    edit do
      field :patern_name
      field :patterns
    end
  end
end

class Pattern
  include Mongoid::Document

  field :token,   type: String

  embedded_in :pattern_config

  rails_admin do
    edit do
      field :hour, :integer
    end
  end
end

@mshibuya mshibuya merged commit 0939adf into railsadminteam:master Dec 5, 2018
@mshibuya
Copy link
Member

mshibuya commented Dec 5, 2018

Thanks!

mshibuya added a commit that referenced this pull request Jan 26, 2019
mshibuya added a commit that referenced this pull request Jan 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants