Sha256: a74f1947e3bb574abf3358a00f9d7113dcc29f1ec80927bf129eb3aa233e34c2

Contents?: true

Size: 468 Bytes

Versions: 2

Compression:

Stored size: 468 Bytes

Contents

# coding: utf-8

module Redditor
  class TextBlock < ActiveRecord::Base
    self.table_name = "redditor_text_blocks"

    attr_accessor :object_id

    belongs_to :page, class_name: "::Redditor::Page", touch: true

    default_scope -> { order(:position) }

    validates :position, :body, presence: true
    
    def to_partial_path
      'redditor/text_block'
    end
    
    def self.model_name
      ActiveModel::Name.new(self, nil, 'TextBlock')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
redditor-0.1.22 app/models/redditor/text_block.rb
redditor-0.1.20 app/models/redditor/text_block.rb