Skip to content

Instantly share code, notes, and snippets.

@jywarren
Created March 30, 2015 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jywarren/b4c9286b2e104caeac6f to your computer and use it in GitHub Desktop.
Save jywarren/b4c9286b2e104caeac6f to your computer and use it in GitHub Desktop.
2.1.2 :002 > n = DrupalNode.find 10591
DrupalNode Load (0.2ms) SELECT `node`.* FROM `node` WHERE `node`.`nid` = 10591 LIMIT 1
=> #<DrupalNode nid: 10591, vid: 22273, type: "page", language: "", title: "ottawa", uid: 421299, status: 1, created: 1403188948, changed: 1427399207, comment: 0, promote: 0, moderate: 0, sticky: 0, tnid: 0, translate: 0, cached_likes: 1, drupal_comments_count: 0, drupal_node_revisions_count: 2, path: "/wiki/ottawa">
2.1.2 :003 > n.revisions
node_revisions Columns (0.8ms) SHOW FIELDS FROM `node_revisions`
DrupalNodeRevision Load (0.1ms) SELECT `node_revisions`.* FROM `node_revisions` WHERE `node_revisions`.`nid` = 10591 ORDER BY timestamp
=> [#<DrupalNodeRevision nid: 10591, vid: 22273, uid: 1, title: "Ottawa", body: "##Overview\r\nThe pollution of water bodies (e.g. riv...", teaser: "", log: "", timestamp: 1427399207, format: 1>, #<DrupalNodeRevision nid: 10591, vid: 19027, uid: 421299, title: "ottawa", body: "##Overview\r\nThe pollution of water bodies (e.g. riv...", teaser: "", log: "", timestamp: 1403188951, format: 1>]
2.1.2 :004 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment