Created
September 22, 2008 17:03
-
-
Save ratnikov/12049 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# And finally decide EopgStatistics now depends on foo | |
class EpgStatistics < ActiveRecord::Base | |
has_one :foo | |
validates_presence_of :foo | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# After a while you add a new model and migration: | |
class Foo < ActiveRecord::Base | |
end | |
class FooMigration | |
self.up | |
create_table :foos |foo| | |
# ... | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.up | |
stats = EpgStatistics.all | |
change_column :epg_statistics, :lifetime, :float | |
change_column :epg_statistics, :latency, :float | |
stats.each {|s| s.save} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment