Is there good way to retrieve migration version number?
I need to implement a method in a model which behave differently on and beyond a specific migration version.
If you don't want to do this without loading your app you can create a script like this:
#!/usr/bin/env ruby
root = File.expand_path("../..", __FILE__)
lines = `ls #{root}/db/migrate`
puts lines.split("\n").last.split(" ").last.split("_").first
Note the root
line is because my script is in a bin
dir