Open dasch opened 12 years ago
I see your point, I think its a question of convenience vs decoupling, user.cia_events.first
reads nicer to me then CIA::Event.for_subject(user)
. I dont think there will be any collisions and it is pretty easy to search.replace. Do you have any special scenario in mind that would be fixed/improved or just as a general decoupling ?
It's mostly in order to facility easy testing with stubs. Stubbing associations is notoriously hard in Active Record :-/
No problems so far, lets add them if we need them :)
Would it be possible to maintain a greater degree of decoupling between the subject models and the Event model? In particular, the
cia_events
andcia_attribute_changes
feel a bit backward to me: we could just as well do eg.CIA::Event.for_subject(subject)
andCIA::AttributeChange.for_subject(subject)
. That way, the subject classes need to know less about CIA.