GithubHelp home page GithubHelp logo

decorated.id != model.id about draper HOT 3 CLOSED

drapergem avatar drapergem commented on July 20, 2024
decorated.id != model.id

from draper.

Comments (3)

bdotdub avatar bdotdub commented on July 20, 2024

FWIW ... I can't seem to reproduce on my repo.

pry(main)> u = User.first
=> #<User id: 1, ...>
pry(main)> u.id
=> 1
pry(main)> ud = UserDecorator.decorate(u)
=> #<UserDecorator:0x007fd1ef23fd98
 @context={},
 @model=
  #<User id: 1, ...>
pry(main)> ud.id
=> 1

pry(main)> u.id = 1000
=> 1000
pry(main)> ud = UserDecorator.decorate(u)
=> #<UserDecorator:0x007fd1ed983778
 @context={},
 @model=
  #<User id: 1000, ...>
pry(main)> ud.id
=> 1000

Are you doing anything tricky with how the Article#id is handled?

from draper.

vovayartsev avatar vovayartsev commented on July 20, 2024

Nothing tricky. I'm using ruby 1.8.7 enterprise edition and Rails 3.0.10. I must be using some old code (draper-0.8.1 from rubygems). Anyway I'll check this again tomorrow on a clean Rails 3.1 project on ruby-1.9.2 and will let you know if I can reproduce the issue.

from draper.

michaelfairley avatar michaelfairley commented on July 20, 2024

This happens on 1.8 but not 1.9. Fix submitted in pull request #50

from draper.

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.