Skip to content

Commit

Permalink
Merge remote-tracking branch 'tute/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Jun 4, 2012
2 parents 3ee9e58 + 1138488 commit a58db70
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/merit/controller_extensions.rb
Expand Up @@ -12,7 +12,8 @@ def self.included(base)
target_id = params[:id]
# TODO: target_object should be configurable (now it's singularized controller name)
target_object = instance_variable_get(:"@#{controller_name.singularize}")
unless target_id =~ /^[0-9]+$/ # id nil, or string (friendly_id)?
# id nil, or string (friendly_id); target_object found
if target_object.present? && (target_id.nil? || !(target_id =~ /^[0-9]+$/))
target_id = target_object.try(:id)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/merit/rule.rb
Expand Up @@ -57,7 +57,7 @@ def sash_to_badge(action)
begin
action.target_object(model_name).send(to)
rescue NoMethodError
Rails.logger.warn "[merit] #{action.target_model.singularize}.find(#{action.target_id}) not found, no badges giving today"
Rails.logger.warn "[merit] #{action.target_model.singularize.camelize}.find(#{action.target_id}) not found, no badges giving today"
return
end
end
Expand Down
2 changes: 1 addition & 1 deletion merit.gemspec
Expand Up @@ -4,7 +4,7 @@ Gem::Specification.new do |s|
s.description = "Manage badges, points and rankings (reputation) of resources in a Rails application."
s.homepage = "http://github.com/tute/merit"
s.files = `git ls-files`.split("\n").reject{|f| f =~ /^\./ }
s.version = "0.7.0"
s.version = "0.7.1"
s.authors = ["Tute Costa"]
s.email = 'tutecosta@gmail.com'
s.add_dependency 'ambry'
Expand Down

0 comments on commit a58db70

Please sign in to comment.