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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <Context> | |
| <Resource name="jdbc/vaja7" | |
| auth="Container" type="javax.sql.DataSource" | |
| maxActive="100" maxIdle="30" maxWait="10000" | |
| username="vaja7" password="vaja7" | |
| driverClassName="com.mysql.jdbc.Driver" | |
| url="jdbc:mysql://localhost:3306/vaja7"/> | |
| </Context> |
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
| Feature: Programme page | |
| As a visitor | |
| I want to be able to see the programme page | |
| So that I can view professors that teach in the programme | |
| Scenario: List of professors | |
| Given I have a programme | |
| And the programme has a professor "Peter Legiša" | |
| And the programme has a professor "Slavko Amon" | |
| When I go to the programme page |
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
| scope :get_professors, lambda { | |
| all.map(&professor) | |
| } | |
| ruby-1.8.7-p334 :002 > Programme.first.professor_at_programmes.by_rating("ASC").includes(:professor).get_professors | |
| => [] | |
| ruby-1.8.7-p334 :003 > Programme.first.professor_at_programmes.by_rating("ASC").includes(:professor).map(&:professor) | |
| => [#<Professor id: 2, slug: "B", name: "B", surname: "B", created_at: "2011-04-02 21:52:01", updated_at: "2011-04-02 21:52:01">, #<Professor id: 3, slug: "C", name: "C", surname: "C", created_at: "2011-04-02 21:52:04", updated_at: "2011-04-02 21:52:04">, #<Professor id: 1, slug: "A", name: "A", surname: "A", created_at: "2011-04-02 21:51:57", updated_at: "2011-04-02 21:51:57">] |
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
| ruby-1.8.7-p334 :021 > p.professor_at_programmes.by_rating("ASC").includes(:professor).to_sql => "SELECT \"professor_at_programmes\".* FROM \"professor_at_programmes\" WHERE (\"professor_at_programmes\".programme_id = 1) AND (num_scores > 0) ORDER BY ((num_scores / (num_scores + 1.0)) * (score / num_scores) + (1.0 / (num_scores + 1.0)) * 3.16666666666667) ASC" |
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
| scope :by_rating, :lambda do |order| | |
| order ||= "ASC" | |
| previous_scope = ? | |
| all_scores = previous_scope.where("num_scores > ?", 0).sum('score') | |
| num_of_all_scores = previous_scope.where("num_scores > ?", 0).sum('num_scores') | |
| site_avg = all_scores.to_f / num_of_all_scores.to_f | |
| site_avg = 0 if num_of_all_scores <= 0 # this is the reason I'd like to do it this way instead of the normal way | |
| min_votes = 5 | |
| previous_scope.where("num_scores > ?", 0).order("((num_scores / (num_scores + #{min_votes})) * (score / num_scores) + (#{min_votes} / (num_scores + #{min_votes})) * #{site_avg}) #{order}") |
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
| mrbrdo@zephyrus:~/rails$ rails new browsercmstest -m http://browsercms.org/templates/demo.rb | |
| create | |
| create README | |
| create Rakefile | |
| create config.ru | |
| create .gitignore | |
| create Gemfile | |
| create app | |
| create app/controllers/application_controller.rb | |
| create app/helpers/application_helper.rb |
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
| Running: cd "/Users/apple/reftest" && /Users/apple/.rvm/rubies/ruby-1.8.7-p334/bin/ruby -S rails generate refinerycms | |
| /Users/apple/.rvm/gems/ruby-1.8.7-p334/gems/refinerycms-core-0.9.9.10/lib/generators/refinerycms_generator.rb:16:in `generate': undefined method `root' for Refinery:Module (NoMethodError) | |
| from /Users/apple/.rvm/gems/ruby-1.8.7-p334/gems/thor-0.14.6/lib/thor/task.rb:22:in `send' | |
| from /Users/apple/.rvm/gems/ruby-1.8.7-p334/gems/thor-0.14.6/lib/thor/task.rb:22:in `run' | |
| from /Users/apple/.rvm/gems/ruby-1.8.7-p334/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task' | |
| from /Users/apple/.rvm/gems/ruby-1.8.7-p334/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `invoke_all' | |
| from /Users/apple/.rvm/gems/ruby-1.8.7-p334/gems/thor-0.14.6/lib/thor/shell.rb:14:in `map' | |
| from /Users/apple/.rvm/gems/ruby-1.8.7-p334/gems/thor-0.14.6/lib/thor/core_ext/ordered_hash.rb:75:in `each' | |
| from /Users/apple/.rvm/gems/ruby-1.8.7-p334/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `map' | |
| from /Users/apple/.rvm/ |
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
| NoMethodError in PagesController#home | |
| undefined method `reverse_merge!' for #<Array:0x5203e0c6> | |
| Rails.root: /Users/apple/testapp | |
| Application Trace | Framework Trace | Full Trace | |
| refinerycms-i18n (0.9.9.15) lib/refinery/i18n-js.rb:25:in `export!' | |
| refinerycms-i18n (0.9.9.15) lib/refinery/i18n-js.rb:24:in `each' | |
| refinerycms-i18n (0.9.9.15) lib/refinery/i18n-js.rb:24:in `export!' | |
| refinerycms-i18n (0.9.9.15) lib/refinery/i18n.rb:25:in `_callback_before_45' |
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
| Build time: 153.22826 seconds | |
| 1: LD vm/vm | |
| /home/mrbrdo/.rvm/rubies/ruby-1.8.7-p302/bin/ruby -S rake -r /home/mrbrdo/.rvm/src/rbx-head/config.rb -r /home/mrbrdo/.rvm/src/rbx-head/rakelib/ext_helper.rb -r /home/mrbrdo/.rvm/src/rbx-head/rakelib/dependency_grapher.rb build:mri | |
| GEN lib/compiler/opcodes.rb | |
| GEN lib/compiler/generator_methods.rb | |
| (in /home/mrbrdo/.rvm/src/rbx-head/lib/ext/melbourne) | |
| Building Melbourne for MRI | |
| CXX bstrlib.c | |
| CXX var_table.cpp | |
| CXX visitor.cpp |
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
| ~/Sites/testapp > rvm gem install sqlite3-ruby | |
| Building native extensions. This could take a while... | |
| /bin/sh: line 1: 2487 Abort trap /Library/Frameworks/MacRuby.framework/Versions/0.9/usr/bin/macruby extconf.rb 2>&1 | |
| ERROR: Error installing sqlite3-ruby: | |
| ERROR: Failed to build gem native extension. | |
| /Library/Frameworks/MacRuby.framework/Versions/0.9/usr/bin/macruby extconf.rb | |
| checking for sqlite3.h... *** extconf.rb failed *** | |
| Could not create Makefile due to some reason, probably lack of | |
| necessary libraries and/or headers. Check the mkmf.log file for more |