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

Sample App for Shard Issues #88

Closed
jihaia opened this issue Mar 28, 2012 · 8 comments
Closed

Sample App for Shard Issues #88

jihaia opened this issue Mar 28, 2012 · 8 comments

Comments

@jihaia
Copy link

jihaia commented Mar 28, 2012

I hope this is the right forum for this question/issue. I attempted to run the sample app but noticed that none of the shards were being populated. After a little exploring I determined that Octopus.enabled? was false and that Octopus.environments was ["production"]. Using the defaults in the app however I'm not sure how to overcome this as I'm in development mode and the shards.yml has no reference to this environment.

Am I missing something?

Cheers...

@alecslupu
Copy link

It happens to me as well ... any ways to avoid this ?

@thiagopradi
Copy link
Owner

I will look at the sample app and fix it. thanks for the reports.

@fabn
Copy link

fabn commented May 1, 2012

I'm experiencing the same issue, Octopus is not enabled with current git revision in Rails 3.2.3 in development environment.

After some debug with rails console I found that calling ActiveRecord::Base.connection_proxy restore Octopus behavior. Hope this help in order to find the actual issue.

[1] pry(main)> Octopus.enabled?
=> false
[2] pry(main)> Octopus.environments
=> ["production"]
[3] pry(main)> ActiveRecord::Base.connection_proxy
=> #<Octopus::Proxy:0x007ff8ecbb7500
 @adapters=#<Set: {"mysql2"}>,
[...]
[4] pry(main)> Octopus.environments
=> ["production", "development"]
[5] pry(main)> Octopus.enabled?
=> true

@fabn
Copy link

fabn commented May 1, 2012

It seems that the issue is in this commit ed41314, reverting exactly this line of that commit solves the issue in my case.

fabn added a commit to fabn/octopus that referenced this issue May 2, 2012
@fabn fabn mentioned this issue May 2, 2012
@Oscil8
Copy link

Oscil8 commented May 9, 2012

Ran into this issue trying to use octopus; basically it only works for 'production' environment without the fix. Verified that the fix solves my problem.

@choonkeat
Copy link

👍 ed41314 broke my db:migrate. verified that the fix solves my problem.

@NielsKSchjoedt
Copy link

Confirmed this actually fixed issue 100 as well

baseliners pushed a commit to baseliners/octopus that referenced this issue Jul 9, 2012
* fabn-master:
  Force loading of octopus configuration, should fix thiagopradi#88.
  Block does not receive bugfix
  Refactoring how groups are accessed to remove enapsulation breaking.
  Fixed a couple missed table renamings
  Remove ActionPack as a dependency.
  Refactoring to Octopus.enabled? for checking if we should hook into ActiveRecord or not.
  Remove using_enabled flag as it was never being read.
  Refactoring to make the switch a little more obvious.
  Default Octopus::Proxy to use the Octopus config on initialization.
  Require just "spec_helper" instead of the expanded path.
  Removing controller spec as it's pending and doesn't make sense.
  Add ar-octopus that auto-requires octopus.
  Shameless renaming of tables to include an underscore before the number.
  Rails 3.2.x compatability.
  Add rails32 appraisal and remove generated gemfiles.
  Removing MetricFu due to it not working on 1.9.3.
  Generalize the require to ActiveSupport class extensions.
  Ignore vim swap files.
  Fixing update_attributes on rails 3.0.x

Conflicts:
	Rakefile
	lib/octopus.rb
	lib/octopus/model.rb
	lib/octopus/proxy.rb
	spec/octopus/model_spec.rb
@sobrinho
Copy link
Collaborator

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

No branches or pull requests

8 participants