Last active
August 29, 2015 14:02
Revisions
-
between40and2 renamed this gist
Jun 16, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
between40and2 revised this gist
Jun 16, 2014 . 1 changed file with 6 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ # `rails console` ## Model @@ -16,11 +17,14 @@ This actually uses method [ActiveRecord::ConnectionHandling.connection](http://a > ActiveRecord::Migration.add_column You need to konw the Model name, and access (both read and write) here. > JxRailsMd::Aa::Account.all ##Refs [see-all-tables-all-records-from-console](http://stackoverflow.com/questions/4572249/see-all-tables-all-records-from-console) -
between40and2 created this gist
Jun 16, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ ## Model > ActiveRecord::Base.connection.tables.map { |t| "#{t} => " + ActiveRecord::Base.connection.execute("select count(*) from #{t}").fetch_row.first} This actually uses method [ActiveRecord::ConnectionHandling.connection](http://api.rubyonrails.org/classes/ActiveRecord/ConnectionHandling.html#method-i-connection) > ActiveRecord::Migration.add_column > JxRailsMd::Aa::Account.all Refs see-all-tables-all-records-from-console