Sha256: 09c32c6fc8fb7a0cfdcb38ae911d925402081869db8a5cfb994855fa88c64fc2

Contents?: true

Size: 668 Bytes

Versions: 43

Compression:

Stored size: 668 Bytes

Contents

  hobo_model # Don't put anything above this

  fields do
<% for attribute in field_attributes -%>
    <%= "%-#{max_attribute_length}s" % attribute.name %> :<%= attribute.type %>
<% end -%>
    timestamps
  end

<% for bt in bts -%>
  belongs_to :<%= bt %>
<% end -%>
<%= "\n" unless bts.empty? -%>
<% for hm in hms -%>
  has_many :<%= hm %>, :dependent => :destroy
<% end -%>
<%= "\n" unless hms.empty? -%>
  # --- Permissions --- #

  def create_permitted?
    acting_user.administrator?
  end

  def update_permitted?
    acting_user.administrator?
  end

  def destroy_permitted?
    acting_user.administrator?
  end

  def view_permitted?(field)
    true
  end

Version data entries

43 entries across 36 versions & 1 rubygems

Version Path
hobo-1.3.0.pre26 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-1.3.0.pre25 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-1.3.0.pre24 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-1.3.0.pre23 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-1.3.0.pre22 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-1.3.0.pre21 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-1.3.0.pre20 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-1.3.0.pre19 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-1.3.0.pre18 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-1.3.0.pre16 lib/generators/hobo/hints/templates/model_injection.rb.erb
hobo-1.3.0.pre16 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-1.3.0.pre15 lib/generators/hobo/hints/templates/model_injection.rb.erb
hobo-1.3.0.pre15 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-1.3.0.pre14 lib/generators/hobo/hints/templates/model_injection.rb.erb
hobo-1.3.0.pre14 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-1.3.0.pre13 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-1.3.0.pre13 lib/generators/hobo/hints/templates/model_injection.rb.erb
hobo-1.3.0.pre12 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-1.3.0.pre12 lib/generators/hobo/hints/templates/model_injection.rb.erb
hobo-1.3.0.pre11 lib/generators/hobo/model/templates/model_injection.rb.erb