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

Fix reader creation #572

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Fix table backend's attr reader building empty associations which can…
… prevent valid? on parent model (issue #569)
  • Loading branch information
mrbrdo committed May 4, 2022
commit 023b53d23cc60f3adc3769b93c78b4dede3c10b7
3 changes: 2 additions & 1 deletion lib/mobility/backends/table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ module Table
# @!group Backend Accessors
# @!macro backend_reader
def read(locale, **options)
translation_for(locale, **options).send(attribute)
translation = translations.in_locale(locale)
translation.send(attribute) if translation
Copy link
Owner

Choose a reason for hiding this comment

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

Hmm I think this is what the presence plugin is for. Also you have thrown away the **options here which will be a problem.

end

# @!macro backend_writer
Expand Down