Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- root@infor01p1.infra.smf1.mobitv: ~# foreman-rake console
- Loading production environment (Rails 5.2.1)
- Failed to load console gems, starting anyway
- irb(main):001:0> User.current = User.where(:admin => true).first
- => #<User id: 3, login: "admin", firstname: "Admin", lastname: "User", mail: "root@infra.smf1.mobitv", admin: true, last_login_on: "2019-02-11 12:39:24", auth_source_id: 1, created_at: "2016-05-06 21:23:59", updated_at: "2016-12-09 19:51:56", password_hash: "1fd1230d7205a56b9b07426d07e447135b155946", password_salt: "79901d1e0fb1771247aae6d650eceb6752759fc3", locale: nil, avatar_hash: nil, default_organization_id: nil, default_location_id: nil, lower_login: "admin", mail_enabled: true, timezone: nil, description: nil, password: nil>
- irb(main):002:0> c = Foreman::Model::Vmware.where(:name => 'PAYTV-DEV')
- => #<ActiveRecord::Relation [#<Foreman::Model::Vmware id: 22, name: "PAYTV-DEV", description: "", url: "invct01p1.infra.smf1.mobitv", user: "infra.smf1.mobitv\\it", password: "encrypted-cWFrSDR5L2lEY1BvZFJSV2FaRVVsT0ZUcm05QW0v...", uuid: "PAYTV-DEV", type: "Foreman::Model::Vmware", created_at: "2019-01-21 13:05:01", updated_at: "2019-01-21 13:05:01", attrs: {:setpw=>1, :pubkey_hash=>"64aa51dac42cfb7f477dcb19d858cab810af29bbf685d68c00bd542c1f472d7c"}, email: nil, caching_enabled: true, domain: nil, http_proxy_id: nil>]>
- NameError (undefined local variable or method `networks' for main:Object)
- irb(main):004:0> c.networks
- Traceback (most recent call last):
- 2: from lib/tasks/console.rake:5:in `block in <top (required)>'
- 1: from (irb):4
- NoMethodError (undefined method `networks' for #<Foreman::Model::Vmware::ActiveRecord_Relation:0x0000000009c8aa10>)
- irb(main):005:0> c.available_networks
- Traceback (most recent call last):
- 2: from lib/tasks/console.rake:5:in `block in <top (required)>'
- 1: from (irb):5
- NoMethodError (undefined method `available_networks' for #<Foreman::Model::Vmware::ActiveRecord_Relation:0x0000000009c8aa10>)
- irb(main):006:0>
Add Comment
Please, Sign In to add comment