我正试图将我的应用程序从Rails 3.2.1升级到3.2.12,在尝试更新属性时遇到了一个field_changed问题(方法未定义)。我知道它在3.2.9中被更改为_field_changed,我认为我的宝石是最新的,但我似乎找不到问题。有什么想法吗?这是我的相关代码:
控制器
@user_role = Role.find_or_create_by_constituent_id(session[:user_id])
@user_role.update_attributes(:constituent_id => session[:user_id], :login => session[:username], :role => session[:user_role], :timestamp => Date.today)
@user_role.save
Gemfile
gem 'rails', '3.2.12'
gem 'execjs'
gem 'therubyracer'
gem "composite_primary_keys"
gem "tiny_tds", "~> 0.5.1"
gem "csv_builder", "~> 2.1.0" #provides easy csv downloads
gem 'activerecord-sqlserver-adapter', :git => "git://github.com/timkleier/activerecord-sqlserver-adapter.git", :ref => "6bfb3b59e1f0adef59c91ded519ae160fe28b386"
gem 'by_star', :git => "git://github.com/radar/by_star.git", :ref => "13b594c758"
gem 'twitter-bootstrap-rails'
gem "less-rails"
gem "carrierwave"
gem "fog"
gem "figaro"
group :assets do
gem 'sass-rails', '~> 3.2.4'
gem 'coffee-rails', '~> 3.2.2'
gem 'uglifier', '~> 1.2.3'
end
group :development do
gem 'annotate', ">=2.5.0"
gem 'rspec-rails'
end
gem 'jquery-rails', '2.0.2'
gem 'client_side_validations'
gem 'jquery_datepicker'
gem 'capistrano'
gem 'rvm-capistrano'
捆绑显示
* actionmailer (3.2.12)
* actionpack (3.2.12)
* activemodel (3.2.12)
* activerecord (3.2.12)
* activerecord-sqlserver-adapter (3.2.12 6bfb3b5)
* activeresource (3.2.12)
* activesupport (3.2.12)
* annotate (2.5.0)
* arel (3.0.2)
* builder (3.0.4)
* bundler (1.2.4)
* by_star (2.0.0.beta1 13b594c)
* capistrano (2.15.4)
* carrierwave (0.8.0)
* chronic (0.9.1)
* client_side_validations (3.2.5)
* coffee-rails (3.2.2)
* coffee-script (2.2.0)
* coffee-script-source (1.6.2)
* commonjs (0.2.6)
* composite_primary_keys (5.0.8)
* csv_builder (2.1.1)
* diff-lcs (1.2.4)
* erubis (2.7.0)
* excon (0.6.6)
* execjs (1.4.0)
* figaro (0.6.4)
* fog (0.9.0)
* formatador (0.2.4)
* highline (1.6.19)
* hike (1.2.3)
* i18n (0.6.4)
* journey (1.0.4)
* jquery-rails (2.0.2)
* jquery_datepicker (0.4)
* json (1.8.0)
* less (2.3.2)
* less-rails (2.3.3)
* libv8 (3.11.8.17)
* mail (2.4.4)
* mime-types (1.23)
* mini_portile (0.5.0)
* multi_json (1.7.8)
* net-scp (1.1.1)
* net-sftp (2.1.2)
* net-ssh (2.6.7)
* net-ssh-gateway (1.2.0)
* nokogiri (1.6.0)
* polyglot (0.3.3)
* rack (1.4.5)
* rack-cache (1.2)
* rack-ssl (1.3.3)
* rack-test (0.6.2)
* rails (3.2.12)
* rails_sql_views (0.8.0 be67a84)
* railties (3.2.12)
* rake (10.1.0)
* rdoc (3.12.2)
* ref (1.0.5)
* rspec-core (2.13.1)
* rspec-expectations (2.13.0)
* rspec-mocks (2.13.1)
* rspec-rails (2.13.2)
* ruby-hmac (0.4.0)
* rvm-capistrano (1.3.1)
* sass (3.2.9)
* sass-rails (3.2.6)
* spork (1.0.0rc3)
* sprockets (2.2.2)
* therubyracer (0.11.4)
* thor (0.18.1)
* tilt (1.4.1)
* tiny_tds (0.5.1)
* treetop (1.4.14)
* twitter-bootstrap-rails (2.2.7)
* tzinfo (0.3.37)
* uglifier (1.2.7)
* webrat (0.7.3)
事实证明composite_primary_keys是罪魁祸首。无论出于什么原因,bundle使用的是5.0.8,我需要将其升级到5.0.9版本(其中field_changed更改为_field_hanged)。