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
| @cache_id=nil, | |
| @file= | |
| #<Cloudinary::CarrierWave::CloudinaryFile:0x007fb9ca6dbb28 | |
| @filename="j8geq7jnr1p0o4v9eddd.jpg", | |
| @format="jpg", | |
| @identifier="v1400870278/j8geq7jnr1p0o4v9eddd.jpg", | |
| @public_id="j8geq7jnr1p0o4v9eddd", | |
| @resource_type="image", | |
| @storage_type=nil, | |
| @uploader=#<ImageUploader:0x007fb9c7bf7cb8 ...>, |
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
| /Users/leslielai/.rvm/gems/ruby-2.1.1@apartmentlist/gems/activerecord-3.2.17/lib/active_record/connection_adapters/postgresql_adapter.rb:1163:in `exec': PG::UndefinedTable: ERROR: relation "referrals" does not exist (ActiveRecord::StatementInvalid) | |
| LINE 5: WHERE a.attrelid = '"referrals"'::regclass | |
| ^ | |
| : SELECT a.attname, format_type(a.atttypid, a.atttypmod), | |
| pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod | |
| FROM pg_attribute a LEFT JOIN pg_attrdef d | |
| ON a.attrelid = d.adrelid AND a.attnum = d.adnum | |
| WHERE a.attrelid = '"referrals"'::regclass | |
| AND a.attnum > 0 AND NOT a.attisdropped | |
| ORDER BY a.attnum |
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
| ~/apartment_list/apartmentlist (dev)$ wget "http://deploy.local:8080/files/al-production-pgbackups/a057.dump" | |
| --2014-03-27 16:08:11-- http://deploy.local:8080/files/al-production-pgbackups/a057.dump | |
| Resolving deploy.local... 10.33.31.247, 10.33.31.247, fe80::129a:ddff:fe45:83d9, ... | |
| Connecting to deploy.local|10.33.31.247|:8080... connected. | |
| HTTP request sent, awaiting response... 200 OK | |
| Length: 7805229401 (7.3G) [application/octet-stream] | |
| Saving to: 'a057.dump' | |
| 100%[=================================================================================================================>] 7,805,229,401 44.8MB/s in 2m 33s |
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
| grouping by ids or listings | |
| .group_by_type | |
| includes all listing classes as keys | |
| groups listings | |
| .rids_by_type_includes? | |
| return true if the listing exists | |
| return false if the listing does not exist | |
| .find_all_by_rental_id_for_srp | |
| /Users/leslielai/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/bigdecimal/util.rb:39: [BUG] Segmentation fault at 0x00000000000000 |
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
| class User < ActiveRecord::Base | |
| def compatible?(another_user_id) | |
| other = User.find(another_user_id) | |
| if orientation == 's' && other.orientation == 'g' | |
| return false | |
| elsif orientation == 'b' && other.orientation == 'b' | |
| return true | |
| elsif (orientation == 's' || orientation == 'b') && | |
| (other.orientation == 's' || other.orientation == 'b') | |
| return gender != other.gender |
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
| class TransactionStats | |
| def initialize(transactions, date_range) | |
| @transactions = transactions | |
| @date_range = date_range | |
| end | |
| def total_sales_between_dates | |
| total_sales(transactions_between_dates) | |
| 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
| class Customer | |
| attr_reader :referrer | |
| def initialize(name, referrer) | |
| @name = name | |
| @referrer = referrer || NullReferrer.new | |
| end | |
| def referrer_name | |
| referrer.name |
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
| class Customer | |
| attr_reader :referrer | |
| # Every customer has a name, but only some customers have a referrer. | |
| def initialize(name, referrer = nil) | |
| @name = name | |
| @referrer = referrer | |
| end | |
| def referrer_name |
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
| <div class="row"> | |
| <div class="col-md-offset-3" > | |
| <form class="add_choice" action="/surveys/<%= @survey_id %>/questions/<%= @question_id %>/choices" method="post"> | |
| <div>Choice: <input name ="choice" type="text"></div><br> | |
| <div class="another_choice"><button type="submit" class="btn btn-primary btn-xs add_c">Add Choice</button></div> | |
| </form><br> |
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
| // shorthand for $(document).ready(); | |
| $(function(){ | |
| $('button').click(function(e) { | |
| var email = $(':input[name="email"]').val(); | |
| var password = $(':input[name="password"]').val(); | |
| var errors = [] | |
| if (invalidEmail(email)) { | |
| errors.push(invalidEmail(email)); | |
| }; |
NewerOlder