Sha256: e04385129ecdd05d19613cd8163dc3f89315a3cd757c11e59f274828b12114ee

Contents?: true

Size: 391 Bytes

Versions: 52

Compression:

Stored size: 391 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? %><%= ', required: true' if attribute.required? %>
<% end -%>
<% if attributes.any?(&:password_digest?) -%>
  has_secure_password
<% end -%>
end
<% end -%>

Version data entries

52 entries across 51 versions & 8 rubygems

Version Path
activerecord-4.2.11.3 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.2.11.2 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.2.11.1 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.2.11 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.2.10 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.2.10.rc1 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.2.9 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.2.9.rc2 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.2.9.rc1 lib/rails/generators/active_record/model/templates/model.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/activerecord-4.2.8/lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.2.8 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.2.8.rc1 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.2.7.1 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.2.7 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.2.7.rc1 lib/rails/generators/active_record/model/templates/model.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.6/lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.2.6 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.2.6.rc1 lib/rails/generators/active_record/model/templates/model.rb
activerecord-4.2.5.2 lib/rails/generators/active_record/model/templates/model.rb
activejob-lock-0.0.2 rails/activerecord/lib/rails/generators/active_record/model/templates/model.rb