You can see below that when i load the console, it is not loading my
model
Comparetick.
however after i perform a manual require, it is loading it correctly. i
am
not sure where to look for the issue.
E:\TradingTools\Development>ruby script\console
./script/…/config/boot.rb:20:Warning: Gem::SourceIndex#search support
for
String patterns is deprecated, use #find_name
Loading development environment.
./script/…/config/…/config/boot.rb:20:Warning: Gem::SourceIndex#search
support for String patterns is deprecated, use #find
_name
Comparetick.find(3)
NameError: uninitialized constant Comparetick
from
e:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:266:in
load_missing_const ant' from e:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:452:in
const_missing’
from
e:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:464:in
`const_missing’
from (irb):1
from :0
Dir.glob(RAILS_ROOT + ‘/app/models/*.rb’).each { |file| require file }=>
[“./script/…/config/…/config/…/app/models/abroker.rb”,
“./script/…/config/…/config/…/app/models/amibrokerscan.rb”, "
./script/…/config/…/config/…/app/models/amibrokerscanbak.rb",
“./script/…/config/…/config/…/app/models/amibrokerscans.r
b”, “./script/…/config/…/config/…/app/models/compareticks.rb”,
“./script/…/config/…/config/…/app/models/customquery.rb”
, “./script/…/config/…/config/…/app/models/dailyscans.rb”,
“./script/…/config/…/config/…/app/models/execution.rb”, “./s
cript/…/config/…/config/…/app/models/konstants.rb”,
“./script/…/config/…/config/…/app/models/picture.rb”, “./script/…/
config/…/config/…/app/models/portfolio.rb”,
“./script/…/config/…/config/…/app/models/rawdata.rb”,
“./script/…/config/…
/config/…/app/models/rawdatasignal.rb”,
“./script/…/config/…/config/…/app/models/scans.rb”,
“./script/…/config/…/config
/…/app/models/scans_log.rb”,
“./script/…/config/…/config/…/app/models/symbolmap.rb”,
“./script/…/config/…/config/…/app
/models/tag.rb”, “./script/…/config/…/config/…/app/models/test.rb”,
“./script/…/config/…/config/…/app/models/test1.rb”,
“./script/…/config/…/config/…/app/models/trade.rb”,
“./script/…/config/…/config/…/app/models/tradelog.rb”]
Comparetick.find(3)=> #<Comparetick:0x4819788
@attributes={“lastprice”=>nil, “symbol”=>“$USDCHF”, “time”=>“2009-06-12
15:59:04”, “bidvol”=>nil,
“bidprice”=>“1.0807”, “id”=>“3”, “volume”=>nil, “askvol”=>nil,
“askprice”=>nil, “provider”=>nil}>
–
View this message in context:
http://old.nabble.com/rails-console-not-loading-my-model-properly.-tp27378934p27378934.html
Sent from the RubyOnRails Users mailing list archive at Nabble.com.