模型属性未设置
下面的日志片段显示了传入的参数,但是当执行 SQL 插入语句时,它会为所有值插入空值,而不是 params 中的值。你们能给我一些调试的想法吗?我不知道从哪里开始
Processing by CvitsController#create as HTML
Parameters: {"commit"=>"Submit", "authenticity_token"=>"uRicLgLLkzSSB62b/bqefI0tQ2lR6UX8axKWBtM0dsU=", "utf8"=>"✓", "cvit"=>{"cluster_dist"=>"10000", "textup"=>">Glyma02g37330 RING finger family [Glycine max]\r\nMNMHKESPLIKLHSFDQGHAWLALLHLLIHVSPAVTGQPVTPPVQPDSNKSMVTIMAILAIMFLILVFLSIYSRKCYDRQAPTRGILDRADPTG\r\nAAGNPSQAESNGLNQATIETFPSFLYGDVKGLKIGKDTLACAVCLNEFEDDETLRMIPKCCHVYHRYCIDEWLGSHSTCPVCRANLVPQPED\r\nVNINTNIPSILSIQIPDEHEHEYEYETVVVGEEHKRGNVVESPKVNLLRRIRSLNHQSRPSRSRSTGFLSSLLFSRSNSLGQMQLAHNAAGENYE\r\nRFTLRLPEEVRSQMMLQRANSCVCFTRMSSGTWGYRTTRSAGRRCVQYERFGGGDDEGWGFTLTPPSLIRNGWNNNRSTRKSQRSGLVLD\r\nNNNADEKSSEFLPLG*", "filter"=>"T", "min_identity"=>"60", "e_value"=>"1e-10", "program"=>"blastp", "species"=>"glycine_max"}}
Creating scope :page. Overwriting existing method Cvit.page.
SQL (0.1ms) BEGIN
SQL (1.6ms) describe `cvits`
AREL (0.3ms) INSERT INTO `cvits` (`cluster_dist`, `fileup_file_size`, `textup`, `fileup_file_name`, `filter`, `created_at`, `program`, `fileup_updated_at`, `species`, `min_identity`, `updated_at`, `e_value`, `fileup_content_type`) VALUES (NULL, NULL, NULL, NULL, NULL, '2011-08-05 13:50:07', NULL, NULL, NULL, NULL, '2011-08-05 13:50:07', NULL, NULL)
[paperclip] Saving attachments.
SQL (121.3ms) COMMIT
Redirected to http://soybase.org:8085/cvits/4
Completed 302 Found in 150ms
模型:
class Cvit < ActiveRecord::Base
attr_accessor :species,:program,:textup,:e_value,:filter,:min_identity,:cluster_dist,:fileup_file_name
attr_accessor :base_path, :fa_file, :text_file, :dbase, :source, :bl_file, :bl_sorted, :gff_file, :cvt_file, :db, :overlay_coords_gray
def initilize(*args)
super(*args)
end
def cvitSetup()
.
.
.
end
def blast()
.
.
.
end
.
.
.
end
The below log snippet shows the parameters that get passed in, but then when the SQL insert statement is made it inserts nulls for all the values instead of the values in params. Can you guys give me some ideas to debug this? I don't know where to start
Processing by CvitsController#create as HTML
Parameters: {"commit"=>"Submit", "authenticity_token"=>"uRicLgLLkzSSB62b/bqefI0tQ2lR6UX8axKWBtM0dsU=", "utf8"=>"✓", "cvit"=>{"cluster_dist"=>"10000", "textup"=>">Glyma02g37330 RING finger family [Glycine max]\r\nMNMHKESPLIKLHSFDQGHAWLALLHLLIHVSPAVTGQPVTPPVQPDSNKSMVTIMAILAIMFLILVFLSIYSRKCYDRQAPTRGILDRADPTG\r\nAAGNPSQAESNGLNQATIETFPSFLYGDVKGLKIGKDTLACAVCLNEFEDDETLRMIPKCCHVYHRYCIDEWLGSHSTCPVCRANLVPQPED\r\nVNINTNIPSILSIQIPDEHEHEYEYETVVVGEEHKRGNVVESPKVNLLRRIRSLNHQSRPSRSRSTGFLSSLLFSRSNSLGQMQLAHNAAGENYE\r\nRFTLRLPEEVRSQMMLQRANSCVCFTRMSSGTWGYRTTRSAGRRCVQYERFGGGDDEGWGFTLTPPSLIRNGWNNNRSTRKSQRSGLVLD\r\nNNNADEKSSEFLPLG*", "filter"=>"T", "min_identity"=>"60", "e_value"=>"1e-10", "program"=>"blastp", "species"=>"glycine_max"}}
Creating scope :page. Overwriting existing method Cvit.page.
SQL (0.1ms) BEGIN
SQL (1.6ms) describe `cvits`
AREL (0.3ms) INSERT INTO `cvits` (`cluster_dist`, `fileup_file_size`, `textup`, `fileup_file_name`, `filter`, `created_at`, `program`, `fileup_updated_at`, `species`, `min_identity`, `updated_at`, `e_value`, `fileup_content_type`) VALUES (NULL, NULL, NULL, NULL, NULL, '2011-08-05 13:50:07', NULL, NULL, NULL, NULL, '2011-08-05 13:50:07', NULL, NULL)
[paperclip] Saving attachments.
SQL (121.3ms) COMMIT
Redirected to http://soybase.org:8085/cvits/4
Completed 302 Found in 150ms
Model:
class Cvit < ActiveRecord::Base
attr_accessor :species,:program,:textup,:e_value,:filter,:min_identity,:cluster_dist,:fileup_file_name
attr_accessor :base_path, :fa_file, :text_file, :dbase, :source, :bl_file, :bl_sorted, :gff_file, :cvt_file, :db, :overlay_coords_gray
def initilize(*args)
super(*args)
end
def cvitSetup()
.
.
.
end
def blast()
.
.
.
end
.
.
.
end
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将 attr_accessor 更改为 attr_accessible
change attr_accessor to attr_accessible