1330 fix #1331

Merged
merged 5 commits into from Feb 4, 2017

Projects

None yet

3 participants

@cheerfulstoic
Member

Fixes #1330

This pull introduces/changes:

  • Migration rake tasks are always loaded since they are needed for anybody using the neo4j gem (not just rails apps)
  • Removed dependency on the Railtie for loading an environment for non-Rails apps (I'd still like this to be able to look for the neo4j.yml, but this should work for now)

Pings:
@subvertallchris
@ProGM

cheerfulstoic added some commits Dec 17, 2016
@cheerfulstoic cheerfulstoic Add wrap_level: :proc for adaptor for non-Rails so that ActiveNode / …
…ActiveRel get wrapped

(cherry picked from commit 618246b)
de03849
@cheerfulstoic cheerfulstoic Load migration.rake when loading neo4j and don't depend on Railtie 2ecf74a
@cheerfulstoic cheerfulstoic Can remove this from railtie now
c8afcf9
@codecov-io
codecov-io commented Dec 19, 2016 edited

Codecov Report

Merging #1331 into master will increase coverage by -0.47%.

@@            Coverage Diff             @@
##           master    #1331      +/-   ##
==========================================
- Coverage   97.06%   96.59%   -0.47%     
==========================================
  Files         203      205       +2     
  Lines       12337    12704     +367     
==========================================
+ Hits        11975    12272     +297     
- Misses        362      432      +70
Impacted Files Coverage Δ
lib/neo4j/railtie.rb 85.41% <ø> (+3.59%)
lib/neo4j/tasks/migration.rake 33.73% <ø> (ø)
lib/neo4j.rb 97.93% <100%> (+0.02%)
spec/e2e/railtie_spec.rb 96.96% <ø> (-3.04%)
spec/e2e/active_model_spec.rb 97.1% <ø> (-0.62%)
lib/neo4j/shared/callbacks.rb 100% <ø> (ø)
spec/shared_examples/after_commit.rb 91.89% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3fa2949...975dd7a. Read the comment docs.

lib/neo4j/tasks/migration.rake
+ neo4j_url = ENV['NEO4J_URL'] || 'http://localhost:7474'
+ $:.unshift File.dirname('./')
+ Neo4j::ActiveBase.on_establish_session do
+ type = neo4j_url.match(/^bolt/) ? :bolt : http
@phreakocious
phreakocious Feb 4, 2017

I think http here should be :http ..
This commit resolves my issues if I set that environment variable to a bolt:// URL in the Rakefile but fails with this otherwise:
'NameError: undefined local variable or method `http' for main:Object'

@cheerfulstoic
cheerfulstoic Feb 4, 2017 Member

Great catch, thanks! Since you can confirm this I'll go ahead and get it in and release a patch version

cheerfulstoic added some commits Feb 4, 2017
@cheerfulstoic cheerfulstoic Fixing type (thanks @phreakocious)
df1bc68
@cheerfulstoic cheerfulstoic Rubocop
975dd7a
@cheerfulstoic
Member

Fixes #1353

@cheerfulstoic cheerfulstoic merged commit a29974b into master Feb 4, 2017

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment