# == Schema Information <br>
# <br>
# Table name: schemas <br>
# <br>
# id :integer not null, primary key <br>
# user_id :integer not null <br>
# name :string(255) not null <br>
# public :boolean not null <br>
# description :string(255) <br>
# schema_file_name :string(255) <br>
# schema_content_type :string(255) <br>
# schema_file_size :integer <br>
# schema_updated_at :datetime <br>
# created_at :datetime <br>
# updated_at :datetime <br>
# <br>
<br>
>> Schema.find(:all, :limit => 3)
=> [#<Schema id: 5, user_id: 14, name: "1", public: true, description: "1", schema_file_name: "1.kml", schema_content_type: "text/xml", schema_file_size: 177411, schema_updated_at: "2009-08-19 23:46:19", created_at: "2009-08-19 23:46:19", updated_at: "2009-08-19 23:46:19">, #<Schema id: 6, user_id: 14, name: "2", public: true, description: "2", schema_file_name: "2.kml", schema_content_type: "text/xml", schema_file_size: 3084, schema_updated_at: "2009-08-19 23:46:56", created_at: "2009-08-19 23:46:56", updated_at: "2009-08-19 23:46:56">, #<Schema id: 8, user_id: 14, name: "", public: true, description: "", schema_file_name: "_.kml", schema_content_type: "text/xml", schema_file_size: 1461, schema_updated_at: "2009-08-19 23:47:53", created_at: "2009-08-19 23:47:53", updated_at: "2009-08-19 23:47:53">]
>> pp Schema.find(:all, :limit => 3)
[#<Schema id: 5, user_id: 14, name: "1", public: true, description: "1", schema_file_name: "1.kml", schema_content_type: "text/xml", schema_file_size: 177411, schema_updated_at: "2009-08-19 23:46:19", created_at: "2009-08-19 23:46:19", updated_at: "2009-08-19 23:46:19">,
#<Schema id: 6, user_id: 14, name: "2", public: true, description: "2", schema_file_name: "2.kml", schema_content_type: "text/xml", schema_file_size: 3084, schema_updated_at: "2009-08-19 23:46:56", created_at: "2009-08-19 23:46:56", updated_at: "2009-08-19 23:46:56">,
#<Schema id: 8, user_id: 14, name: "", public: true, description: "", schema_file_name: "_.kml", schema_content_type: "text/xml", schema_file_size: 1461, schema_updated_at: "2009-08-19 23:47:53", created_at: "2009-08-19 23:47:53", updated_at: "2009-08-19 23:47:53">]
>> puts Schema.find(:all, :limit => 3).to_yaml<br>
--- <br>
- !ruby/object:Schema <br>
attributes: <br>
name: "1"<br>
updated_at: 2009-08-19 23:46:19.606916<br>
public: t<br>
schema_updated_at: 2009-08-19 23:46:19.603984<br>
id: "5"<br>
description: "1"<br>
schema_content_type: text/xml<br>
user_id: "14"<br>
schema_file_name: 1.kml<br>
created_at: 2009-08-19 23:46:19.606916<br>
schema_file_size: "177411"<br>
attributes_cache: {}<br>
.....
sudo gem install hirb
$ ./script/console
Loading development environment (Rails 2.3.5)
irb>> require 'hirb'
=> true
irb>> Hirb.enable
=> nil
if ENV[' RAILS_ENV ']<br>
require ' rubygems '<br>
begin<br>
require ' hirb '<br>
Hirb .enable<br>
rescue LoadError <br>
puts " Error loading Hirb. Run 'sudo gem install hirb' "<br>
end<br>
end <br>
>> Hirb.disable
Source: https://habr.com/ru/post/78732/
All Articles