Sha256: 99f28b0fe35634723359ec09334cfdd68b058053f51d2b854c82af799c59cadc

Contents?: true

Size: 450 Bytes

Versions: 3

Compression:

Stored size: 450 Bytes

Contents

class <%= class_name %> < ActiveRecord::Base

  hobo_model

  fields do
<% for attribute in attributes -%>
    <%= attribute.name %> :<%= attribute.type %>
<% end -%>
    timestamps
  end


  # --- Hobo Permissions --- #

  def creatable_by?(user)
    user.administrator?
  end

  def updatable_by?(user, new)
    user.administrator?
  end

  def deletable_by?(user)
    user.administrator?
  end

  def viewable_by?(user, field)
    true
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hobo-0.7.1 hobo_files/plugin/generators/hobo_model/templates/model.rb
hobo-0.7.2 hobo_files/plugin/generators/hobo_model/templates/model.rb
hobo-0.7.3 hobo_files/plugin/generators/hobo_model/templates/model.rb