This file contains 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
Url.includes(:services).where({"services.name" => 'Ape'}) |
This file contains 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 Service < ActiveRecord::Base | |
has_many :urls | |
validates_presence_of :name | |
end | |
class Url < ActiveRecord::Base | |
belongs_to :service | |
validates_presence_of :url, :service |
This file contains 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 Channel < ActiveRecord::Base | |
has_many :songs | |
has_many :songs, :through => :gigs | |
has_many :toplists | |
has_many :playlists | |
validates_presence_of :name, :active | |
end | |
class Song < ActiveRecord::Base |
This file contains 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
Counting objects: 185, done. | |
Delta compression using up to 2 threads. | |
Compressing objects: 100% (105/105), done. | |
Writing objects: 100% (185/185), 100.16 KiB, done. | |
Total 185 (delta 55), reused 181 (delta 53) | |
-----> Heroku receiving push | |
-----> Gemfile detected, running Bundler | |
-----> Bundler works best on the Bamboo stack. Please migrate your app: | |
http://docs.heroku.com/bamboo |
This file contains 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
Counting objects: 185, done. | |
Delta compression using up to 2 threads. | |
Compressing objects: 100% (105/105), done. | |
Writing objects: 100% (185/185), 100.16 KiB, done. | |
Total 185 (delta 55), reused 181 (delta 53) | |
-----> Heroku receiving push | |
-----> Migrating from aspen-mri-1.8.6 to bamboo-mri-1.9.1 | |
-----> Gemfile detected, running Bundler |
This file contains 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
Started GET "/content/?9112" for 10.192.130.112 at 2010-04-29 15:19:25 | |
Processing by ChannelsSongsController#content as */* | |
Parameters: {"9112"=>nil} | |
ActiveRecord::StatementInvalid (PGError: ERROR: relation "channels_songs" does not exist | |
: SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull | |
FROM pg_attribute a LEFT JOIN pg_attrdef d | |
ON a.attrelid = d.adrelid AND a.attnum = d.adnum | |
WHERE a.attrelid = '"channels_songs"'::regclass | |
AND a.attnum > 0 AND NOT a.attisdropped |
This file contains 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
Gig.includes({:channel, :songs}).where(:channels =>{:name => "Some Channel", :songs => {:title => "Some title"}}) |
This file contains 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
?> Gig.includes({:channel, :songs}).where(:channels =>{:name => "Channel", :songs => {:title => "Music"}}).order(:time) | |
ActiveRecord::StatementInvalid: Mysql::Error: Column 'time' in order clause is ambiguous: SELECT `gigs`.`id` AS t0_r0, `gigs`.`raw_id` AS t0_r1, `gigs`.`song_id` AS t0_r2, `gigs`.`channel_id` AS t0_r3, `gigs`.`time` AS t0_r4, `channels`.`id` AS t1_r0, `channels`.`name` AS t1_r1, `channels`.`alias` AS t1_r2, `channels`.`link` AS t1_r3, `channels`.`active` AS t1_r4, `songs`.`id` AS t2_r0, `songs`.`artist_id` AS t2_r1, `songs`.`title` AS t2_r2, `songs`.`grade` AS t2_r3, `songs`.`length` AS t2_r4 FROM `gigs` LEFT OUTER JOIN `channels` ON `channels`.`id` = `gigs`.`channel_id` LEFT OUTER JOIN `gigs` `songs_channels_join` ON `channels`.`id` = `songs_channels_join`.`channel_id` LEFT OUTER JOIN `songs` ON `songs`.`id` = `songs_channels_join`.`song_id` WHERE (`songs`.`title` = 'Music') AND (`channels`.`name` = 'Channel') ORDER BY time | |
from /Library/Ruby/Gems/1.8/gems/activerecord-3.0. |
This file contains 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
<tr> | |
<td colspan ="3"> | |
<% channel.gigs.songs.each do |song| %> | |
<%= song.title %><br /> | |
<% end %> | |
</td> | |
</td> |
This file contains 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
1.upto(1000) { |c| c.downto(1) { |b| b.downto(1) { |a| break if a + b + c == 1000 and a < b and b < c and c == Math.sqrt(a**2+b**2) }}} |