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.16 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.16.rc1 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.15 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.15.rc1 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.14.2 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.14.1 lib/rails/generators/active_record/model/templates/model.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/activerecord-4.1.13/lib/rails/generators/active_record/model/templates/model.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/activerecord-4.1.13/lib/rails/generators/active_record/model/templates/model.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/activerecord-4.1.13/lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.14 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.14.rc2 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.14.rc1 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.13 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.13.rc1 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.12 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.12.rc1 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.11 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.10 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.10.rc4 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.1.10.rc3 lib/rails/generators/active_record/model/templates/model.rb