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

Cannot visit RailsConfig::Options #52

Closed
sharp opened this issue Feb 20, 2013 · 2 comments
Closed

Cannot visit RailsConfig::Options #52

sharp opened this issue Feb 20, 2013 · 2 comments
Milestone

Comments

@sharp
Copy link

sharp commented Feb 20, 2013

This's my code:

cities: 
  - "杭州市":
class City < ActiveRecord::Base
  class << self
    def directory
      @active_cities = []
      Settings.cities.each do |name|
        #active_cities << find_by_name('') 
        @active_cities << where(name: name).first 
      end
      @active_cities
    end
  end
end

If I remove RailsConfig, it does work:

class City < ActiveRecord::Base
  class << self
    def directory
      @active_cities = []
      ['杭州市'].each do |name|
        #active_cities << find_by_name('') 
        @active_cities << where(name: name).first 
      end
      @active_cities
    end
  end
end
@jacquescrocker
Copy link

what's the error? is it nil exception? wonder if its just not getting loaded right

@pkuczynski
Copy link
Member

@SharpV could you please post some more info about this issue? I tried the syntax with current version and it seems to be working fine. If no feedback given, I would need to close this issue as invalid...

@pkuczynski pkuczynski added this to the 0.4 milestone Mar 31, 2014
@sharp sharp closed this as completed Apr 1, 2014
@pkuczynski pkuczynski modified the milestones: 0.3, 0.4 Apr 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants