Sha256: bfcc4bc07e4463fda94a49b4b49e1eaeef10bdee7d31c51180ebeea29daf1062

Contents?: true

Size: 516 Bytes

Versions: 19

Compression:

Stored size: 516 Bytes

Contents

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

  hobo_model # Don't put anything above this

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


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

end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
hobo-1.0.3 rails_generators/hobo_model/templates/model.rb
hobo-1.0.2 rails_generators/hobo_model/templates/model.rb
hobo-1.0.1 rails_generators/hobo_model/templates/model.rb
hobo-1.0.0 rails_generators/hobo_model/templates/model.rb
hobo-0.9.106 rails_generators/hobo_model/templates/model.rb
hobo-0.9.105 rails_generators/hobo_model/templates/model.rb
hobo-0.9.104 rails_generators/hobo_model/templates/model.rb
hobo-0.9.103 rails_generators/hobo_model/templates/model.rb
hobo-0.9.102 rails_generators/hobo_model/templates/model.rb
hobo-0.9.101 rails_generators/hobo_model/templates/model.rb
hobo-0.9.100 rails_generators/hobo_model/templates/model.rb
hobo-0.9.0 rails_generators/hobo_model/templates/model.rb
hobo-0.8.10 rails_generators/hobo_model/templates/model.rb
hobo-0.8.9 rails_generators/hobo_model/templates/model.rb
hobo-0.8.8 rails_generators/hobo_model/templates/model.rb
hobo-0.8.5 rails_generators/hobo_model/templates/model.rb
hobo-0.8.4 rails_generators/hobo_model/templates/model.rb
hobo-0.8.6 rails_generators/hobo_model/templates/model.rb
hobo-0.8.7 rails_generators/hobo_model/templates/model.rb