##// END OF EJS Templates
Rails3: model: user: use ::Query instead of Query...
Rails3: model: user: use ::Query instead of Query Test fails on Rails 3.0. <pre> Error: test_destroy_should_update_wiki_contents(UserTest): NoMethodError: undefined method `delete_all' for ActiveRecord::AttributeMethods::Query:Module app/models/user.rb:602:in `remove_references_before_destroy' test/unit/user_test.rb:298:in `test_destroy_should_update_wiki_contents' </pre> git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8140 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r6731:d194b7dfbef8
r8020:312ffe43c7ef
Show More
calendars_helper.rb
39 lines | 1.3 KiB | text/x-ruby | RubyLexer
module CalendarsHelper
def link_to_previous_month(year, month, options={})
target_year, target_month = if month == 1
[year - 1, 12]
else
[year, month - 1]
end
name = if target_month == 12
"#{month_name(target_month)} #{target_year}"
else
"#{month_name(target_month)}"
end
# \xc2\xab(utf-8) = &#171;
link_to_month(("\xc2\xab " + name), target_year, target_month, options)
end
def link_to_next_month(year, month, options={})
target_year, target_month = if month == 12
[year + 1, 1]
else
[year, month + 1]
end
name = if target_month == 1
"#{month_name(target_month)} #{target_year}"
else
"#{month_name(target_month)}"
end
# \xc2\xbb(utf-8) = &#187;
link_to_month((name + " \xc2\xbb"), target_year, target_month, options)
end
def link_to_month(link_name, year, month, options={})
link_to_content_update(h(link_name), params.merge(:year => year, :month => month))
end
end