Skip to content

Commit

Permalink
Active Admin configuration files now live in app/admin instead of app…
Browse files Browse the repository at this point in the history
…/active_admin. [activeadmin#26 state:resolved]
  • Loading branch information
Greg Bell committed Sep 2, 2010
1 parent 9afcea7 commit 2c8eb80
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.rdoc
Expand Up @@ -35,7 +35,7 @@ Then, run the installer:
rails generate active_admin:install

This will create an initializer which is used for configuring defaults used by Active Admin as well
as a new folder at app/active_admin to put all your admin configurations. Note: All ruby files in
as a new folder at app/admin to put all your admin configurations. Note: All ruby files in
the Active Admin load path get loaded into the rails application.

== Usage
Expand All @@ -46,7 +46,7 @@ Let's build up an example using a Post model and the provided admin generator.

That's all you need to get a full CRUD, beautiful administration interface!

The generator will create a new file app/active_admin/posts.rb that will
The generator will create a new file app/admin/posts.rb that will
look like the following:

ActiveAdmin.register Post
Expand Down
2 changes: 1 addition & 1 deletion lib/active_admin.rb
Expand Up @@ -52,7 +52,7 @@ module ActiveAdmin
# Load paths for admin configurations. Add folders to this load path
# to load up other resources for administration. External gems can
# include thier paths in this load path to provide active_admin UIs
@@load_paths = [File.expand_path('app/active_admin', Rails.root)]
@@load_paths = [File.expand_path('app/admin', Rails.root)]
mattr_accessor :load_paths

# Stores if everything has been loaded or we need to reload
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/active_admin/install/install_generator.rb
Expand Up @@ -12,7 +12,7 @@ def copy_initializer
end

def setup_directory
empty_directory "app/active_admin"
empty_directory "app/admin"
end

def setup_routes
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/active_admin/resource/resource_generator.rb
Expand Up @@ -8,7 +8,7 @@ def self.source_root
end

def generate_config_file
template "admin.rb", "app/active_admin/#{file_path.gsub('/', '_').pluralize}.rb"
template "admin.rb", "app/admin/#{file_path.gsub('/', '_').pluralize}.rb"
end

end
Expand Down
12 changes: 6 additions & 6 deletions spec/active_admin_spec.rb
Expand Up @@ -2,16 +2,16 @@

describe ActiveAdmin do

it "should have a default load path of ['app/active_admin']" do
ActiveAdmin.load_paths.should == [File.expand_path('app/active_admin', Rails.root)]
it "should have a default load path of ['app/admin']" do
ActiveAdmin.load_paths.should == [File.expand_path('app/admin', Rails.root)]
end

it "should remove app/active_admin from the autoload path to remove the possibility of conflicts" do
ActiveSupport::Dependencies.autoload_paths.should_not include(File.join(Rails.root, "app/active_admin"))
it "should remove app/admin from the autoload path to remove the possibility of conflicts" do
ActiveSupport::Dependencies.autoload_paths.should_not include(File.join(Rails.root, "app/admin"))
end

it "should remove app/active_admin from the eager load paths (Active Admin deals with loading)" do
Rails.application.config.eager_load_paths.should_not include(File.join(Rails.root, "app/active_admin"))
it "should remove app/admin from the eager load paths (Active Admin deals with loading)" do
Rails.application.config.eager_load_paths.should_not include(File.join(Rails.root, "app/admin"))
end

# TODO: Find a good way to test loading and unloading constants
Expand Down

0 comments on commit 2c8eb80

Please sign in to comment.