Sha256: e388e2248c39c9a846e203f64b51229386356208558525203358eced09e20164

Contents?: true

Size: 547 Bytes

Versions: 10

Compression:

Stored size: 547 Bytes

Contents

<% module_namespacing do %>
class <%= class_name %>TabulatrData < Tabulatr::Data
  <% attributes = attributes_names %>
  <% if class_name.constantize.table_exists? %>
    <% attributes << class_name.constantize.column_names.map(&:to_sym) %>
  <% end %>
  <% attributes = attributes.flatten.uniq %>
  <% if attributes.any? %>
    search :<%= attributes.last %>
  <% end %>
  <% attributes.each do |a| %>
    column :<%= a %>
  <% end %>
  <% association_names.each do |attribute| %>
    association :<%= attribute %>, :id
  <% end %>
end
<% end %>

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
tabulatr2-0.8.9 lib/tabulatr/generators/tabulatr/templates/tabulatr_data.rb
tabulatr2-0.8.8 lib/tabulatr/generators/tabulatr/templates/tabulatr_data.rb
tabulatr2-0.8.7 lib/tabulatr/generators/tabulatr/templates/tabulatr_data.rb
tabulatr2-0.8.6 lib/tabulatr/generators/tabulatr/templates/tabulatr_data.rb
tabulatr2-0.8.5 lib/tabulatr/generators/tabulatr/templates/tabulatr_data.rb
tabulatr2-0.8.4 lib/tabulatr/generators/tabulatr/templates/tabulatr_data.rb
tabulatr2-0.8.3 lib/tabulatr/generators/tabulatr/templates/tabulatr_data.rb
tabulatr2-0.8.2 lib/tabulatr/generators/tabulatr/templates/tabulatr_data.rb
tabulatr2-0.8.1 lib/tabulatr/generators/tabulatr/templates/tabulatr_data.rb
tabulatr2-0.8.0 lib/tabulatr/generators/tabulatr/templates/tabulatr_data.rb