3
을 나는 Configurable
모델이 : 내 pages_controller
에 Configurable
를 참조하면레일 구성 모델 ActiveSupport와 충돌 :: 구성 : 구성 : 클래스
# /models/configuration.rb
class Configuration < ActiveRecord::Base
end
를, 잘 작동 :
class PagesController < ApplicationController
def search
@description = Configuration.find_by_name('description') || nil
end
end
그러나 내 application_controller.rb
에서 참조 할 때
class ApplicationController < ActionController::Base
def get_menu
@menu = Configuration.where(name: 'menu') || nil
end
end
오류 undefined method 'where' for ActiveSupport::Configurable::Configuration:Class
가 표시됩니다. Configuration
모델과 ActiveSupport::Configurable::Configuration:Class
이 이와 같이 충돌하거나 내 모델 Configuration
을 직접 참조하지 못하게하려면 어떻게해야하나요?
미리 감사드립니다.
저에게 도움이되었으므로 타이머가 끝나면 올바르게 표시해 드리겠습니다. '::'앞에 무엇인가 암시 된 것이 궁금합니다. –