Sha256: 5ddbe05149edb07b7de300e1e4f8153fbbfbdc7a58709ea2d2972945550b8e77

Contents?: true

Size: 743 Bytes

Versions: 19

Compression:

Stored size: 743 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
  attr_accessible <%= accessible_attributes.map {|a| ":#{a}"}.join ", " %>

<% 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

19 entries across 19 versions & 1 rubygems

Version Path
hobo-2.2.6 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-2.2.5 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-2.2.4 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-2.2.3 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-2.2.2 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-2.2.1 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-2.2.0 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-2.1.2 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-2.1.1 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-2.1.0 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-2.1.0.pre4 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-2.1.0.pre3 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-2.1.0.pre2 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-2.1.0.pre1 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-2.0.1 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-2.0.0 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-2.0.0.pre10 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-2.0.0.pre9 lib/generators/hobo/model/templates/model_injection.rb.erb
hobo-2.0.0.pre8 lib/generators/hobo/model/templates/model_injection.rb.erb