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

В development-е работает, а в production нет. #21

Closed
dapi opened this issue Apr 24, 2015 · 8 comments
Closed

В development-е работает, а в production нет. #21

dapi opened this issue Apr 24, 2015 · 8 comments

Comments

@dapi
Copy link

dapi commented Apr 24, 2015

Один и тот-же код в developmеnt-е нормально ловит валидацию на длину строки. А в продавшее нет. И там и там postgresql. Может есть секретик какой?

@melekes
Copy link
Owner

melekes commented Apr 26, 2015

Секретиков нет) Если gemfile.lock одинаков и там и там, и схема идентичная, то такого не может быть

@melekes
Copy link
Owner

melekes commented Apr 26, 2015

@dapi Можешь больше инфы предоставить? gist?

@zzet
Copy link
Contributor

zzet commented Apr 26, 2015

Антон, может дело в предзагрузке и кешировании кода? Может в каком геме аналогичный метод определен и они конфликтуют (кто кого перетрут). Гист в таком случае вряд ли поможет.

@melekes
Copy link
Owner

melekes commented May 20, 2015

Closing due to inactivity.

@dapi
Copy link
Author

dapi commented Mar 16, 2016

А проблема-то есть

@dapi
Copy link
Author

dapi commented Mar 16, 2016

Гем реально не работает в продакшене, потому что инициализируется позже загрузки моделей. Вы сами-то как им пользуетесь?

@dapi
Copy link
Author

dapi commented Mar 16, 2016

Конкретно если cache_classes=true то эта строчка никогда не выполняется- https://github.com/kaize/valle/blob/master/lib/valle/railtie.rb#L4

Quick fix:

if Rails.configuration.cache_classes                                                                                                                                                                                                    
  ActiveRecord::Base.subclasses.select(&:table_exists?).each do |model| 
    Valle::Manager.add_validators(model)
  end
end

@dapi
Copy link
Author

dapi commented Mar 17, 2016

вопрос снят этим комитом - 0025615

Спасибо!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants