This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module ActiveRecord | |
| module AdvisoryLock | |
| def obtain_advisory_lock(key, type = nil, &block) | |
| raise ArgumentError, "Method expects a block" unless block_given? | |
| obtain_lock(key, type) | |
| begin | |
| yield block |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| try { | |
| PreparedStatement query = sqlite.prepare("SELECT * FROM homes where player_name = ?"); | |
| query.setString(1, player.getDisplayName()); | |
| ResultSet result = query.executeQuery(); | |
| if (result.next()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| try { | |
| PreparedStatement query = sqlite.prepare("REPLACE INTO homes(player_name, world, x, y, z) values(?, ?, ?, ?, ?)"); | |
| query.setString(1, player.getDisplayName()); | |
| query.setString(2, player.getWorld().getName()); | |
| query.setDouble(3, location.getX()); | |
| query.setDouble(4, location.getY()); | |
| query.setDouble(5, location.getZ()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| subject.location.should == "02108" | |
| subject.location = "02108" | |
| subject.location_changed?.should be_false | |
| 'User should not attempt to geocode location if location has not changed' FAILED | |
| expected true to be false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| paypal_response = AdaptivePay::Callback.new(params) | |
| if paypal_response.status == "COMPLETED" | |
| @purchase.complete! | |
| end |
NewerOlder