Skip to content

Conversation

@moseshll
Copy link
Collaborator

This is semi-old non-rebased code for edutainment purposes only.

@aelkiss see app/views/ht_downloads/index.html.erb for use of data-force-export and data-visible to keep seq out of the UI but include it in the export.

Do not merge this PR.

TODO: need tests
"pages" => :pages_eq,
"full_download" => :full_download_eq
"full_download" => :full_download_eq,
"seq" => :seq_eq
Copy link
Collaborator Author

@moseshll moseshll Jan 21, 2026

Choose a reason for hiding this comment

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

I'm not sure if ransack needs to even be aware of seq, it won't get used since there's no need to expose it in the UI as a search term.

class="<%= th_class %>"
data-filter-control="<%= control %>"

data-force-export="true"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the only interesting bit.

end
end.sort.uniq
pages = seq.count
seq = seq.join(",")
Copy link
Collaborator Author

@moseshll moseshll Jan 21, 2026

Choose a reason for hiding this comment

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

I was happy with this little block of code to make a reasonable seq value. You'll never see it except in the exports.

aelkiss added a commit that referenced this pull request Jan 21, 2026
From #281

TODO:
* Incorporate seeds from that PR; test it out
* Consider migrating controller test for download export to rspec
  request spec
aelkiss added a commit that referenced this pull request Jan 22, 2026
* Add seq in export, but hide from display
* Prevent table export from trying to interpret numbers (otherwise it
  tries to interpret e.g. seq="9,10,11" as if it's a number like
  1,000,000)
* Incorporates some suggestions from #281
* Request spec for downloads controller json; migrate other downloads
  controller json tests from minitest
aelkiss added a commit that referenced this pull request Jan 22, 2026
* Add seq in export, but hide from display
* Prevent table export from trying to interpret numbers (otherwise it
  tries to interpret e.g. seq="9,10,11" as if it's a number like
  1,000,000)
* Incorporates some suggestions from #281
* Request spec for downloads controller json; migrate other downloads
  controller json tests from minitest
aelkiss added a commit that referenced this pull request Jan 22, 2026
* Add seq in export, but hide from display
* Prevent table export from trying to interpret numbers (otherwise it
  tries to interpret e.g. seq="9,10,11" as if it's a number like
  1,000,000)
* Incorporates some suggestions from #281
* Request spec for downloads controller json; migrate other downloads
  controller json tests from minitest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants