Sha256: d5b37edaa2afdf0ddfcdcd7d6038f11fc5cb738d23d7dd67d77efb9bd6012d45

Contents?: true

Size: 343 Bytes

Versions: 72

Compression:

Stored size: 343 Bytes

Contents

<% module_namespacing do -%>
class <%= class_name %> < <%= parent_class_name.classify %>
<% attributes.select(&:reference?).each do |attribute| -%>
  belongs_to :<%= attribute.name %><%= ', polymorphic: true' if attribute.polymorphic? %>
<% end -%>
<% if attributes.any?(&:password_digest?) -%>
  has_secure_password
<% end -%>
end
<% end -%>

Version data entries

72 entries across 72 versions & 3 rubygems

Version Path
activerecord-4.1.10.rc2 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.10.rc1 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.0.13 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.9 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.9.rc1 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.0.13.rc1 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.7.1 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.0.11.1 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.8 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.0.12 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.7 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.0.11 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.0.10 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.6 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.6.rc2 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.0.10.rc2 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.6.rc1 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.0.10.rc1 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.0.9 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.5 lib/rails/generators/active_record/model/templates/model.rb