Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

#664 - Preserve case of Scope title when provided a string

  • Loading branch information...
commit 72e2e64f09a588b2e11d4499f5ebb418eae0509d 1 parent e81cbff
Matthew Brewer authored
Showing with 5 additions and 5 deletions.
  1. +1 −1  lib/active_admin/scope.rb
  2. +4 −4 spec/unit/scope_spec.rb
View
2  lib/active_admin/scope.rb
@@ -20,7 +20,7 @@ class Scope
# # => Scope with name 'Published' using a block to scope
#
def initialize(name, method = nil, options = {}, &block)
- @name = name.to_s.titleize
+ @name = name.is_a?( String ) ? name : name.to_s.titleize
@scope_method = method
# Scope ':all' means no scoping
@scope_method ||= name.to_sym unless name.to_sym == :all
View
8 spec/unit/scope_spec.rb
@@ -23,10 +23,10 @@
end
context "when a name and scope method" do
- let(:scope) { ActiveAdmin::Scope.new "My Scope", :scope_method }
- its(:name) { should == "My Scope"}
- its(:id) { should == "my_scope"}
- its(:scope_method) { should == :scope_method }
+ let(:scope) { ActiveAdmin::Scope.new "With API Access", :with_api_access }
+ its(:name) { should == "With API Access"}
+ its(:id) { should == "with_api_access"}
+ its(:scope_method) { should == :with_api_access }
end
context "when a name and scope block" do
Please sign in to comment.
Something went wrong with that request. Please try again.