Migration not detected -> User model in sidebar not updated

Hi,

is it possible that this kind of migration is not detected?

transaction do
rename_column :users, :name, :lastname
add_column :users, :firstname, :string
User.update_all()
change_table :users do |t|
t.date :birthdate
t.text :text
t.belongs_to :gender_type
t.belongs_to :picture
end
end

I do not see the new columns in the User model tree in the navigation sidebar.
The migration has been executed, though, and the columns are definitely there.

Thank you,

Jens

0
4 comments

Hi Jens,

Our migrations parser in RubyMine doesn't understand transactions thus
we understand

and doesn't understand


I've created issue for this - http://www.jetbrains.net/jira/browse/RUBY-2346

0

Thank you!

I realize this is difficult because I keep seeing migrations like

change_table :users do |u|
\[:foo, :bar, :baz, ...\].each do |t| u.string t; end
end

because Ruby developers are lazy by default, and other complicated ways of describing the same thing. Maybe the parser should mark parts in migrations that it cannot assign to a specific database change, so that the user knows the sidebar tree view might be out of date.
Or RubyMine could parse the database schema directly using the config/database.yml login information.
Or (easier) it could parse db/schema.rb.

On another note, Rails is supposed to get transactionalized migrations in 2.2 (I think) so my "transaction do ... end" would not be necessary then any more.

Thank you,

Jens

PS: but please, pretty please, before you implement more features, improve the UI reaction and scrolling performance. My Core2Duo has 80% CPU load while I scroll through a ruby file on OS X and it scrolls with about 1-2 frames per second, most of the time too far because key releases are detected too late. I don't know if this is OS X specific, but I'd be happy to test new builds or settings if you like.

Edited by: Jens on Nov 19, 2008 7:57 AM

Edited by: Jens on Nov 19, 2008 7:57 AM

0

Jens,

because Ruby developers are lazy by default, and other complicated ways of describing the same thing.

Yes it's hard to understand/parse ruby dynamic from IDE point of view. But in some cases developers may help IDE and don't use too complex constructions ;)

80% CPU load while I scroll through a ruby file on OS X and it scrolls with about 1-2 frames per second
most of the time too far because key releases are detected too late


If something works slow in RubyMine please take a CPU snapshot (as we asked you in thread "Re: Build 472 very slow on Ubuntu8.10"). Because only snapshot can show us the real problem.. By the way are your ruby files large? Does scrolling works slowly only on large files or quantity of lines doesn't depend from scrolling speed?

0

Roman.Chernyatchik wrote:

>> because Ruby developers are lazy by default, and other complicated ways of describing the same thing.

Yes it's hard to understand/parse ruby dynamic from IDE point of view. But in some cases developers may help IDE and don't use too complex constructions ;)


<tongue-in-cheek>
I thought the IDE was supposed to help us, not the other way around.
</tongue in cheek>

Seriously, this isn't right. I know Ruby isn't exactly an easy to parse
language, but the IDE shouldn't impose restrictions on the programmer.

Maybe you're approaching the problem from the wrong side. Instead of
parsing Ruby source you should somehow create a mock environment and
actually run the Ruby code. Just a crazy idea that popped into my mind,
not a serious suggestion.

-- Marcus

0

Please sign in to leave a comment.