Sha256: 0e9f6c77d7173cdd5abfae40ec6f1574bce7ee01653e1d6227049398fd48119a

Contents?: true

Size: 532 Bytes

Versions: 4

Compression:

Stored size: 532 Bytes

Contents

class <%= model_name %>
  include Mongoid::Document
  include Mongoid::Timestamps

  <%- model_attributes.map do |a| -%>
  <%= "field :#{a.name}" %>
  <%- end -%>
  
  attr_accessible <%= model_attributes.map { |a| ":#{a.name}" }.join(", ") %>
  <%- if has_type? :image -%>
  mount_uploader <%= special_select(:image).map { |name| ":#{name}" }.join(", ") %>, ImageUploader
  <%- end -%>	
  <%- if has_type? :file -%>
  mount_uploader <%= special_select(:file).map { |name| ":#{name}" }.join(", ") %>, FileUploader
  <%- end -%>
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fetty-generators-2.0.4 lib/generators/fetty/scaffold/templates/models/mongoid/model.rb
fetty-generators-2.0.3 lib/generators/fetty/scaffold/templates/models/mongoid/model.rb
fetty-generators-2.0.1 lib/generators/fetty/scaffold/templates/models/mongoid/model.rb
fetty-generators-2.0.0 lib/generators/fetty/scaffold/templates/models/mongoid/model.rb