This file contains 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
def self.first_uninteresting | |
last = 0 | |
Number.all(:order => "number").each do |n| # Number.find/all will return an enumerable, so you can each it directly. | |
return last + 1 if n.number.to_i != last + 1 # if's can be on the same line at the end for basic tests | |
last = n.number.to_i #ops forgot the number casting | |
end | |
last + 1 # Ruby will automatically return the last valuation, no need for 'return' | |
end |
This file contains 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
// .......................................... | |
// REFRESH | |
refreshRecords: function(records, options) { | |
if (!records || records.length == 0) return ; | |
if (!options) options = {} ; | |
records = records.byResourceURL() ; // group by resource. | |
for(var resource in records) { | |
if (resource == '*') continue ; |
This file contains 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
/** | |
@property | |
This is the actual array of records in the current collection. This | |
property will change anytime the record members change (but not when | |
the member record properties change). | |
@type {Array} | |
*/ | |
records: function() { |
NewerOlder