acts-as-audited

Show Last modified tables/records Rails 3.2

心不动则不痛 提交于 2019-12-12 05:25:09
问题 I still can't figure out how to implement this as i am a newbie with this. some people helpt me and said i had to use audited, so it did. this is my controller: def show add_breadcrumb 'Contract Bekijken', :contracten_path @contracten = Contracten.find(params[:id]) @audits = @contracten.audits.collect { |a| a.created_at } respond_to do |format| format.html # show.html.erb format.json { render json: @contracten } end end Here's a pastie of my whole controller. http://pastie.org/4270702 But i

Gem “audited-activerecord”, "~> 4.0 gives undefined method `audits'

梦想的初衷 提交于 2019-12-11 03:13:42
问题 I am using: Rail 4.1.7 Ruby 2.1.4 I just installed Audited GEM: gem "audited-activerecord", "~> 4.0" $ rails generate audited:upgrade $ rake db:migrate Model class Opportunity < ActiveRecord::Base ... audited ... end And when I run: Opportunity.audits.count I get this error: 2.1.4 :001 > Opportunity.audits.count NoMethodError: undefined method `audits' for #<Class:0x007ff7946656f0> from /Users/andreucasadella/.rvm/gems/ruby-2.1.4/gems/activerecord-4.1.7/lib/active_record/dynamic_matchers.rb