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 feed_markers | |
| markers = @content.submissions.map do |s| | |
| content_tag('span', {:class => 'marker-feed', 'data-feed-id' => s.id, :style => 'margin-right: 12px;'}) do | |
| hidden_field_tag("feed_id[#{s.feed_id}]", s.feed_id) + | |
| content_tag('span', :class => 'label') do | |
| "#{s.feed.name} #{link_to '<i class="icon-remove"></i>'.html_safe, '#'}".html_safe | |
| end | |
| end | |
| end | |
| markers.join.html_safe |
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
| [2013-06-02 15:41:21] ERROR NoMethodError: undefined method `tagged' for #<ScrubbingFormatter:0x00000005486d40 @datetime_format=nil> | |
| /home/bwm/concerto/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc1/lib/active_support/tagged_logging.rb:67:in `tagged' | |
| /home/bwm/concerto/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.rc1/lib/rails/rack/logger.rb:21:in `call' | |
| /home/bwm/concerto/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0.rc1/lib/action_dispatch/middleware/request_id.rb:21:in `call' | |
| /home/bwm/concerto/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call' | |
| /home/bwm/concerto/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call' | |
| /home/bwm/concerto/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc1/lib/active_support/cache/strategy/local_cache.rb:83:in `call' | |
| /home/bwm/concerto/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call' | |
| /home/bwm/concerto/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0.rc1/lib/action_dispatch/middleware/stati |
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
| zach@zach-ThinkPad-T61:~/Documents/rails/concerto$ rake routes | grep fields | |
| frontend_screen_field_contents GET /frontend/:screen_id/fields/:field_id/contents(.:format) frontend/contents#index | |
| frontend_screen_field_content GET /frontend/:screen_id/fields/:field_id/contents/:id(.:format) frontend/contents#show | |
| manage_screen_field_subscriptions GET /screens/:screen_id/fields/:field_id/subscriptions/manage(.:format) subscriptions#manage | |
| save_screen_field_subscriptions PUT /screens/:screen_id/fields/:field_id/subscriptions/save(.:format) subscriptions#save | |
| screen_field_subscriptions GET /screens/:screen_id/fields/:field_id/subscriptions(.:format) subscriptions#index | |
| POST /screens/:screen_id/fields/:field_id/subscriptions(.:format) subscriptions#create | |
| new_screen_field_subscription GET /screens/:screen_id/fields/:field_id/subscriptions/new(.:format) subscriptions#new | |
| edit_screen_f |
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
| ## feed.rb | |
| validate :parent_id_cannot_be_this_feed | |
| def parent_id_cannot_be_this_feed | |
| if !parent_id.blank? and parent_id == id | |
| errors.add(:parent_id, "can't be this feed") | |
| end | |
| end | |
| ## feed_test.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
| # Get level name of a membership | |
| def level_name | |
| Membership::LEVELS.key(level) | |
| 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/app/models/membership.rb b/app/models/membership.rb | |
| index 1b01ddc..803fea8 100644 | |
| --- a/app/models/membership.rb | |
| +++ b/app/models/membership.rb | |
| @@ -1,11 +1,13 @@ | |
| class Membership < ActiveRecord::Base | |
| # Membership levels | |
| LEVELS = { | |
| + # A denied member is not a member of the group. | |
| + :denied => 0, |
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
| require 'test_helper' | |
| class MembershipsControllerTest < ActionController::TestCase | |
| include Devise::TestHelpers | |
| def setup | |
| request.env["devise.mapping"] = Devise.mappings[:user] | |
| end | |
| test "should create pending membership" do |
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 | |
| # Include default devise modules. Others available are: | |
| # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable | |
| devise :cas_authenticatable, :trackable | |
| # Setup accessible (or protected) attributes for your model | |
| attr_accessible :email, :remember_me, :username | |
| has_and_belongs_to_many :layers |