Skip to content

undefined method `macro' for nil:NilClass #3

@SteveRedka

Description

@SteveRedka

Ruby: 2.4.1
Rails: 5.2.1

Error:

An error occurred while loading ./spec/models/post_spec.rb.
Failure/Error: persistize :average_rating, depending_on: :ratings

NoMethodError:
  undefined method `macro' for nil:NilClass
# /home/how/.rvm/gems/ruby-2.4.1/gems/persistize-0.2.0/lib/persistize.rb:52:in `generate_callback'
# /home/how/.rvm/gems/ruby-2.4.1/gems/persistize-0.2.0/lib/persistize.rb:41:in `block (2 levels) in persistize'
# /home/how/.rvm/gems/ruby-2.4.1/gems/persistize-0.2.0/lib/persistize.rb:40:in `each'
# /home/how/.rvm/gems/ruby-2.4.1/gems/persistize-0.2.0/lib/persistize.rb:40:in `block in persistize'
# /home/how/.rvm/gems/ruby-2.4.1/gems/persistize-0.2.0/lib/persistize.rb:6:in `each'
# /home/how/.rvm/gems/ruby-2.4.1/gems/persistize-0.2.0/lib/persistize.rb:6:in `persistize'
# ./app/models/post.rb:12:in `<class:Post>'
# ./app/models/post.rb:1:in `<main>'
# /home/how/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
# /home/how/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
# /home/how/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
# /home/how/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
# /home/how/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
# /home/how/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:46:in `block in require_or_load'
# /home/how/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
# /home/how/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:45:in `require_or_load'
# /home/how/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:58:in `block in load_missing_constant'
# /home/how/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
# /home/how/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:57:in `load_missing_constant'
# ./spec/models/post_spec.rb:3:in `<top (required)>'

Finished in 0.11779 seconds (files took 4.51 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples

I made a branch in my repository where this error happens:

https://github.com/SteveRedka/umbrellio_forum/tree/persistize

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions