has_many :role_assignments
has_many :roles, :through => :role_assignments
has_many :role_assignments
has_many :users, :through => :role_assignments
| #!/usr/bin/env ruby | |
| $:.push("lib") | |
| require 'image_science.rb' | |
| require 'deep_zoom.rb' | |
| file_options = { :format => 'png', | |
| :quality => 80 } | |
| slice_options = { :tile_size => 256, | |
| :overlap => 4 } |
| .datepicker { | |
| background-color: $white; | |
| border-color: #999; | |
| border-color: rgba(0, 0, 0, 0.2); | |
| border-style: solid; | |
| border-width: 1px; | |
| @include border-radius(4px); | |
| @include box-shadow(0 2px 4px rgba(0,0,0,.2)); | |
| @include background-clip(padding-box); |
| { | |
| "id": "rubygems", | |
| "application": { | |
| "staging": { | |
| "rails_postgresql_host" : "33.33.33.12", | |
| "rails_postgresql_db": "rubygems_staging", | |
| "rails_postgresql_user": "rubygems", | |
| "rails_postgresql_password": "totally insecure", | |
| "s3_key": "", | |
| "s3_secret": "", |
Oh Dearest Mother and Father,
I would like to be responsible for owning six Neon Tetras.
I am world's most responsible 10 ½ year old boy. I work with Pop. I lift boards, hold boards when he is cutting and install lights. I also run my own business, Fox Trail Trash Service. I go around the block and I take out peoples large trash cans on Thursday and bring them back in after the trash truck comes on Friday. I spend my money wisely. I think about things before I start saving for them. I've thought about saving for fish for a long while and I thing it's a good idea.
All my siblings have owned pets. My older sister, for example, had a hermit crab named Scaredy Cat when she was nine. She begged and begged and begged for a long, long, long time for a rabbit and finally bought – with her own money – a rabbit that she named Star when she was 10. My younger brother and sister got hermit crabs when they were four and five. My younger sister has also had a rabbit named Easter when she was
| class User < ActiveRecord::Base | |
| # New way recommended by rails | |
| has_many :membership_seasons, -> { uniq }, :through => :season_memberships, :source => :season | |
| # The Deprecated Way, which seems much easier to read | |
| has_many :membership_seasons, :through => :season_memberships, :source => :season, :uniq => true | |
| end |
| <!--[if HTML5]><![endif]--> | |
| <!DOCTYPE html> | |
| <!--[if lt IE 9]><html class="ie"><![endif]--> | |
| <!--[if gte IE 9]><!--> | |
| <html> | |
| <!--<![endif]--> | |
| <head></head> | |
| <body></body> | |
| </html> |
| # Is the following safe from SQL injection? | |
| Model.where(Model.arel_table[:name].matches("%#{params[:q]}%")) |