Skip to content

Commit

Permalink
fix a bug in AA::Inputs::FilterSelectInput#method
Browse files Browse the repository at this point in the history
This method takes something like "author_id" and returns "author". It
was failing for the edge case "external_identity_id" because of the
extra "_id" in the middle of the string - i.e. it was returning
"externalentity".

Change the way the substitution is done so that it only matches at the
end of the string.
  • Loading branch information
scrooloose committed Feb 21, 2012
1 parent 7a8c665 commit f7ecea2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/active_admin/inputs/filter_select_input.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def input_options
end

def method
super.to_s.gsub('_id','').to_sym
super.to_s.sub(/_id$/,'').to_sym
end

def extra_input_html_options
Expand Down

0 comments on commit f7ecea2

Please sign in to comment.