class Tabulatr::Generators::TableGenerator
Public Instance Methods
create_tabulatr_data_file()
click to toggle source
# File lib/tabulatr/generators/tabulatr/table_generator.rb, line 33 def create_tabulatr_data_file template 'tabulatr_data.rb', File.join('app/tabulatr_data/', class_path, "#{file_name}_tabulatr_data.rb") end
Private Instance Methods
association_names()
click to toggle source
# File lib/tabulatr/generators/tabulatr/table_generator.rb, line 43 def association_names attributes.select { |attr| attr.reference? }.map { |a| a.name.to_sym } end
attributes_names()
click to toggle source
# File lib/tabulatr/generators/tabulatr/table_generator.rb, line 39 def attributes_names [:id] + attributes.select { |attr| !attr.reference? }.map { |a| a.name.to_sym } end