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

Rails 5.0.1 support #13302

Merged
merged 5 commits into from
Jan 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ unless dependencies.detect { |d| d.name == "manageiq-ui-classic" }
end

# Unmodified gems
gem "actioncable", "~>5.0.0"
gem "activerecord-session_store", "~>1.0.0"
gem "acts_as_list", "~>0.7.2"
gem "acts_as_tree", "~>2.1.0" # acts_as_tree needs to be required so that it loads before ancestry
Expand Down Expand Up @@ -88,7 +87,7 @@ gem "paperclip", "~>4.3.0"
gem "pg-pglogical", "~>1.0.0", :require => false
gem "puma", "~>3.3.0"
gem "query_relation", "~>0.1.0", :require => false
gem "rails", "~>5.0.0", ">= 5.0.0.1", "< 5.0.1"
gem "rails", "~>5.0.1"
gem "rails-controller-testing", :require => false
gem "rails-i18n", "~>5.x"
gem "recursive-open-struct", "~>1.0.0"
Expand Down
52 changes: 0 additions & 52 deletions config/initializers/action_cable_patch.rb

This file was deleted.

8 changes: 8 additions & 0 deletions lib/extensions/ar_virtual.rb
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,14 @@ def virtual_attribute_names
end
end

def attributes_builder
@attributes_builder ||= ::ActiveRecord::AttributeSet::Builder.new(attribute_types, primary_key) do |name|
unless columns_hash.key?(name) || virtual_attribute?(name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would normally whine about unless with an || but since the original rails code has unless... I'm good with keeping it as close to the original code. I'll just say my brain still needs to convert this to an if.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to original code thought and even still I think it looks good 😄 If there were a negation in there it would be a whole different story.

_default_attributes[name].dup
end
end
end

private

def load_schema!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@
:manager_ref => [:vm_or_template])
@data[:disks] = ::ManagerRefresh::InventoryCollection.new(
Disk,
:arel => @ems.disks.joins(:hardware => :vm_or_template).where(:hardware => {:vms => {:ems_ref => vm_refs}}),
:arel => @ems.disks.joins(:hardware => :vm_or_template).where('hardware' => {'vms' => {'ems_ref' => vm_refs}}),
:manager_ref => [:hardware, :device_name])

@vm_data_3 = vm_data(3).merge(
Expand Down Expand Up @@ -393,7 +393,7 @@
:manager_ref => [:vm_or_template])
@data[:disks] = ::ManagerRefresh::InventoryCollection.new(
Disk,
:arel => @ems.disks.joins(:hardware => :vm_or_template).where(:hardware => {:vms => {:ems_ref => vm_refs}}),
:arel => @ems.disks.joins(:hardware => :vm_or_template).where('hardware' => {'vms' => {'ems_ref' => vm_refs}}),
:manager_ref => [:hardware, :device_name])
@data[:image_hardwares] = ::ManagerRefresh::InventoryCollection.new(
Hardware,
Expand Down