Increased decoupling #1

Open
dasch opened this Issue May 22, 2012 · 3 comments

Projects

None yet

2 participants

@dasch

Would it be possible to maintain a greater degree of decoupling between the subject models and the Event model? In particular, the cia_events and cia_attribute_changes feel a bit backward to me: we could just as well do eg. CIA::Event.for_subject(subject) and CIA::AttributeChange.for_subject(subject). That way, the subject classes need to know less about CIA.

@grosser
Owner

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 ?

@dasch

It's mostly in order to facility easy testing with stubs. Stubbing associations is notoriously hard in Active Record :-/

@grosser
Owner

No problems so far, lets add them if we need them :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment