change some lambdas to procs

starting in 1.9.x, the number of args passed to a lambda is enforced --
procs still allow variable number of args

Change-Id: Id1a4338d10b87b870cd53989ea17ea422d848278
Reviewed-on: https://gerrit.instructure.com/5834
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
This commit is contained in:
Brian Palmer 2011-09-26 22:54:24 -06:00
parent 0279c645d4
commit 21b4db002d
13 changed files with 13 additions and 13 deletions

View File

@ -42,7 +42,7 @@ class ApplicationController < ActionController::Base
before_filter :fix_xhr_requests
before_filter :init_body_classes_and_active_tab
add_crumb(lambda { I18n.t('links.dashboard', "My Dashboard") }, :root_path, :class => "home")
add_crumb(proc { I18n.t('links.dashboard', "My Dashboard") }, :root_path, :class => "home")
protected

View File

@ -19,7 +19,7 @@
class AssignmentsController < ApplicationController
include GoogleDocs
before_filter :require_context
add_crumb(lambda { t '#crumbs.assignments', "Assignments" }, :except => [:destroy, :syllabus, :index]) { |c| c.send :course_assignments_path, c.instance_variable_get("@context") }
add_crumb(proc { t '#crumbs.assignments', "Assignments" }, :except => [:destroy, :syllabus, :index]) { |c| c.send :course_assignments_path, c.instance_variable_get("@context") }
before_filter { |c| c.active_tab = "assignments" }
def index

View File

@ -19,7 +19,7 @@
class CalendarEventsController < ApplicationController
before_filter :require_context
add_crumb(lambda { t(:'#crumbs.calendar_events', "Calendar Events")}, :only => [:show, :new, :edit]) { |c| c.send :calendar_url_for, c.instance_variable_get("@context") }
add_crumb(proc { t(:'#crumbs.calendar_events', "Calendar Events")}, :only => [:show, :new, :edit]) { |c| c.send :calendar_url_for, c.instance_variable_get("@context") }
def show

View File

@ -18,7 +18,7 @@
class ConferencesController < ApplicationController
before_filter :require_context
add_crumb(lambda{ t '#crumbs.conferences', "Conferences"}) { |c| c.send(:named_context_url, c.instance_variable_get("@context"), :context_conferences_url) }
add_crumb(proc{ t '#crumbs.conferences', "Conferences"}) { |c| c.send(:named_context_url, c.instance_variable_get("@context"), :context_conferences_url) }
before_filter { |c| c.active_tab = "conferences" }
before_filter :require_config

View File

@ -18,7 +18,7 @@
class ContentImportsController < ApplicationController
before_filter :require_context
add_crumb(lambda { t 'crumbs.content_imports', "Content Imports" }) { |c| c.send :named_context_url, c.instance_variable_get("@context"), :context_imports_url }
add_crumb(proc { t 'crumbs.content_imports', "Content Imports" }) { |c| c.send :named_context_url, c.instance_variable_get("@context"), :context_imports_url }
before_filter { |c| c.active_tab = "home" }
prepend_around_filter :load_pseudonym_from_policy, :only => :migrate_content_upload

View File

@ -27,7 +27,7 @@ class ConversationsController < ApplicationController
before_filter :get_conversation, :only => [:show, :update, :destroy, :add_recipients, :remove_messages]
before_filter :load_all_contexts, :only => [:index, :find_recipients, :create, :add_message]
before_filter :normalize_recipients, :only => [:create, :add_recipients]
add_crumb(lambda { I18n.t 'crumbs.messages', "Conversations" }) { |c| c.send :conversations_url }
add_crumb(proc { I18n.t 'crumbs.messages', "Conversations" }) { |c| c.send :conversations_url }
# @API
# Returns the list of conversations for the current user, most recent ones first.

View File

@ -22,7 +22,7 @@
class DiscussionTopicsController < ApplicationController
before_filter :require_context, :except => :public_feed
add_crumb(lambda { t('#crumbs.discussions', "Discussions")}, :except => [:public_feed]) { |c| c.send :named_context_url, c.instance_variable_get("@context"), :context_discussion_topics_url }
add_crumb(proc { t('#crumbs.discussions', "Discussions")}, :except => [:public_feed]) { |c| c.send :named_context_url, c.instance_variable_get("@context"), :context_discussion_topics_url }
before_filter { |c| c.active_tab = "discussions" }
include Api::V1::DiscussionTopics

View File

@ -18,7 +18,7 @@
class GradingStandardsController < ApplicationController
before_filter :require_context
add_crumb(lambda{ t '#crumbs.grading_schemes', "Grading Schemes" }) { |c| c.send :named_context_url, c.instance_variable_get("@context"), :context_grading_standards_url }
add_crumb(proc { t '#crumbs.grading_schemes', "Grading Schemes" }) { |c| c.send :named_context_url, c.instance_variable_get("@context"), :context_grading_standards_url }
before_filter { |c| c.active_tab = "grading_standards" }
def default_data

View File

@ -18,7 +18,7 @@
class OutcomesController < ApplicationController
before_filter :require_user_for_context, :except => [:build_outcomes]
add_crumb(lambda{ t "#crumbs.outcomes", "Outcomes" }, :except => [:destroy, :build_outcomes]) { |c| c.send :named_context_url, c.instance_variable_get("@context"), :context_outcomes_path }
add_crumb(proc { t "#crumbs.outcomes", "Outcomes" }, :except => [:destroy, :build_outcomes]) { |c| c.send :named_context_url, c.instance_variable_get("@context"), :context_outcomes_path }
before_filter { |c| c.active_tab = "outcomes" }
def index

View File

@ -18,7 +18,7 @@
class QuizzesController < ApplicationController
before_filter :require_context
add_crumb(lambda{ t(:top_level_crumb, "Quizzes") }) { |c| c.send :named_context_url, c.instance_variable_get("@context"), :context_quizzes_url }
add_crumb(proc { t(:top_level_crumb, "Quizzes") }) { |c| c.send :named_context_url, c.instance_variable_get("@context"), :context_quizzes_url }
before_filter { |c| c.active_tab = "quizzes" }
before_filter :get_quiz, :only => [:statistics, :edit, :show, :reorder, :history, :update, :destroy, :moderate, :filters, :read_only]

View File

@ -19,7 +19,7 @@
class WikiPageCommentsController < ApplicationController
before_filter :require_context
before_filter :get_wiki_page, :except => :latest_version_number
add_crumb(lambda{ t '#crumbs.wiki_pages', "Pages"}, :except => [:latest_version_number]) { |c| c.send :course_wiki_pages_path, c.instance_variable_get("@context") }
add_crumb(proc { t '#crumbs.wiki_pages', "Pages"}, :except => [:latest_version_number]) { |c| c.send :course_wiki_pages_path, c.instance_variable_get("@context") }
before_filter { |c| c.active_tab = "pages" }
def create

View File

@ -19,7 +19,7 @@
class WikiPageRevisionsController < ApplicationController
before_filter :require_context, :except => :latest_version_number
before_filter :get_wiki_page, :except => :latest_version_number
add_crumb(lambda{ t '#crumbs.wiki_pages', "Pages"}, :except => [:latest_version_number]) { |c| c.send :course_wiki_pages_path, c.instance_variable_get("@context") }
add_crumb(proc { t '#crumbs.wiki_pages', "Pages"}, :except => [:latest_version_number]) { |c| c.send :course_wiki_pages_path, c.instance_variable_get("@context") }
before_filter { |c| c.active_tab = "pages" }
def index

View File

@ -19,7 +19,7 @@
class WikiPagesController < ApplicationController
before_filter :require_context
before_filter :get_wiki_page, :except => [:index]
add_crumb(lambda{ t '#crumbs.wiki_pages', "Pages"}) { |c| c.send :named_context_url, c.instance_variable_get("@context"), :context_wiki_pages_url }
add_crumb(proc { t '#crumbs.wiki_pages', "Pages"}) { |c| c.send :named_context_url, c.instance_variable_get("@context"), :context_wiki_pages_url }
before_filter { |c| c.active_tab = "pages" }
def show