Hi,
You may want to tried something similar on the github. Someone may already done it. Anyway I think it would be good to start with Tdd techniques because it will save your time.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Something other than the boilerplate README would be useful for people
to get an idea what the code is about
I'm not just looking for attr_protected to avoid mass assignment. I'm specifically looking to ensure that nobody on the team will write "user.teachers << teacher" and bypass all of the additional business logic in the add_teacher method. I know I can do a "find within project" for "teachers <<" but don't want to remember to have to do that.
I know my specs should catch anything that's amiss, and I'm not sure whether this is an idiomatic approach in Ruby/Rails but I'd appreciate any thoughts/suggestions.
Thanks,
Peter
> I'm specifically looking to ensure that nobody on the team will write
> "user.teachers << teacher" and bypass all of the additional business
> logic in the add_teacher method.
Maybe you could instead just use the Association callbacks --
before_add, after_add, before_remove, after_remove
to run your business logic on each operation?
FWIW,
--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
It seems there is business logic to check when adding teachers to users which
goes beyond a simple "validates_associated :teacher". Rather than restrict
developers to a single method call, I would investigate custom validations.
See http://guides.rubyonrails.org/active_record_validations_callbacks.html
Try some of these:
https://github.com/insoshi/insoshi#readme
http://communityengine.org/
http://lovdbyless.com/
http://www.enginey.com/
Lovd by Less looks pretty good, haven’t had a chance to try it yet tho.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.