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

Initialization Hook #74

Merged
merged 2 commits into from
Jan 18, 2013
Merged

Initialization Hook #74

merged 2 commits into from
Jan 18, 2013

Conversation

pboling
Copy link
Contributor

@pboling pboling commented Jan 18, 2013

Provides a named initialization hook so people depending on the gem can ensure pre-requisite configuration is complete prior to initialization of neography itself.

When I upgraded from 1.0.3 to 1.0.4 I became unable to boot my app, or run my specs due to an error.

cannot load such file -- neography/rest/extensions (LoadError)
/Users/pboling/.rvm/gems/ruby-1.9.3-head@simple/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
/Users/pboling/.rvm/gems/ruby-1.9.3-head@simple/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require'
/Users/pboling/.rvm/gems/ruby-1.9.3-head@simple/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
/Users/pboling/.rvm/gems/ruby-1.9.3-head@simple/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
/Users/pboling/.rvm/gems/ruby-1.9.3-head@simple/gems/neography-1.0.4/lib/neography/rest.rb:23:in `<top (required)>'

With this change I am again able to boot and test my app. Additionally I can now clean up the way I configure the Neography gem (previously my pre-config had to be in application.rb, ir in an initializer which was ordered alphabetically higher than neography, both of which just feel wrong).

Example:

module Simple
  class NeographyInitialization < Rails::Railtie
    initializer 'simple.neography_initialization', before: 'neography.configure' do
      # require a file where I read from a YAML;
      # load configs for the env into a constant;
      # which is referenced from my Neography configuration in config/initializers
      require 'simple/neography' 
    end
  end
end

@maxdemarzi
Copy link
Owner

Thanks Peter! I think I also messed up the gem release and it grabbed my work in progress 😦

maxdemarzi added a commit that referenced this pull request Jan 18, 2013
@maxdemarzi maxdemarzi merged commit 36e025f into maxdemarzi:master Jan 18, 2013
willkessler pushed a commit to willkessler/neography that referenced this pull request Apr 21, 2014
added reverse casting (used to store date/time) and Date/Time data type ...
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