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
@messages = Message.search do | |
any_of do | |
with(:user_ids, current_user.id) | |
all_of do | |
with(:user_ids).blank? | |
with(:school_ids, current_user.affiliated_school_ids.map {|s| s.to_s }) | |
end | |
all_of do | |
with(:user_ids).blank? | |
with(:school_ids).blank? |
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
def initialize(partial_path) | |
@partial_path = partial_path | |
@output = '' | |
end | |
def render(locals) | |
render_content(locals) | |
rescue Exception => exception | |
format_error(exception) | |
end |
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
diff --git a/db/structure.sql b/db/structure.sql | |
index bb8d264..fe9e339 100644 | |
--- a/db/structure.sql | |
+++ b/db/structure.sql | |
@@ -4,16 +4,22 @@ | |
SET statement_timeout = 0; | |
SET client_encoding = 'UTF8'; | |
-SET standard_conforming_strings = off; | |
+SET standard_conforming_strings = on; |
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
state_machine :state, intial: :active do | |
event :free_trial_signed_up do | |
transition all => :free_trial | |
end | |
event :account_created do | |
transition all => :active | |
end |
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
image = Image.new | |
# set anything you need to here | |
image.remote_image_url = "http://cdn.sheknows.com/articles/Tacos.jpg" | |
image.save |
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
"\xFF\xF3\x80\xC4\x00\x00\x00\x00\x00\x00\x00\x00\x00Xing\x00\x00\x00\x0F\x00\x00\x00<\x00\x00)\xA3\x00\a\n\n\x16\x1E\x1E\"\"(//66>FFLLR[[bbhmmvv\x7F\x88\x88\x8D\x8D\x92\x9A\x9A\xA0\xA0\xAB\xB0\xB0\xB6\xB6\xBF\xC8\xC8\xCD\xCD\xD2\xD7\xD7\xDE\xDE\xE5\xE9\xE9\xEE\xEE\xF0\xF1\xF1\xF1\xF1\xF2\xF3\xF3\xF3\xF3\xF4\xF5\xF5\xF5\xF5\xF6\xF7\xF7\xF7\xF7\xF8\xF8\xF8\xF9\xF9\xFA\xFA\xFA\xFB\xFB\xFC\xFC\xFC\xFD\xFD\xFE\xFE\xFE\xFF\xFF\xFF\x00\x00\x00ZLAME3.99r\x04n\x00\x00\x00\x00,\r\x00\x005\b$\x04Y!\x00\x01\xEA\x00\x00)\xA3\xE3l\xE2U\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xF3\xA0\xC4\x00\x10\x88~,\x162P\x00\x10\x9A/\xA8\x1C\bH\x03\x93\x02\xC2\xCF\xCBc\v \x91\xE9\xB8\xC5=\v\x188\xC7!@\x91\xE1\xC0\xB0E\xF4c\xD4\x93'5\x90\xFF\x81\xFF\xA2\xD7q\xA0B\xE9(M\x97\xAD\x1E\xA4\xBF\xF6\xFC\xDE\xA4\xFE\xC1\xC9\x7F\xFFN\xB4*\x90\xA0T-*\xDB\x88\xBA\e\xA3\x86\"5\x8B\x93\xAE\xB1$\x18l\x80P\xC2\x88\b\x19\r\xAC\x18\xB9\ |
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 AudioGenerator | |
require 'rest_client' | |
require 'xmlsimple' | |
attr_accessor :host | |
def initialize | |
self.host = "XXXXXX" | |
end | |
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
UPS.new(:login => 'developer-key') | |
UPS.find_rates(origin, destination, packages) |
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
destination = Location.new( :country => 'US', | |
:state => 'GA', | |
:city => 'Atlanta', | |
:zip => '30308') |
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
package = Package.new( 20, # 20 lbs | |
[12, 12, 8], # 12x12x8 inches | |
:units => :imperial) |
NewerOlder