socialforge/app/helpers/shares_helper.rb

16 lines
463 B
Ruby
Raw Normal View History

module SharesHelper
2013-10-21 08:57:55 +08:00
def options_from_select_project(user)
@membership = user.memberships.all(:conditions => Project.visible_condition(User.current))
@option = []
@membership.each do |membership|
unless(membership.project.project_type==1)
2014-07-08 18:02:10 +08:00
#可被用户引用的项目
if user.allowed_to?(:quote_project, membership.project)
2013-10-21 08:57:55 +08:00
@option << membership.project
end
2013-10-21 08:57:55 +08:00
end
end
options_for_select(@option)
end
end