Skip to content

rake c2:discover barfs on Informant::FormElement scope #1

@burgalon

Description

@burgalon

➜ example-app git:(master) ✗ rake c2:discover
rake aborted!

Problem:
Defining a scope of value {:where=>{:enabled=>true}} on C2::Informant::FormElement is not allowed.
Summary:
Scopes in Mongoid must be either criteria objects or procs that wrap criteria objects.
Resolution:
Change the scope to be a criteria or proc wrapped critera.
Example:
  class Band
    include Mongoid::Document
    field :active, type: Boolean, default: true
    scope :active, where(active: true)
    scope :inactive, ->{ where(active: false) }
  end

Tasks: TOP => c2:discover
(See full trace by running task with --trace)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions