Skip to content

Commit fc31347

Browse files
authored
Merge pull request #664 from kholbekj/patch-1
Add warning for lambda default_currency for rails7
2 parents 93d2ee4 + 0cb70c1 commit fc31347

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,10 @@ MoneyRails.configure do |config|
277277
end
278278
```
279279

280+
Be aware that this **does not work in Rails 7+**, as the lambda is evaluated
281+
immediately, and therefore requires your model to be already loaded.
282+
Workarounds include wrapping the initialization in `ActiveSupport::Reloader.to_prepare`, or creating a function that rescues unloaded constants with an initialization-time default, and running that in your lambda.
283+
280284
In many cases this is not enough, so there are some other options to
281285
meet your needs.
282286

0 commit comments

Comments
 (0)