Sha256: d937d04b2abfcc8eaad46bb866ffef7f2c83329479d1f924e22e61524fb1d8de

Contents?: true

Size: 158 Bytes

Versions: 28

Compression:

Stored size: 158 Bytes

Contents

class Post < ApplicationRecord
  after_initialize :set_views, if: :new_record?

  belongs_to :user

  private

  def set_views
    self.views ||= 0
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
rails_app_generator-0.3.6 after_templates/addons/devise/app/models/post.rb
rails_app_generator-0.3.5 after_templates/addons/devise/app/models/post.rb
rails_app_generator-0.3.4 after_templates/addons/devise/app/models/post.rb
rails_app_generator-0.3.3 after_templates/addons/devise/app/models/post.rb
rails_app_generator-0.3.2 after_templates/addons/devise/app/models/post.rb
rails_app_generator-0.3.1 after_templates/addons/devise/app/models/post.rb
rails_app_generator-0.3.0 after_templates/addons/devise/app/models/post.rb
rails_app_generator-0.2.43 after_templates/addons/devise/app/models/post.rb
rails_app_generator-0.2.42 after_templates/addons/devise/app/models/post.rb
rails_app_generator-0.2.41 after_templates/addons/devise/app/models/post.rb
rails_app_generator-0.2.40 after_templates/addons/devise/app/models/post.rb
rails_app_generator-0.2.39 after_templates/addons/devise/app/models/post.rb
rails_app_generator-0.2.38 after_templates/addons/devise/app/models/post.rb
rails_app_generator-0.2.37 after_templates/addons/devise/app/models/post.rb
rails_app_generator-0.2.36 after_templates/addons/devise/app/models/post.rb
rails_app_generator-0.2.35 after_templates/addons/devise/app/models/post.rb
rails_app_generator-0.2.34 after_templates/addons/devise/app/models/post.rb
rails_app_generator-0.2.33 after_templates/addons/devise/app/models/post.rb
rails_app_generator-0.2.32 after_templates/addons/devise/app/models/post.rb
rails_app_generator-0.2.31 after_templates/addons/devise/app/models/post.rb