Methods
- A
- C
- F
- H
- I
- M
- N
- P
- R
- S
- T
- U
- W
Attributes
[R] | file_name |
Class Protected methods
check_class_collision(options={})
Link
Add a class collisions name to be checked on class initialization. You can supply a hash with a :prefix or :suffix to be tested.
Examples
check_class_collision suffix: "Decorator"
If the generator is invoked with class name Admin, it will check for the presence of “AdminDecorator”.
# File railties/lib/rails/generators/named_base.rb, line 192 def self.check_class_collision(options={}) define_method :check_class_collision do name = if self.respond_to?(:controller_class_name) # for ScaffoldBase controller_class_name else class_name end class_collisions "#{options[:prefix]}#{name}#{options[:suffix]}" end end
Instance Public methods
template(source, *args, &block)
Link
Instance Protected methods
application_name()
Link
Tries to retrieve the application name or simple return application.
attributes_names()
Link
# File railties/lib/rails/generators/named_base.rb, line 170 def attributes_names @attributes_names ||= attributes.each_with_object([]) do |a, names| names << a.column_name names << 'password_confirmation' if a.password_digest? names << "#{a.name}_type" if a.polymorphic? end end
class_name()
Link
class_path()
Link
file_path()
Link
human_name()
Link
i18n_scope()
Link
indent(content, multiplier = 2)
Link
index_helper()
Link
inside_template()
Link
inside_template?()
Link
module_namespacing(&block)
Link
Wrap block with namespace of current application if namespace exists and is not skipped
namespace()
Link
namespaced?()
Link
namespaced_class_path()
Link
namespaced_file_path()
Link
namespaced_path()
Link
plural_file_name()
Link
plural_name()
Link
plural_table_name()
Link
pluralize_table_names?()
Link
regular_class_path()
Link
route_url()
Link
singular_name()
Link
FIXME: We are avoiding to use alias because a bug on thor that make this method public and add it to the task list.
singular_table_name()
Link
table_name()
Link
uncountable?()
Link