Class: Handlebars::Helpers::CodeRuby::ForeignKey
- Inherits:
-
BaseHelper
- Object
- BaseHelper
- Handlebars::Helpers::CodeRuby::ForeignKey
- Defined in:
- lib/handlebars/helpers/code_ruby/foreign_key.rb
Overview
Foreign Key: Creates a foreign key name from a class name separate_class_name_and_id_with_underscore sets whether the method should put ‘_’ between the name and ‘id’.
Instance Method Summary collapse
- #handlebars_helper ⇒ Object
-
#parse(class_name, class_id_underscored: true) ⇒ String
Parse will Creates a foreign key name from a class name.
Methods inherited from BaseHelper
#parse_json, #struct_to_hash, #tokenizer, #wrapper
Instance Method Details
#handlebars_helper ⇒ Object
43 44 45 |
# File 'lib/handlebars/helpers/code_ruby/foreign_key.rb', line 43 def proc { |_context, class_name, class_id_underscored| wrapper(parse(class_name, class_id_underscored: class_id_underscored)) } end |
#parse(class_name, class_id_underscored: true) ⇒ String
Parse will Creates a foreign key name from a class name
39 40 41 |
# File 'lib/handlebars/helpers/code_ruby/foreign_key.rb', line 39 def parse(class_name, class_id_underscored: true) class_name.foreign_key(class_id_underscored) end |