Skip to content

Commit

Permalink
chore(jack-core): parse schemas generated with rails 5 (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnjelinek authored Oct 11, 2024
1 parent a0c49c6 commit 2b59ac2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions jack-core/src/rb/schema_rb_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ class Index

class Table
include FromHash
attr_accessor :name, :force, :id, :schema
attr_accessor :name, :force, :id, :limit, :options, :schema
fattr(:columns) { [] }

def __column(type, name, ops = {})
self.columns << Column.new(ops.merge(type: type, name: name)) unless FORBIDDEN_FIELD_NAMES.include?(name)
self.columns << Column.new(ops.merge(type: type, name: name)) unless FORBIDDEN_FIELD_NAMES.include?(name) || type == 'index'
end

%w(integer text datetime boolean string float binary date decimal varbinary).each do |f|
%w(bigint integer index text datetime boolean string float binary date decimal varbinary).each do |f|
define_method(f) do |*args|
self.__column(f, *args)
end
Expand All @@ -88,7 +88,7 @@ def to_model_defn

class Column
include FromHash
attr_accessor :type, :name, :limit, :null, :default, :precision, :scale
attr_accessor :type, :name, :length, :limit, :null, :default, :precision, :scale, :unique

def to_model_defn(col_index)
f = to_h
Expand Down

0 comments on commit 2b59ac2

Please sign in to comment.