Use gitlab-default_value_with Rails 5
This forks live at https://github.com/gitlabhq/default_value_for/tree/69-fix-action_controller-parameters-handling and fixes an issue where default_value_for wouldn't handle `ActionController::Parameters` correctly with Rails 5. This fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/54093. Signed-off-by: Rémy Coutable <remy@rymai.me>
Showing
... | @@ -4,10 +4,9 @@ def rails5? | ... | @@ -4,10 +4,9 @@ def rails5? |
end | end | ||
gem_versions = {} | gem_versions = {} | ||
gem_versions['activerecord_sane_schema_dumper'] = rails5? ? '1.0' : '0.2' | gem_versions['activerecord_sane_schema_dumper'] = rails5? ? '1.0' : '0.2' | ||
gem_versions['default_value_for'] = rails5? ? '~> 3.0.5' : '~> 3.0.0' | gem_versions['rails'] = rails5? ? '5.0.7' : '4.2.10' | ||
gem_versions['rails'] = rails5? ? '5.0.7' : '4.2.10' | gem_versions['rails-i18n'] = rails5? ? '~> 5.1' : '~> 4.0.9' | ||
gem_versions['rails-i18n'] = rails5? ? '~> 5.1' : '~> 4.0.9' | |||
# --- The end of special code for migrating to Rails 5.0 --- | # --- The end of special code for migrating to Rails 5.0 --- | ||
source 'https://rubygems.org' | source 'https://rubygems.org' | ||
... | @@ -21,7 +20,11 @@ gem 'responders', '~> 2.0' | ... | @@ -21,7 +20,11 @@ gem 'responders', '~> 2.0' |
gem 'sprockets', '~> 3.7.0' | gem 'sprockets', '~> 3.7.0' | ||
# Default values for AR models | # Default values for AR models | ||
gem 'default_value_for', gem_versions['default_value_for'] | if rails5? | ||
gem 'gitlab-default_value_for', '~> 3.1.1', require: 'default_value_for' | |||
else | |||
gem 'default_value_for', '~> 3.0.0' | |||
end | |||
# Supported DBs | # Supported DBs | ||
gem 'mysql2', '~> 0.4.10', group: :mysql | gem 'mysql2', '~> 0.4.10', group: :mysql | ||
... | ... |
Please register or sign in to comment