I want to create a family website which includes social networking
features.
The site should have dynamic articles, news, announcements, events,
gallery
etc public.
And it should have a social networking part for family members.
Also an admin controller for public contents and social networking
administration.
I am familiar with Ruby and RoR.
How can I start with these? Is there any app / cms for this? Will it be
good
to use TDD?
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.
On 24 Jun 2011 07:17, “Sayuj O.” [email protected] wrote:
Hi,
I want to create a family website which includes social networking
features.
The site should have dynamic articles, news, announcements, events,
gallery
etc public.
And it should have a social networking part for family members.
Also an admin controller for public contents and social networking
administration.
I am familiar with Ruby and RoR.
How can I start with these? Is there any app / cms for this? Will it be
good
to use TDD?
A User has many teachers. I’m trying to lock down my API. I have a
“user.add_teacher teacher” method and want to make that the only way
to “user.teachers << teacher”. Any way to lock down the teachers
association so it is read only from outside the user class and only
settable within self?
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.
A User has many teachers. I’m trying to lock down my API. I have a
“user.add_teacher teacher” method and want to make that the only way to
“user.teachers << teacher”. Any way to lock down the teachers association so it is
read only from outside the user class and only settable within self?
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.
could you overwrite << in your association proxy ie
class User
has_many :teachers do
def <<(*args)
raise “don’t use me!”
end
end
end
?
There are lots of other ways users can add teachers though, eg
user.teachers.build, Teacher.new(:user_id => some_user.id) etc so I
don’t thing you can make this completely watertight.
A User has many teachers. I’m trying to lock down my API. I have
a “user.add_teacher teacher” method and want
to make that the only way to “user.teachers << teacher”. Any way to lock
down the teachers association so
it is read only from outside the user class and only settable within self?
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
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.
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 –
Diaspora is awesome. But it’s developed under rails 2. Do you know, is
Diaspora available on rails 3 also?
Or is there any way to convert a rails 2 app to rails 3?
And, shall I customise Diaspora and use for my personal use on internet?
Is
there any problem for this?
Lovd by Less looks pretty good, havent had a chance to try it yet tho.
The site should have dynamic articles, news, announcements, events, gallery
sayuj