Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Simple content changes in scrabook

  • Loading branch information...
commit 6ec30c4f715e0203ec066ce787e5dcd3d2ae49b1 1 parent 9c3cca7
@equivalent authored
View
2  wisdom_inside/other/readed_articles
@@ -1,3 +1,5 @@
+http://robots.thoughtbot.com/post/11957424161/test-rake-tasks-like-a-boss
+
http://stackoverflow.com/questions/3994033/ruby-operator-a-k-a-the-double-bang
http://stackoverflow.com/questions/1208636/rails-include-vs-joins
View
34 wisdom_inside/scraps/googles
@@ -1,4 +1,38 @@
+
+date: 2013-03-06
+
+ $ rake my_custom_rake
+ rake aborted!
+ uninitialized constant User
+
+the reason for this is that you're not passing environment in your rake file
+
+
+ #lib/tasks/my_custom_rake.rake
+
+ desc "my custom functionality"
+ task :my_custom_rake do
+ User.all.each do |foo|
+ #....
+ end
+ end
+
+should be
+
+ desc "my custom functionality"
+ task :my_custom_rake => :environment do
+ User.all.each do |foo|
+ #....
+ end
+ end
+
+
+
+--------------------------------------
+
+
+
date: 2013-02-18
## problem:
View
15 wisdom_inside/scraps2/rails
@@ -1,8 +1,21 @@
-# Rails arel to do not equal where statement
+
+
+
+
+# Rails arel
+
+https://github.com/rails/arel
+
+**to do not equal where statement**
DocumentVersion.where( DocumentVersion.arel_table[:id].not_eq(self.id) )
+**lover than**
+
+ Event.arel_table[:start_at].lt(Time.now).to_sql
+ => "`events`.`start_at` < '2013-03-05 10:38:22'"
+
---------------------------------------------------------------------
View
5 wisdom_inside/scraps2/sql
@@ -0,0 +1,5 @@
+
+
+#select notifications that weren't sent
+
+ select notifications.id, (select count(*) from deliveries where deliveries.owner_type = 'Notification' and deliveries.owner_id = notifications.id) as total from notifications having total = 0
Please sign in to comment.
Something went wrong with that request. Please try again.