fixes for rm2.x
This commit is contained in:
1 parent
193a41aa46
commit
dd7c6892f3
2 files changed
+7
-7
No files matched your search
@@ -52,8 +52,8 @@ module RateHelper
|
|||||||
url_options[:user_id] ||= options[:user_id]
|
url_options[:user_id] ||= options[:user_id]
|
||||||
#####
|
#####
|
||||||
|
|
||||||
link_to_remote(caption,
|
link_to(caption,
|
||||||
{:update => options[:update] || "content", :url => url_options, :method => options[:method] || :post},
|
{:remote => true, :update => options[:update] || "content", :url => url_options, :method => options[:method] || :post},
|
||||||
{:href => url_for(url_options),
|
{:href => url_for(url_options),
|
||||||
:class => css})
|
:class => css})
|
||||||
# link_to caption, :remote => true
|
# link_to caption, :remote => true
|
||||||
@@ -88,7 +88,7 @@ module RateHelper
|
|||||||
#####
|
#####
|
||||||
|
|
||||||
link_to_remote(caption,
|
link_to_remote(caption,
|
||||||
{:update => options[:update] || "content", :url => url_options, :method => options[:method] || :post},
|
{:remote => true, :update => options[:update] || "content", :url => url_options, :method => options[:method] || :post},
|
||||||
{:href => url_for(url_options)}) +
|
{:href => url_for(url_options)}) +
|
||||||
(icon ? nbsp(2) + image_tag(icon) : '')
|
(icon ? nbsp(2) + image_tag(icon) : '')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -18,11 +18,11 @@ module RateTimeEntryPatch
|
|||||||
module ClassMethods
|
module ClassMethods
|
||||||
# Updated the cached cost of all TimeEntries for user and project
|
# Updated the cached cost of all TimeEntries for user and project
|
||||||
def update_cost_cache(user, project=nil)
|
def update_cost_cache(user, project=nil)
|
||||||
c = ARCondition.new
|
#c = ARCondition.new
|
||||||
c << ["#{TimeEntry.table_name}.user_id = ?", user]
|
c = "#{TimeEntry.table_name}.user_id = %d" % [user.id]
|
||||||
c << ["#{TimeEntry.table_name}.project_id = ?", project] if project
|
c << " AND #{TimeEntry.table_name}.project_id = %d" % [project.id] if project
|
||||||
|
|
||||||
TimeEntry.all(:conditions => c.conditions).each do |time_entry|
|
TimeEntry.all(:conditions => c ).each do |time_entry|
|
||||||
time_entry.save_cached_cost
|
time_entry.save_cached_cost
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in new issue
Block a user