Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 78e7cdb3f6
Fetching contributors…

Cannot retrieve contributors at this time

file 33 lines (26 sloc) 0.582 kb

まめちわ

まめ ちわわ

使い方

class Group < ActiveRecord::Base
  mamechiwa :options, :group_type do
    mame_group "group1" do 
      mattr :group_1_attr

      define_validator do
        validates :group_1_attr, presence: true
      end
    end

    mame_group "group2" do 
      mattr :group_2_attr_1
      mattr :group_2_attr_2

      define_validator do
        validates :group_2_attr_1, presence: true
        validates :group_2_attr_2, presence: true
      end
    end

    mattr :group_1_attr
  end
end

こんな感じ。

英語がつらいよ。

Something went wrong with that request. Please try again.