ruby on rails - Is this an anti-pattern or is this ok? -


i have following:

exercise.log_entries.for_user(@user).for_date(date) 

is bad code rails? can't @user.log_entries because needs scoped specific exercise.

is considered ok or bad? how refactor?

if you're using access controls, it's little smelly, though wouldn't complain loudly it. concern not leading off access controls means future refactoring might end breaking controls, embarrassing @ least.

how associations set up? possible?

@user.log_entries.for_exercise(exercise).for_date(date) 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -