NameError: undefined method `content' for class `LibraryFramework'

from 
/Users/itsmechlark/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.8/lib/active_support/core_ext/module/aliasing.rb:32:in
 
`alias_method'

from 
/Users/itsmechlark/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.8/lib/active_support/core_ext/module/aliasing.rb:32:in
 
`alias_method_chain'

from 
/Users/itsmechlark/Desktop/GitHub/itsmechlark/cdasiaonline/app/models/library_framework.rb:134:in
 
`<class:LibraryFramework>'

from 
/Users/itsmechlark/Desktop/GitHub/itsmechlark/cdasiaonline/app/models/library_framework.rb:2:in
 
`<top (required)>'

from 
/Users/itsmechlark/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:443:in
 
`load'

from 
/Users/itsmechlark/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:443:in
 
`block in load_file'

from 
/Users/itsmechlark/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:633:in
 
`new_constants_in'

from 
/Users/itsmechlark/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:442:in
 
`load_file'

from 
/Users/itsmechlark/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:342:in
 
`require_or_load'

from 
/Users/itsmechlark/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:480:in
 
`load_missing_constant'

from 
/Users/itsmechlark/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:180:in
 
`const_missing'

 from 
/Users/itsmechlark/Desktop/GitHub/itsmechlark/cdasiaonline/app/models/sec.rb:1:in
 
`<top (required)>'

class LibraryFramework < ActiveRecord::Base
  self.abstract_class = true


  def content_with_corrector
    justified = self.class.justify_content(content_without_corrector)
    self.class.check_replace_invalid_format(justified)
  end
  alias_method_chain :content, :corrector


end


class Sec < LibraryFramework
  BANNER = 'Taxation'
  MIN_YEAR = 1980

  validates :docdate, date: true,
            inclusion: {
                in: Date.new(MIN_YEAR)..Time.now.to_date,
                message: "The date must be between #{Date.new(MIN_YEAR)} and 
#{Time.now.to_date}"},
            :if => lambda{ |object| object.doc_date.present? }
  validates :year, :inclusion => { :in => MIN_YEAR..(Time.now.year),
                                   :message => "The year must be between 
#{MIN_YEAR} and #{Time.now.year}" },
            :if => lambda{ |object| object.year.present? }

end


-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/33153ede-aad6-4d06-a115-09ee6d3f0ca4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to