lib/schematic/generator/column.rb in schematic-0.5.4 vs lib/schematic/generator/column.rb in schematic-0.5.5
- old
+ new
@@ -6,11 +6,11 @@
def restriction_classes
@restriction_classes ||= [Restrictions::Length, Restrictions::Enumeration, Restrictions::Numericality, Restrictions::Pattern, Restrictions::Custom]
end
end
- def initialize(klass, column, additional_methods = {}, ignored_methods = [], required_methods = [])
+ def initialize(klass, column, additional_methods = {}, ignored_methods = {}, required_methods = [])
@klass = klass
@column = column
@additional_methods = additional_methods
@ignored_methods = ignored_methods
@required_methods = required_methods
@@ -53,11 +53,10 @@
def map_type(column)
Types::COMPLEX[column.type][:complex_type]
end
def skip_generation?
- @additional_methods.keys.map(&:to_s).include?(@column.name) ||
- @ignored_methods.map(&:to_s).include?(@column.name)
+ (@additional_methods.keys + @ignored_methods.keys).map(&:to_s).include?(@column.name)
end
end
end
end