Sha256: 9dcc446418cd3f12a9ecd28f73910ab81d014a662def8f00ebf1fd464702aa86

Contents?: true

Size: 1019 Bytes

Versions: 19

Compression:

Stored size: 1019 Bytes

Contents

class LoneMaster < ActiveRecord::Base
  abstract_class = true
  has_history :generate_model => true
  has_one :other_model, :class_name => 'ModelStub'
  has_many :other_models, :class_name => 'ModelStub'
  attr_accessor :a, :b, :c, :d

  def other_model=(val)
    @other_model = val
  end
  def other_model
    @other_model || nil
  end

  def other_models=(val)
    @other_models = val
  end
  def other_models
    @other_models || []
  end

  def self.columns
    @columns ||= [
      ActiveRecord::ConnectionAdapters::Column.new(:a, ''),
      ActiveRecord::ConnectionAdapters::Column.new(:b, ''),
      ActiveRecord::ConnectionAdapters::Column.new(:c, ''),
      ActiveRecord::ConnectionAdapters::Column.new(:d, '')
    ]
  end

  def self.columns_hash
    @columns_hash ||= columns.inject({}) { |hash, column| hash[column.name.to_s] = column; hash }
  end

  # column-level security methods, used for testing
  def self.a_authorized_for_bar?(user)
    true
  end
  def self.b_authorized?(user)
    false
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
backlog-0.37.2 vendor/plugins/has_history/test/lone_master.rb
backlog-0.37.1 vendor/plugins/has_history/test/lone_master.rb
backlog-0.36.2 vendor/plugins/has_history/test/lone_master.rb
backlog-0.29.0 vendor/plugins/has_history/test/lone_master.rb
backlog-0.31.0 vendor/plugins/has_history/test/lone_master.rb
backlog-0.30.0 vendor/plugins/has_history/test/lone_master.rb
backlog-0.32.0 vendor/plugins/has_history/test/lone_master.rb
backlog-0.31.1 vendor/plugins/has_history/test/lone_master.rb
backlog-0.33.0 vendor/plugins/has_history/test/lone_master.rb
backlog-0.34.1 vendor/plugins/has_history/test/lone_master.rb
backlog-0.33.1 vendor/plugins/has_history/test/lone_master.rb
backlog-0.34.2 vendor/plugins/has_history/test/lone_master.rb
backlog-0.34 vendor/plugins/has_history/test/lone_master.rb
backlog-0.35.0 vendor/plugins/has_history/test/lone_master.rb
backlog-0.35.2 vendor/plugins/has_history/test/lone_master.rb
backlog-0.35.1 vendor/plugins/has_history/test/lone_master.rb
backlog-0.35.3 vendor/plugins/has_history/test/lone_master.rb
backlog-0.35.4 vendor/plugins/has_history/test/lone_master.rb
backlog-0.35.5 vendor/plugins/has_history/test/lone_master.rb