umbrellio/umbrellio-sequel-plugins

Problem with methods_in_migrations

tycooon opened this issue · 1 comments

  1. Custom methods are not available in blocks like alter_table
  2. Kernel methods (like require) are not available in custom methods.
Sequel.migration do
  def test_method
    puts "hello"
  end

  up do
    alter_table :users do
      test_method # This causes NameError: undefined local variable or method `test_method' for #<Sequel::Postgres::AlterTableGenerator:0x00007ff229033680>
    end

    test_method # And this causes NoMethodError: undefined method `puts' for #<Sequel::MigrationDSL:0x00007f8af6874118>
  end
end
0exp commented

🤔 need to extend all invocation contexts with Symbiont::Trigger 🤔