Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with methods_in_migrations #7

Open
tycooon opened this issue May 28, 2019 · 1 comment
Open

Problem with methods_in_migrations #7

tycooon opened this issue May 28, 2019 · 1 comment
Assignees

Comments

@tycooon
Copy link
Member

tycooon commented May 28, 2019

  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
Copy link
Member

0exp commented Nov 19, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants