Open JoeCohen opened 2 weeks ago
One thing to be aware of: when defining your models, you will need a line defining the attributes, because they can't be inferred from db columns.
attributes: :this, :that, :the_other
On my model, i'm doing this by iterating through some params defined elsewhere, but you'll probably want to write the list explicitly.
From there, you can just write instance methods and class methods the usual way. There seem to be so few gotchas, it's relaxing!
thanks again. i’ll give it a try on tues
Sent from Gmail Mobile
El El dom, sept 29, 2024 a la(s) 04:54, andrew nimmo < @.***> escribió:
One thing to be aware of: when defining your models, you will need a line defining the attributes, because they can't be inferred from db columns.
attributes: :this, :that, :the_other
On my model, i'm doing this by iterating through some params defined elsewhere, but you'll probably want to write the list explicitly.
From there, you can just write instance methods and class methods the usual way. There seem to be so few gotchas, it's relaxing!
— Reply to this email directly, view it on GitHub https://github.com/MushroomObserver/mushroom-observer/issues/2432#issuecomment-2381327216, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALDFFQOULTXO3WE4F7PTTZY7TABAVCNFSM6AAAAABPBULYR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBRGMZDOMRRGY . You are receiving this because you were assigned.Message ID: @.***>
Refactor
Inat::Obs
to use a non-db backed model with attribute accessors instead of a Hash lookup.Example PR #2337