Sha256: 038f90891c7e847b33bd056628ece96d3585f5fd95c950ac5ec15c2faf6240e1

Contents?: true

Size: 506 Bytes

Versions: 5

Compression:

Stored size: 506 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|
        self.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

5 entries across 5 versions & 1 rubygems

Version Path
extend_at-0.2.4 spec/app/app/models/article.rb
extend_at-0.2.3 spec/app/app/models/article.rb
extend_at-0.2.2 spec/app/app/models/article.rb
extend_at-0.2.1 spec/app/app/models/article.rb
extend_at-0.2.0 spec/app/app/models/article.rb