Skip to content

Conversation

ritxi
Copy link

@ritxi ritxi commented Jul 31, 2017

  • Mongoid 6 & 7 upgrade
  • Remove alias_method_chain to make it compatible with rails 5.1 or above

@@ -1,5 +1,6 @@
require "simplecov"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing magic comment # frozen_string_literal: true.

it { expect(document.sharing_id).to match(/[a-z]{4}/) }
end

context "should raise exception for duplicated token" do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Block has too many lines. [26/25]

@ritxi ritxi changed the title Mongoid 6 and rails 5.2 upgrade Mongoid 6 and rails 5.1 upgrade Jul 31, 2017
@ritxi ritxi mentioned this pull request Aug 7, 2017
@@ -1,5 +1,6 @@
require "simplecov"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.

end
options
end
private
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/EmptyLinesAroundAccessModifier: Keep a blank line before and after private.

def initialize(options = {})
@options = merge_defaults validate_options(options)
end
module Mongoid
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.

@@ -0,0 +1,5 @@
module Mongoid
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.

end
end

describe "#is_duplicate_token_error?" do
describe "#duplicate_token_error?" do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/BlockLength: Block has too many lines. [32/25]

gem 'database_cleaner'
gem 'mongoid-rspec', '1.5.1'
gem "rspec"
gem "database_cleaner"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bundler/OrderedGems: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem database_cleaner should appear before rspec.

@ritxi ritxi changed the title Mongoid 6 and rails 5.1 upgrade Mongoid 6 & 7 and rails 5.2 & 6.0 upgrade Dec 3, 2019
@ritxi ritxi changed the title Mongoid 6 & 7 and rails 5.2 & 6.0 upgrade Mongoid 6 & 7 and rails 5.1, 5.2 & 6.0 upgrade Dec 3, 2019
@ritxi ritxi force-pushed the master branch 2 times, most recently from 2cdf762 to 4377440 Compare December 3, 2019 15:20
it { expect(document.sharing_id).to match(/[a-z]{4}/) }
end

context "should raise exception for duplicated token" do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/BlockLength: Block has too many lines. [30/25]

@jclusso
Copy link

jclusso commented Oct 28, 2020

@ritxi I'm using your master branch and I'm getting a zeitwerk error. NameError: uninitialized constant MongoidToken

$ bin/rails zeitwerk:check
Hold on, I am eager loading the application.
rails aborted!
NameError: uninitialized constant MongoidToken
/Users/jarrett/.rvm/gems/ruby-2.7.2@project/gems/zeitwerk-2.4.0/lib/zeitwerk/loader.rb:392:in `const_get'
/Users/jarrett/.rvm/gems/ruby-2.7.2@project/gems/zeitwerk-2.4.0/lib/zeitwerk/loader.rb:392:in `block (2 levels) in eager_load'
/Users/jarrett/.rvm/gems/ruby-2.7.2@project/gems/zeitwerk-2.4.0/lib/zeitwerk/loader.rb:742:in `block in ls'
/Users/jarrett/.rvm/gems/ruby-2.7.2@project/gems/zeitwerk-2.4.0/lib/zeitwerk/loader.rb:734:in `foreach'
/Users/jarrett/.rvm/gems/ruby-2.7.2@project/gems/zeitwerk-2.4.0/lib/zeitwerk/loader.rb:734:in `ls'
/Users/jarrett/.rvm/gems/ruby-2.7.2@project/gems/zeitwerk-2.4.0/lib/zeitwerk/loader.rb:387:in `block in eager_load'
/Users/jarrett/.rvm/gems/ruby-2.7.2@project/gems/zeitwerk-2.4.0/lib/zeitwerk/loader.rb:376:in `synchronize'
/Users/jarrett/.rvm/gems/ruby-2.7.2@project/gems/zeitwerk-2.4.0/lib/zeitwerk/loader.rb:376:in `eager_load'
/Users/jarrett/.rvm/gems/ruby-2.7.2@project/gems/zeitwerk-2.4.0/lib/zeitwerk/loader.rb:494:in `each'
/Users/jarrett/.rvm/gems/ruby-2.7.2@project/gems/zeitwerk-2.4.0/lib/zeitwerk/loader.rb:494:in `eager_load_all'
/Users/jarrett/.rvm/gems/ruby-2.7.2@project/gems/railties-6.0.3.4/lib/rails/tasks/zeitwerk.rake:11:in `block in <main>'
/Users/jarrett/.rvm/gems/ruby-2.7.2@project/gems/railties-6.0.3.4/lib/rails/tasks/zeitwerk.rake:47:in `block (2 levels) in <main>'
/Users/jarrett/.rvm/gems/ruby-2.7.2@project/gems/railties-6.0.3.4/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/Users/jarrett/.rvm/gems/ruby-2.7.2@project/gems/railties-6.0.3.4/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/Users/jarrett/.rvm/gems/ruby-2.7.2@project/gems/railties-6.0.3.4/lib/rails/command.rb:48:in `invoke'
/Users/jarrett/.rvm/gems/ruby-2.7.2@project/gems/railties-6.0.3.4/lib/rails/commands.rb:18:in `<main>'
/Users/jarrett/.rvm/gems/ruby-2.7.2@project/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/Users/jarrett/.rvm/gems/ruby-2.7.2@project/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/Users/jarrett/.rvm/gems/ruby-2.7.2@project/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/Users/jarrett/.rvm/gems/ruby-2.7.2@project/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/Users/jarrett/.rvm/gems/ruby-2.7.2@project/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/Users/jarrett/.rvm/gems/ruby-2.7.2@project/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `block in require'
/Users/jarrett/.rvm/gems/ruby-2.7.2@project/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
/Users/jarrett/.rvm/gems/ruby-2.7.2@project/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `require'
bin/rails:4:in `<main>'
Tasks: TOP => zeitwerk:check
(See full trace by running task with --trace)```

@ritxi
Copy link
Author

ritxi commented Oct 28, 2020 via email

@jclusso
Copy link

jclusso commented Oct 28, 2020

@ritxi I'm using zeitwerk (2.4.0) and rails (6.0.3.4). I can reproduce the error by just running the bin/rails zeitwerk:check.

@jclusso
Copy link

jclusso commented Oct 29, 2020

Not sure this is the best way to fix it, but this got the gem to load properly. I doubt this is the cleanest solution. jclusso@f1048a4

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.

3 participants