Matt Rogers
f541a4c9d6
Simplify SearchController#results
...
Give names to the various things being searched for and move them out
into their own methods. Also add scopes to give names to things being
queried out of the models.
2013-03-12 19:49:19 -05:00
Matt Rogers
63fc460c00
Refactor the empty message criteria into its own method.
...
Removes plenty of duplication in the code
2013-03-12 14:21:12 -05:00
Matt Rogers
053e3fc8d6
Guard against the case days stale can be negative
2013-03-10 22:48:27 -05:00
Matt Rogers
d699359648
Move the view logic back into the helper
...
Staleness#days_stale only gives us the number of days that a Todo has
been stale. Add the logic for choosing the CSS class to use back to the
view helper.
2013-03-10 22:18:59 -05:00
Matt Rogers
c1c81d7653
Remove some of the time objects we no longer need
2013-03-10 13:55:21 -05:00
Matt Rogers
809154332f
Remove the fake preferences object
...
It's no longer needed since we're not using the preferences in this
object anymore.
2013-03-10 13:47:26 -05:00
Matt Rogers
43275e064e
Refactor the calculation for staleness
...
Provide the number of days that the todo was stale instead of a class
name to use in the view.
We'll use the number of days stale in the helper to determine the class
name
2013-03-10 13:46:22 -05:00
Matt Rogers
8dfbac0fe8
Use the newly extracted method object for getting todo staleness
2013-03-09 22:38:38 -06:00
Matt Rogers
8ffe3cacca
Move the fakes so that they're namespaced by the test
...
Prevents errors since the names clash with names used in other tests.
2013-03-09 22:38:38 -06:00
Matt Rogers
ccf5323588
Encapsulate the concept of staleness into its own class
...
Extract it from a single helper method and wrap it in a method object.
This lets us add tests around it and then (later) split the domain
concerns from the view concerns.
2013-03-09 22:38:38 -06:00
Dan Rice
d7e9b384f7
Clean up a couple hardcoded strings in alt tags
2013-03-09 12:46:05 -05:00
Dan Rice
cb5114922e
Add instructions relating to renamed Czech locale
2013-03-09 12:35:42 -05:00
Matt Rogers
ea7ab390e7
allow build failures on 2.0.0 for now
2013-03-05 13:56:45 -06:00
Matt Rogers
47f096e097
Merge pull request #171 from kytrinyx/fix-stats-test
...
Refer to view values correctly in test
2013-03-05 06:52:39 -08:00
Matt Rogers
01f7af89dd
Merge pull request #170 from kytrinyx/rename-index-page
...
Use a more appropriate name for stats domain object
2013-03-05 06:51:59 -08:00
Katrina Owen
3479585991
Use a more appropriate name for stats domain object
2013-03-05 07:49:44 -07:00
Katrina Owen
0b3a0b58a8
Refer to view values correctly in test
2013-03-05 07:48:08 -07:00
Dan Rice
34e0c2b13a
Revert "Use db:schema:load instead of db:migrate"
...
This reverts commit 3c5f28869b ,
which did not function properly on the continuous integration server.
2013-03-05 01:00:24 -05:00
Dan Rice
3c5f28869b
Use db:schema:load instead of db:migrate
2013-03-04 12:50:30 -05:00
Dan Rice
9cdea2c51f
Check schema.rb into source control
...
This practice is "strongly recommended."
http://guides.rubyonrails.org/migrations.html#schema-dumps-and-source-control
2013-03-04 12:42:59 -05:00
Matt Rogers
66827d0640
add test coverage for when we don't have any users
...
It wasn't being covered in the functional test for this controller.
2013-03-03 13:56:24 -06:00
Matt Rogers
7c5028f227
add the mocha stubbing and mocking library
2013-03-03 13:56:18 -06:00
Reinier Balt
0f7ed245c6
Merge pull request #169 from kytrinyx/index-page
...
Encapsulate dependencies of stats index page
2013-03-03 06:35:29 -08:00
Matt Rogers
31d32614e2
restore the french locale file
2013-03-02 23:19:30 -06:00
Katrina Owen
d5a555fbac
Encapsulate dependencies of stats index page
...
This may be a bit extreme.
It's modeled after the ideal "rails way".
In the controller, we now know the name of a single resource. It
doesn't happen to be backed by a database table, but it does know all
about the task of collecting stats, leaving the controller concerned
with just munging params and rendering stuff.
I called the resource `IndexPage`, to avoid the temptation of trying to
reuse it, which can get pretty messy.
Later, if a better abstraction appears, it should be fairly painless to
alter.
2013-03-02 17:35:19 -07:00
Katrina Owen
6df3534baf
Inline last pieces into StatsController#index
...
We can now skip the before filter that sets instance variables.
2013-03-02 17:27:38 -07:00
Katrina Owen
ac4a483b18
Inline helper method
2013-03-02 17:24:05 -07:00
Katrina Owen
615a9e46c9
Encapsulate counts and totals into a class.
...
Move queries out of the view and into the model layer.
2013-03-02 17:22:15 -07:00
Katrina Owen
6ccb9a81fb
Group context-related pieces in a class
2013-03-02 17:21:03 -07:00
Katrina Owen
8b1f0a34a0
Group project-related stats into a class.
...
Reduce number of instance variables available to the views.
Replace raw SQL with AR-type query.
2013-03-02 17:12:14 -07:00
Reinier Balt
1e3782ce67
Merge pull request #168 from kytrinyx/stats-actions
...
Encapsulate the stats for actions on the stats index page
2013-03-02 13:58:32 -08:00
Matt Rogers
9e4ec67dd2
Merge pull request #167 from kytrinyx/stats-contexts-view
...
Simplify context partial in stats
2013-03-02 13:52:52 -08:00
Matt Rogers
0ab7e2101f
Merge pull request #166 from kytrinyx/tag-cloud-columns
...
Add spaces so tag cloud columns can wrap.
2013-03-02 13:47:44 -08:00
Katrina Owen
e56fa5740a
Make test name reflect actual data
2013-03-02 16:20:57 -05:00
Katrina Owen
c4433a5ea9
Don't round in ttc.min_sec method
...
This fixes a bug where it would round 1.8 days up to
2 days, and still display the extra hours in addition.
2013-03-02 16:16:45 -05:00
Katrina Owen
03282638af
Move calculation out of view
2013-03-02 16:16:45 -05:00
Katrina Owen
27ba50b460
Extract time to complete partial
2013-03-02 16:16:45 -05:00
Katrina Owen
62336f94cd
Move time to complete stats into separate class
...
This separates out the calculations from the queries so we can get
decent tests around them.
2013-03-02 16:16:45 -05:00
Katrina Owen
0ebb98d49f
Encapsulate action stats
...
This gets rid of a bunch of instance variables in the view/controller
layer.
2013-03-02 16:16:45 -05:00
Katrina Owen
2d2e5fd133
Simplify context partial in stats
2013-03-02 16:15:18 -05:00
Katrina Owen
d4fb1f95d8
Add spaces so tag cloud columns can wrap.
2013-03-02 15:52:39 -05:00
Reinier Balt
6c3f447d8e
remove two unused translation keys
2013-03-02 16:44:38 +01:00
Reinier Balt
f649c6ce0c
fix js for contexts and add i18n keys for closed contexts
2013-03-02 16:33:38 +01:00
Reinier Balt
2719cb87c7
use state machine from controller and handle exception
2013-03-02 14:52:21 +01:00
Matt Rogers
004339a2ca
Merge pull request #164 from kytrinyx/adjust-font-size
...
Split up the font size calculation
2013-03-02 05:40:38 -08:00
Matt Rogers
d518fe6eb0
Merge pull request #165 from kytrinyx/more-context-sql
...
Fold two more SQL queries into the query object
2013-03-02 05:39:06 -08:00
Katrina Owen
1b7ed32024
Fold two more SQL queries into the query object
2013-03-02 07:54:13 -05:00
Katrina Owen
3f496db4b4
Split up the font size calculation
...
The font size is a view concern, but the relative size belongs in the
model layer.
2013-03-02 07:14:52 -05:00
Reinier Balt
fbfc9c7086
do a small sleep to hopefully aviod an Element not found error
2013-03-02 11:44:54 +01:00
Reinier Balt
4aa5933946
return aruba to Gemfile and fix aruba scenarios
2013-03-02 11:36:46 +01:00