Module: ActiveRecord::PropertybaseId::Patches::Migrations
- Defined in:
- lib/activerecord/propertybase_id/patches.rb
Instance Method Summary collapse
Instance Method Details
#propertybase_id(*column_names) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/activerecord/propertybase_id/patches.rb', line 5 def propertybase_id(*column_names) = column_names. column_names.each do |name| type = "char(#{::PropertybaseId.max_length})" primary_key = .delete(:primary_key) || name.to_s == "id" column(name, "#{type}#{' PRIMARY KEY' if primary_key}", ) end end |