Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Tools
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

[Standup][NY]09/11/12: CanCan condition hashes)

Danny Gagne
Tuesday, September 11, 2012

Interestings

  • CanCan, condition hashes, and index actions

If you have something like:

`can :manage, Group, memberships: { user_id: user.id }`

and:

`class Group < AR::Base
has_many memberships
end
`

you will get duplicate Groups in index action’s @groups ivar when you load_and_authorize (sic) :group as CanCan will do an SQL join of the groups and memberships table.

The solution for us was to use a block and populate the @groups ivar ourselves in the action.

Events

  • Tuesday: NYC.rb Presentation Night
    http://www.meetup.com/NYC-rb/

Founded in 2004, NYC.rb is the place for experienced Ruby and Rails programmers in New York City.
MEETUPS
We meet on the second and fourth Tuesdays of the month. Second Tuesdays are for one or more talks, and fourth Tuesdays are just hackfests, where people bring their laptops and hang out.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

[Standup][NY] 9/10/12: Debugging CoffeeScript in Chrome

Danny Gagne
Monday, September 10, 2012

Interestings

Debugging CoffeeScript in Chrome

When you go to “Sources” in web inspector for a web page that includes test.js it will now show your CoffeeScript source files where you can set break points, hover variables to see their values, etc.

http://ryanflorence.com/2012/coffeescript-source-maps/

Events

  • Monday: CTO School
  • Tuesday: NYC.rb Presentation Night http://www.meetup.com/NYC-rb/
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Danny Gagne

Danny Gagne
New York

Subscribe to Danny's Feed

Author Topics

agile (2)
coffeescript (1)
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Tools
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >