Methods
- A
- C
- E
- F
- H
- I
- J
- M
- N
- P
- R
- S
- T
- U
- W
Attributes
[R] | file_name | TODO Change this to private once we've dropped Ruby 2.2 support. Workaround for Ruby 2.2 “private attribute?” warning. |
Class Private 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 228 def self.check_class_collision(options = {}) # :doc: define_method :check_class_collision do name = if 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
js_template(source, destination)
Link
template(source, *args, &block)
Link
Instance Private methods
application_name()
Link
Tries to retrieve the application name or simply return application.
attributes_names()
Link
# File railties/lib/rails/generators/named_base.rb, line 202 def attributes_names # :doc: @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
edit_helper()
Link
file_path()
Link
fixture_file_name()
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
mountable_engine?()
Link
namespace()
Link
namespaced?()
Link
namespaced_class_path()
Link
namespaced_path()
Link
new_helper()
Link
plural_file_name()
Link
plural_name()
Link
plural_table_name()
Link
pluralize_table_names?()
Link
regular_class_path()
Link
route_url()
Link
show_helper()
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
url_helper_prefix()
Link