diff options
author | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-04-18 17:48:17 +0800 |
---|---|---|
committer | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-04-23 08:31:23 +0800 |
commit | 256699519a2b56c332303c0d21cd8ff8f7ef47d7 (patch) | |
tree | edee11845fb6db64f9b992bcde4d9ccb4335798b /config | |
parent | 624a1cdab4da67c7b363602aa1178d0e6ff63475 (diff) | |
download | gitlab-ce-256699519a2b56c332303c0d21cd8ff8f7ef47d7.tar.gz |
Bump Rails version to 5.1.7
Removes unneeded patches
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/active_record_attr_mutation_tracker.rb | 16 | ||||
-rw-r--r-- | config/initializers/active_record_becomes.rb | 29 |
2 files changed, 0 insertions, 45 deletions
diff --git a/config/initializers/active_record_attr_mutation_tracker.rb b/config/initializers/active_record_attr_mutation_tracker.rb deleted file mode 100644 index 0fd2ce56f2c..00000000000 --- a/config/initializers/active_record_attr_mutation_tracker.rb +++ /dev/null @@ -1,16 +0,0 @@ -# Remove once https://github.com/rails/rails/pull/32498 -# is released on a 5.1.x rails version. -# Commit on 5-1-stable branch: https://github.com/rails/rails/commit/6ef736625eddf6700f2e67f7849c79c92381abee - -module ActiveRecord - class AttributeMutationTracker - def changes - attr_names.each_with_object({}.with_indifferent_access) do |attr_name, result| - change = change_to_attribute(attr_name) - if change - result.merge!(attr_name => change) - end - end - end - end -end diff --git a/config/initializers/active_record_becomes.rb b/config/initializers/active_record_becomes.rb deleted file mode 100644 index ec4799deeef..00000000000 --- a/config/initializers/active_record_becomes.rb +++ /dev/null @@ -1,29 +0,0 @@ -# rubocop:disable Gitlab/ModuleWithInstanceVariables - -# Remove once https://github.com/rails/rails/issues/32867 -# is released on a 5.1.x rails version. -# Commit on 5-1-stable branch: https://github.com/rails/rails/commit/44f0df3f3980ba3aeca956839e1948b246ff34fe - -module ActiveRecord - module AttributeMethods - module Dirty - def attributes_in_database - mutations_from_database.changed_values - end - end - end - - module Persistence - def becomes(klass) - became = klass.new - became.instance_variable_set("@attributes", @attributes) - became.instance_variable_set("@mutation_tracker", @mutation_tracker ||= nil) - became.instance_variable_set("@mutations_from_database", @mutations_from_database ||= nil) - became.instance_variable_set("@changed_attributes", attributes_changed_by_setter) - became.instance_variable_set("@new_record", new_record?) - became.instance_variable_set("@destroyed", destroyed?) - became.errors.copy!(errors) - became - end - end -end |