tag:appoxy.lighthouseapp.com,2009-09-28:/projects/38366-simplerecord/eventsappoxy / SimpleRecord Events2009-09-29T03:10:34Ztag:appoxy.lighthouseapp.com,2009-09-28:Event/70026282010-04-14T15:40:49-07:002010-04-14T15:40:50-07:00chris finneSimpleRecord: assigning a DateTime to a has_dates attribute doesn't work properly [#17]<div><p>Note the formatting of the string isn't done properly when a
DateTime is saved</p>
<p><a href=
"http://gist.github.com/366422">http://gist.github.com/366422</a></p>
<p>This is because in<br>
SimpleRecord::Translations.pad_and_offset</p>
<p>it checks:<br>
x.respond_to?(:iso8601)</p>
<p>But DateTime doesn't respond to that method, so it doesn't get
formatted with the @@date_format</p></div>tag:appoxy.lighthouseapp.com,2009-09-28:Event/68788212010-04-06T03:26:48-07:002010-04-06T03:26:48-07:00chris finneSimpleRecord: find a false boolean fails [#16]<div><p>It also fails in the same way with find(:all, :conditions) where
conditions is a hash or an array.</p>
<p>I think I've traced it to this method in the aws gem:
right_sdb_interface.rb</p>
<pre>
<code>def escape(value)
%Q{'#{value.to_s.gsub(/(['\\])/){ "\\#{$1}" }}'} if value
end</code>
</pre>
<p>the <code>value</code> is false, so nothing is returned.</p></div>tag:appoxy.lighthouseapp.com,2009-09-28:Event/68785912010-04-06T03:02:53-07:002010-04-06T03:02:54-07:00chris finneSimpleRecord: find a false boolean fails [#16]<div><p>This fails:<br>
ReportPageView.find_all_by_is_processed(false)</p>
<p>the "false" value not being appended to the SELECT
statement...</p>
<p>Aws::AwsError: InvalidQueryExpression: The specified query
expression syntax is not valid...<br>
Action=Select&SelectExpression=SELECT%20%2A%20FROM%20%60development_report_page_views%60%20WHERE%20is_processed%3D&SignatureMethod=</p>
<p>find by a true value works fine.</p></div>tag:appoxy.lighthouseapp.com,2009-09-28:Event/64600112010-03-05T00:57:18-08:002010-03-05T00:57:19-08:00Chad ArimuraSimpleRecord: Rest routing without implicit .id does not work [#15]<div><p>Actually I take that back redirect_to(@user.id) doesn't work
anyways.... it doesn't throw an error per se but it's not
supported...</p>
<p>Adding functionality for that to comply with restful routing is
important.</p></div>tag:appoxy.lighthouseapp.com,2009-09-28:Event/64599602010-03-05T00:52:27-08:002010-03-05T00:52:28-08:00Chad ArimuraSimpleRecord: Rest routing without implicit .id does not work [#15]<div><p>For example: when generating scaffolding for Rails 2, you'll get
lines of code like this that work with ActiveRecord</p>
<p>format.html { redirect_to(@user) }</p>
<p>Simplerecord returns this error: ActionView::TemplateError
(user_url failed to generate from.....</p>
<p>When changing the line to</p>
<p>format.html { redirect_to(@user.id) }</p>
<p>It works...... we should fix this to bring SR closer to AR's
spec.</p></div>tag:appoxy.lighthouseapp.com,2009-09-28:Event/56914532009-12-30T19:29:21-08:002009-12-30T19:29:21-08:00travis (at appoxy)SimpleRecord: att_meta is nil and errors app [#14]<li>State changed from <em class="change">“new”</em> to <em class="change">“resolved”</em></li>
tag:appoxy.lighthouseapp.com,2009-09-28:Event/56914522009-12-30T19:29:16-08:002009-12-30T19:29:16-08:00travis (at appoxy)SimpleRecord: att_meta is nil and errors app [#14]<div><p>Fixed in 41.</p></div>tag:appoxy.lighthouseapp.com,2009-09-28:Event/56833402009-12-29T17:18:13-08:002009-12-29T17:18:13-08:00Chad ArimuraSimpleRecord: att_meta is nil and errors app [#14]<div><p>Fix (not sure if this changes intended functionality):</p>
<p>Line 895 - if att_meta && att_meta.type ==
:belongs_to</p>
<p>Line 986 - if att_meta && att_meta.options</p></div>tag:appoxy.lighthouseapp.com,2009-09-28:Event/53221852009-11-23T13:39:02-08:002009-11-23T13:39:02-08:00travis (at appoxy)SimpleRecord: Make has_many use ResultsArray, rather than old sub_array [#13]<div><p>See: <a href=
"http://groups.google.com/group/simple-record/browse_thread/thread/97ae36a5f3058976">
http://groups.google.com/group/simple-record/browse_thread/thread/9...</a></p></div>tag:appoxy.lighthouseapp.com,2009-09-28:Event/52615192009-11-17T15:34:25-08:002009-11-17T15:34:25-08:00travis (at appoxy)SimpleRecord: When pushing items into ResultsArray, size of array is no longer valid [#12]<div><p>eg:</p>
<pre>
<code>results << x</code>
</pre>
<p>This is because size is based on the COUNT in the database, not
the backing array. Needs to be another counter or something that is
added to size if things are pushed/removed from backing array.</p></div>tag:appoxy.lighthouseapp.com,2009-09-28:Event/49898382009-10-23T20:02:40-07:002009-10-23T20:05:35-07:00Chad ArimuraSimpleRecord: Make destroy() and alias for delete() [#11]<div><p>I wasn't aware this didn't work but to comply with ActiveRecord
we may want to alias delete with destroy....</p>
<p>However I think AR.destroy actually allows the object in scope
to still be accessed, while delete does not, so maybe it's not as
simple as an alias.</p></div>tag:appoxy.lighthouseapp.com,2009-09-28:Event/48713332009-10-14T02:48:54-07:002009-10-14T02:48:54-07:00travis (at appoxy)SimpleRecord: add newify or mark_as_new method which resets id and @new_record = true [#10]tag:appoxy.lighthouseapp.com,2009-09-28:Event/48660862009-10-13T14:38:48-07:002009-10-13T14:38:48-07:00Chad ArimuraSimpleRecord: model.attrib = nil is leaving a "nil" string [#7]<div><p>resolved - will push soon</p></div>tag:appoxy.lighthouseapp.com,2009-09-28:Event/48660622009-10-13T14:37:31-07:002009-10-13T14:37:31-07:00Chad ArimuraSimpleRecord: Fix test_objects_in_constructor or remove test [#9]<div><p>2) Error:<br>
test_objects_in_constructor(TestSimpleRecord):<br>
NoMethodError: undefined method <code>gsub' for
nil:NilClass<br/></code></p>
<pre>
<code>/usr/local/lib/ruby/1.9.1/cgi/util.rb:6:in `escape'
/usr/local/lib/ruby/gems/1.9.1/gems/aws-1.11.36/lib/awsbase/right_awsbase.rb:98:in `amz_escape'
/usr/local/lib/ruby/gems/1.9.1/gems/aws-1.11.36/lib/awsbase/right_awsbase.rb:82:in `block in sign_request_v2'
/usr/local/lib/ruby/gems/1.9.1/gems/aws-1.11.36/lib/awsbase/right_awsbase.rb:81:in `map'
/usr/local/lib/ruby/gems/1.9.1/gems/aws-1.11.36/lib/awsbase/right_awsbase.rb:81:in `sign_request_v2'
/usr/local/lib/ruby/gems/1.9.1/gems/aws-1.11.36/lib/awsbase/right_awsbase.rb:264:in `signed_service_params'
/usr/local/lib/ruby/gems/1.9.1/gems/aws-1.11.36/lib/sdb/right_sdb_interface.rb:96:in `generate_request'
/usr/local/lib/ruby/gems/1.9.1/gems/aws-1.11.36/lib/sdb/right_sdb_interface.rb:401:in `put_attributes'
/usr/local/lib/ruby/gems/1.9.1/gems/aws-1.11.36/lib/sdb/active_sdb.rb:808:in `save'
/usr/local/lib/ruby/gems/1.9.1/gems/simple_record-1.1.19/lib/simple_record.rb:631:in `save'
test_simple_record.rb:272:in `test_objects_in_constructor'</code>
</pre></div>tag:appoxy.lighthouseapp.com,2009-09-28:Event/48660422009-10-13T14:36:06-07:002009-10-13T14:36:06-07:00Chad ArimuraSimpleRecord: Resolve test_changed test [#8]<div><p>1) Failure:<br>
test_changed(TestSimpleRecord) [test_simple_record.rb:150]:<br>
is not true.</p></div>tag:appoxy.lighthouseapp.com,2009-09-28:Event/48567562009-10-13T02:30:08-07:002009-10-13T02:30:08-07:00Chad ArimuraSimpleRecord: model.attrib = nil is leaving a "nil" string [#7]<div><p>Needs to delete the attribute instead....</p></div>tag:appoxy.lighthouseapp.com,2009-09-28:Event/48318662009-10-09T14:14:27-07:002009-10-09T14:14:27-07:00travis (at appoxy)SimpleRecord: Implement paging with COUNT/LIMIT and next_token [#4]<div><p>Should be compatible with will_paginate.</p></div>tag:appoxy.lighthouseapp.com,2009-09-28:Event/48294492009-10-09T11:27:52-07:002009-10-09T11:27:52-07:00Chad ArimuraSimpleRecord: Implement Model.all [#5]<li>Assigned user set to <em class="change">“Chad Arimura”</em></li>
tag:appoxy.lighthouseapp.com,2009-09-28:Event/48290032009-10-09T10:58:03-07:002009-10-09T10:58:03-07:00travis (at appoxy)SimpleRecord: Convert params to appropriate types on Model.new(params[:model]) in rails [#6]<div><p>Currently sets them all as strings so if it gets saved, it saves
as inputted string without the padding/offsets.</p>
<p>Eg:</p>
<pre>
<code class="ruby">class MyModel < SimpleRecord::Base
has_ints :x
end</code>
</pre>
<p>Now say in view, you enter:</p>
<p>x: 123</p>
<p>now in controller, you do:</p>
<pre>
<code class="ruby">mm = MyModel.new(params[:my_model])
mm.save</code>
</pre>
<p>123 will be saved directly without offset/padding. So when you
retrieve the object, it will be some big negative number.</p></div>tag:appoxy.lighthouseapp.com,2009-09-28:Event/48227842009-10-08T22:54:54-07:002009-10-08T22:54:54-07:00Chad ArimuraSimpleRecord: Implement Model.all [#5]<div><p>Alias Model.all to Model.find(:all)</p>
<p>Not mission critical but provides cleaner ActiveRecord
drop-in.</p></div>tag:appoxy.lighthouseapp.com,2009-09-28:Event/48086942009-10-07T22:33:54-07:002009-10-07T22:33:54-07:00travis (at appoxy)SimpleRecord: Implement paging with COUNT/LIMIT and next_token [#4]<div><p>See: <a href=
"http://developer.amazonwebservices.com/connect/thread.jspa?messageID=135691">
http://developer.amazonwebservices.com/connect/thread.jspa?messageI...</a></p></div>tag:appoxy.lighthouseapp.com,2009-09-28:Event/47164972009-09-29T18:48:14-07:002009-09-29T18:48:14-07:00travis (at appoxy)SimpleRecord: Need to add validation methods in simplerecord [#2]<li>Tag cleared.</li>
tag:appoxy.lighthouseapp.com,2009-09-28:Event/47164952009-09-29T18:48:03-07:002009-09-29T18:48:03-07:00travis (at appoxy)SimpleRecord: Need to add validation methods in simplerecord [#2]<li>State changed from <em class="change">“new”</em> to <em class="change">“resolved”</em></li>
<div><p>Fixed and committed.</p></div>tag:appoxy.lighthouseapp.com,2009-09-28:Event/47164812009-09-29T18:44:58-07:002009-09-29T18:44:58-07:00travis (at appoxy)SimpleRecord: Support for random index look ups in ResultsArray [#1]<li>State changed from <em class="change">“open”</em> to <em class="change">“resolved”</em></li>
tag:appoxy.lighthouseapp.com,2009-09-28:Event/47158382009-09-29T16:58:46-07:002009-09-29T16:58:46-07:00travis (at appoxy)SimpleRecord: Make box usage and what not available in the ResultsArray [#3]<div><p>Add up the box usage for every next_token query in this
ResultsArray.</p>
<ul>
<li>total_box_usage</li>
<li>query_count (number queries issues with next_token)</li>
</ul>
<p>Could maybe even spit out a warning if it gets ridiculous.</p></div>tag:appoxy.lighthouseapp.com,2009-09-28:Event/47033602009-09-28T23:59:21-07:002009-09-28T23:59:19-07:00travis (at appoxy)[Message] SimpleRecord: Should we add paginate method so will_paginate will work out of the box?<div><p>Currently to get will_paginate to work you have to:</p>
<p>1: Add this somewhere in your code (eg: environment.rb):</p>
<pre>
<code class="ruby">SimpleRecord::ResultsArray.class_eval do
def paginate(options = {})
raise ArgumentError, "parameter hash expected (got #{options.inspect})" unless Hash === options
WillPaginate::Collection.create(
options[:page] || 1,
options[:per_page] || 30,
options[:total_entries] || self.length
) { |pager|
pager.replace self[pager.offset, pager.per_page].to_a
}
end
end</code>
</pre>
<p>2: Find then paginate when querying, for eg:</p>
<pre>
<code class=
"ruby">@posts = Post.find(:all, :order => 'created_at DESC').paginate(:page => params[:page], :per_page => 25)</code>
</pre>
<p>Step 1 and 2 could all be condensed to behave like the simplest
use of will_paginate:</p>
<pre>
<code class=
"ruby">@posts = Post.paginate :page => params[:page], :order => 'created_at DESC'</code>
</pre>
<p>Might make sense to include this in SimpleRecord to ease the
transition.</p></div>tag:appoxy.lighthouseapp.com,2009-09-28:Event/47024822009-09-28T20:31:46-07:002009-09-28T20:31:46-07:00travis (at appoxy)SimpleRecord: Support for random index look ups in ResultsArray [#1]<div><p>More info: <a href=
"http://groups.google.com/group/simple-record/browse_thread/thread/1b2443aa11c47b1c">
http://groups.google.com/group/simple-record/browse_thread/thread/1...</a></p></div>tag:appoxy.lighthouseapp.com,2009-09-28:Event/47024772009-09-28T20:30:43-07:002009-09-28T20:30:43-07:00travis (at appoxy)SimpleRecord: Support for random index look ups in ResultsArray [#1]<li>State changed from <em class="change">“new”</em> to <em class="change">“open”</em></li>
tag:appoxy.lighthouseapp.com,2009-09-28:Event/47024052009-09-28T20:14:15-07:002009-09-28T20:14:16-07:00sadesh kumarSimpleRecord: Need to add validation methods in simplerecord [#2]<div><p>We need to add validation methods 'valid?' and 'invalid?' to
simple record as active record has in order to perform validation
alone on simplerecord object.</p></div>tag:appoxy.lighthouseapp.com,2009-09-28:Event/47023742009-09-28T20:10:34-07:002009-09-28T20:10:34-07:00travis (at appoxy)SimpleRecord: Support for random index look ups in ResultsArray [#1]<div><p>This will allow will_paginate to work properly.</p></div>