-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add #travel_to and a few more features #11
Conversation
@@ -43,13 +43,13 @@ | |||
::IronTrailSpecMigrator.new.migrate | |||
|
|||
Time.now.tap do |date| | |||
partition_name = "irontrail_chgn_#{date.strftime('%Y%m')}" | |||
partition_name = "irontrail_chgn_infinite" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the goal isn't to test pg_party
itself or partitioning. So since I'm now also using dates far in the past in some tests, I'll just create one big partition to accomodate them all.
@@ -19,6 +19,13 @@ def association_scope | |||
scope | |||
end | |||
|
|||
def reader | |||
res = super | |||
res.extend(CollectionProxyMixin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder what YJIT thinks of this. Anyway, not a concern :)
if val.length == 1 | ||
val[0] | ||
else | ||
val.to_h { |k| [k.to_s, k] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double-checking if this logic is correct, seems wrong to me considering the rest of the method. Also, I am unsure if you are and how hard it is to cover this path.
val.to_h { |k| [k.to_s, k] } | |
val.to_h { |k| [k.to_s, k] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is correct. I have to yet add simplecov
to this project, won't do in this PR tho. This code is covered by the spec in spec/services/morpheus_spec.rb
:)
This basically deals with tables that are mapped by multiple models, that is, activerecord Single Table Inheritance. So the mapping here becomes a hash mapping the model name to the model itself. The index
variable will look something like:
index = {
'some_sti_table' => {
'ModelA' => ModelA,
'ModelB' => ModelB
},
'some_other_table' => SomeOtherTable
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
Jira task
This PR adds a few things, please see the changes in the CHANGELOG.md file (link which will eventually become broken).