Browse Source

Removing puts and console.logs

denney-disable-on-select
Jason Denney 12 years ago
parent
commit
b11d04a397
  1. 2
      app/components/bike_logs.rb
  2. 2
      app/components/bike_models.rb
  3. 6
      app/components/bikes.rb
  4. 2
      app/components/bikes_border.rb
  5. 3
      app/components/brands_and_models_border.rb
  6. 5
      app/components/user_logs.rb
  7. 22
      app/components/user_profile_border.rb
  8. 2
      app/components/user_profiles.rb
  9. 3
      app/components/users_and_profiles_border.rb
  10. 1
      app/controllers/acts_as_loggable/bike_actions_controller.rb
  11. 1
      app/controllers/acts_as_loggable/transaction_actions_controller.rb
  12. 1
      app/controllers/acts_as_loggable/user_actions_controller.rb

2
app/components/bike_logs.rb

@ -7,7 +7,7 @@ class BikeLogs < Netzke::Basepack::Grid
c.model = "ActsAsLoggable::Log"
c.title = "Bike History"
c.data_store = {auto_load: false}
c.scope = lambda { |rel| puts session.inspect; rel.where(:loggable_type => 'Bike',:loggable_id => session[:selected_bike_id]);}
c.scope = lambda { |rel| rel.where(:loggable_type => 'Bike',:loggable_id => session[:selected_bike_id]);}
c.strong_default_attrs = {
:loggable_type => 'Bike',
:loggable_id => session[:selected_bike_id],

2
app/components/bike_models.rb

@ -5,7 +5,7 @@ class BikeModels < Netzke::Basepack::Grid
c.model = "BikeModel"
c.title = "Models"
c.data_store = {auto_load: false}
c.scope = lambda { |rel| puts session.inspect; rel.where(:bike_brand_id => session[:selected_bike_brand_id]);}
c.scope = lambda { |rel| rel.where(:bike_brand_id => session[:selected_bike_brand_id]);}
c.strong_default_attrs = {
:bike_brand_id => session[:selected_bike_brand_id]
}

6
app/components/bikes.rb

@ -45,11 +45,8 @@ class Bikes < Netzke::Basepack::Grid
// setting the 'rowclick' event
var view = this.getView();
view.on('itemclick', function(view, record){
console.log(view);
console.log(record);
// The beauty of using Ext.Direct: calling 3 endpoints in a row, which results in a single call to the server!
this.selectBikeBrand({bike_brand_id: record.get('bike_brand__brand')});
console.log(record.get('bike_brand__brand'));
}, this);
}
JS
@ -58,8 +55,5 @@ class Bikes < Netzke::Basepack::Grid
endpoint :select_bike_brand do |params, this|
# store selected boss id in the session for this component's instance
session[:selected_bike_brand_id] = params[:bike_brand_id]
puts "BikeID-----------------------------"
puts params[:bike_brand_id]
puts session.inspect
end
end

2
app/components/bikes_border.rb

@ -37,7 +37,5 @@ class BikesBorder < Netzke::Base
endpoint :select_bike do |params, this|
# store selected boss id in the session for this component's instance
session[:selected_bike_id] = params[:bike_id]
puts "BikeID-----------------------------"
puts session.inspect
end
end

3
app/components/brands_and_models_border.rb

@ -36,9 +36,6 @@ class BrandsAndModelsBorder < Netzke::Base
endpoint :select_bike_brand do |params, this|
# store selected boss id in the session for this component's instance
session[:selected_bike_brand_id] = params[:bike_brand_id]
puts "BikeBrandID-----------------------------"
#puts params[:bike_brand_id]
puts session.inspect
end
end

5
app/components/user_logs.rb

@ -21,7 +21,7 @@ class UserLogs < Netzke::Basepack::Grid
user_log_data_store = {auto_load: true }
#admins and staff
else
user_log_scope = lambda { |rel| puts session.inspect; rel.where(:loggable_type => 'User',:loggable_id => session[:selected_user_id]);}
user_log_scope = lambda { |rel| rel.where(:loggable_type => 'User',:loggable_id => session[:selected_user_id]);}
user_log_strong_default_attrs.merge!( { :loggable_id => session[:selected_user_id] } )
user_log_data_store = {auto_load: true }
end
@ -30,9 +30,8 @@ class UserLogs < Netzke::Basepack::Grid
c.title = "User History"
c.data_store = user_log_data_store
c.scope = user_log_scope
puts "user_log_strong_default_attrs"
puts user_log_strong_default_attrs.inspect
c.strong_default_attrs = user_log_strong_default_attrs
c.columns = [
{ :name => :start_date, :format => "g:ia - D, M j - Y", :width => 165, :default_value => Time.now.to_formatted_s(:db) },
{ :name => :end_date, :hidden => true, :default_value => Time.now.to_formatted_s(:db) },

22
app/components/user_profile_border.rb

@ -24,8 +24,6 @@ class UserProfileBorder < Netzke::Base
function(){
// calling superclass's initComponent
this.callParent();
console.log("init component");
console.log(this);
this.getComponent('user_stats').updateStats();
var store = this.getComponent('user_logs').getStore()
@ -33,26 +31,6 @@ class UserProfileBorder < Netzke::Base
console.log("Bitches");
this.getComponent('user_stats').updateStats();
}, this);
/**
this.getComponent('user_logs').getStore().load({
callback : function(records, operation, success) {
console.log(self);
console.log(this);
console.log("records");
console.log(records);
console.log("operation");
console.log(operation);
console.log("success");
console.log(success);
self.getComponent('user_stats').updateStats();
}
});*/
// var view = this.getComponent('user_logs').getView();
// view.on('itemclick', function(view, record){
// this.getComponent('user_stats').updateStats();
// }, this);
}
JS
end

2
app/components/user_profiles.rb

@ -6,7 +6,7 @@ class UserProfiles < Netzke::Basepack::Grid
user_profiles_scope = lambda { |rel| rel.where(:user_id => controller.current_user.id);}
user_profiles_data_store = { auto_load: true }
else
user_profiles_scope = lambda { |rel| puts session.inspect; rel.where(:user_id => session[:selected_user_id]);}
user_profiles_scope = lambda { |rel| rel.where(:user_id => session[:selected_user_id]);}
user_profiles_data_store = { auto_load: false}
end

3
app/components/users_and_profiles_border.rb

@ -41,9 +41,6 @@ class UsersAndProfilesBorder < Netzke::Base
endpoint :select_user do |params, this|
# store selected boss id in the session for this component's instance
session[:selected_user_id] = params[:user_id]
puts "UserID-----------------------------"
puts params[:user_id]
puts session.inspect
end
end

1
app/controllers/acts_as_loggable/bike_actions_controller.rb

@ -21,7 +21,6 @@ class ActsAsLoggable::BikeActionsController < AuthenticatedController
end
def update
puts bike_action.inspect
if bike_action.save
redirect_to acts_as_loggable_bike_actions_url
else

1
app/controllers/acts_as_loggable/transaction_actions_controller.rb

@ -21,7 +21,6 @@ class ActsAsLoggable::TransactionActionsController < AuthenticatedController
end
def update
puts transaction_action.inspect
if transaction_action.save
redirect_to acts_as_loggable_transaction_actions_url
else

1
app/controllers/acts_as_loggable/user_actions_controller.rb

@ -21,7 +21,6 @@ class ActsAsLoggable::UserActionsController < AuthenticatedController
end
def update
puts user_action.inspect
if user_action.save
redirect_to acts_as_loggable_user_actions_url
else

Loading…
Cancel
Save