Git Product home page Git Product logo

Comments (7)

LTe avatar LTe commented on July 22, 2024

I don't use ancestry method in this gem. How I can reproduce this issue?

from acts-as-messageable.

fiatlux avatar fiatlux commented on July 22, 2024

Thanks for replying. I just included in my gem file and was attempting to create and send a new message. I see the require ancestry in the following file: https://github.com/LTe/acts-as-messageable/blob/master/lib/acts-as-messageable/message.rb

i don't see how it's being called though. This is what i'm doing in the code:

  @to_user =User.find(params[:deliver_to])
  puts @to_user.email
  @message = current_user.send_message(@to_user, params[:subject], params[:message])

from acts-as-messageable.

LTe avatar LTe commented on July 22, 2024

Do you have whole backtrace?

from acts-as-messageable.

fiatlux avatar fiatlux commented on July 22, 2024
ruby-1.9.2-p180 :010 > u.send_message(v,"subject 1", "message 1")
NoMethodError: undefined method `ancestry' for #<ActsAsMessageable::Message:0x0000010524fcd8>
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activemodel-3.0.3/lib/active_model/attribute_methods.rb:364:in `method_missing'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/attribute_methods.rb:46:in `method_missing'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activemodel-3.0.3/lib/active_model/validator.rb:152:in `block in validate'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activemodel-3.0.3/lib/active_model/validator.rb:151:in `each'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activemodel-3.0.3/lib/active_model/validator.rb:151:in `validate'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/callbacks.rb:314:in `_callback_before_41'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/callbacks.rb:414:in `_run_validate_callbacks'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activemodel-3.0.3/lib/active_model/validations.rb:212:in `run_validations!'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activemodel-3.0.3/lib/active_model/validations/callbacks.rb:67:in `block in run_validations!'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/callbacks.rb:413:in `_run_validation_callbacks'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activemodel-3.0.3/lib/active_model/validations/callbacks.rb:67:in `run_validations!'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activemodel-3.0.3/lib/active_model/validations.rb:179:in `valid?'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/validations.rb:55:in `valid?'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/validations.rb:75:in `perform_validations'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/validations.rb:49:in `save!'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/attribute_methods/dirty.rb:30:in `save!'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/transactions.rb:242:in `block in save!'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/transactions.rb:289:in `block in with_transaction_returning_status'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/transactions.rb:204:in `transaction'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/transactions.rb:287:in `with_transaction_returning_status'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/transactions.rb:242:in `save!'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/validations.rb:34:in `create!'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/acts-as-messageable-0.3.1/lib/acts-as-messageable/acts-as-messageable.rb:71:in `send_message'
    from (irb):10
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/railties-3.0.3/lib/rails/commands/console.rb:44:in `start'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/railties-3.0.3/lib/rails/commands/console.rb:8:in `start'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/railties-3.0.3/lib/rails/commands.rb:23:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'ruby-1.9.2-p180 :011 > u.send_message(v,"subject 1", "message 1")
NoMethodError: undefined method `ancestry' for #<ActsAsMessageable::Message:0x0000010516d2c0>
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activemodel-3.0.3/lib/active_model/attribute_methods.rb:364:in `method_missing'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/attribute_methods.rb:46:in `method_missing'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activemodel-3.0.3/lib/active_model/validator.rb:152:in `block in validate'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activemodel-3.0.3/lib/active_model/validator.rb:151:in `each'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activemodel-3.0.3/lib/active_model/validator.rb:151:in `validate'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/callbacks.rb:314:in `_callback_before_41'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/callbacks.rb:414:in `_run_validate_callbacks'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activemodel-3.0.3/lib/active_model/validations.rb:212:in `run_validations!'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activemodel-3.0.3/lib/active_model/validations/callbacks.rb:67:in `block in run_validations!'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/callbacks.rb:413:in `_run_validation_callbacks'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activemodel-3.0.3/lib/active_model/validations/callbacks.rb:67:in `run_validations!'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activemodel-3.0.3/lib/active_model/validations.rb:179:in `valid?'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/validations.rb:55:in `valid?'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/validations.rb:75:in `perform_validations'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/validations.rb:49:in `save!'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/attribute_methods/dirty.rb:30:in `save!'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/transactions.rb:242:in `block in save!'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/transactions.rb:289:in `block in with_transaction_returning_status'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/transactions.rb:204:in `transaction'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/transactions.rb:287:in `with_transaction_returning_status'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/transactions.rb:242:in `save!'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/validations.rb:34:in `create!'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/acts-as-messageable-0.3.1/lib/acts-as-messageable/acts-as-messageable.rb:71:in `send_message'
    from (irb):11
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/railties-3.0.3/lib/rails/commands/console.rb:44:in `start'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/railties-3.0.3/lib/rails/commands/console.rb:8:in `start'
    from /Users/fiatlux1977/RubymineProjects/tsf/vendor/ruby/1.9.1/gems/railties-3.0.3/lib/rails/commands.rb:23:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'ruby-1.9.2-p180 :012 > 

from acts-as-messageable.

LTe avatar LTe commented on July 22, 2024

Try upgrade to 0.4.0

from acts-as-messageable.

fiatlux avatar fiatlux commented on July 22, 2024

i did that and it works in rubymine but not in terminal somehow. must be something else in my environment. i'll try to look more.

also, do you have any samples/templates for retreiving and displaying a specific message. so i have a list of messages and i want to layout like you would in gmail. then click into a message to see the full message detail. I saw that the wiki has a controller example, but i don't see any view examples. that would save me some time.

thanks for your work on this.

from acts-as-messageable.

LTe avatar LTe commented on July 22, 2024

https://gist.github.com/93496f14e5a6200cd654

from acts-as-messageable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.