Added Active admin models.

parent 31fe4c5a
...@@ -9,7 +9,7 @@ module AnnotateModels ...@@ -9,7 +9,7 @@ module AnnotateModels
END_MARK = "== Schema Information End" END_MARK = "== Schema Information End"
PATTERN = /^\r?\n?# (?:#{COMPAT_PREFIX}|#{COMPAT_PREFIX_MD}).*?\r?\n(#.*\r?\n)*(\r?\n)*/ PATTERN = /^\r?\n?# (?:#{COMPAT_PREFIX}|#{COMPAT_PREFIX_MD}).*?\r?\n(#.*\r?\n)*(\r?\n)*/
MATCHED_TYPES = %w(test fixture factory serializer scaffold controller helper) MATCHED_TYPES = %w(test fixture factory serializer scaffold controller admin helper)
# File.join for windows reverse bar compat? # File.join for windows reverse bar compat?
# I dont use windows, can`t test # I dont use windows, can`t test
...@@ -49,6 +49,9 @@ module AnnotateModels ...@@ -49,6 +49,9 @@ module AnnotateModels
# Controller files # Controller files
CONTROLLER_DIR = File.join("app", "controllers") CONTROLLER_DIR = File.join("app", "controllers")
# Active admin registry files
ACTIVEADMIN_DIR = File.join("app", "admin")
# Helper files # Helper files
HELPER_DIR = File.join("app", "helpers") HELPER_DIR = File.join("app", "helpers")
...@@ -121,6 +124,10 @@ module AnnotateModels ...@@ -121,6 +124,10 @@ module AnnotateModels
[ [
File.join(root_directory, CONTROLLER_DIR, "%PLURALIZED_MODEL_NAME%_controller.rb") File.join(root_directory, CONTROLLER_DIR, "%PLURALIZED_MODEL_NAME%_controller.rb")
] ]
when 'admin'
[
File.join(root_directory, ACTIVEADMIN_DIR, "%MODEL_NAME%.rb")
]
when 'helper' when 'helper'
[ [
File.join(root_directory, HELPER_DIR, "%PLURALIZED_MODEL_NAME%_helper.rb") File.join(root_directory, HELPER_DIR, "%PLURALIZED_MODEL_NAME%_helper.rb")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment