Sha256: 6e14d9862eb6b285ee9afbd20ef2a8c3deb0cd65820a63915313fd205c4aeea3

Contents?: true

Size: 501 Bytes

Versions: 1

Compression:

Stored size: 501 Bytes

Contents

class Article < ActiveRecord::Base
  scope :scpe, lambda {
    where(:title => "Pedro")
  }
  
  extend_at :extra, :columns => {
    :int1 => {
      :type => :get_int1_type,
      :default => 1,
      :validate => lambda do |value|
        errors.add :extra_int1, "Most by greater than 0" if value <= 0
      end
    },
    :int2 => :get_int2_config
  }

  protected
  def get_int1_type
    :integer
  end

  def get_int2_config
    {
      :type => lambda {
        :integer
      }
    }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
extend_at-0.1.5 spec/app/app/models/article.rb