Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- THe code:
- def facebook_inspiration_link(impact)
- Rails.logger.debug "Facebook_inspiration_link"
- Rails.logger.debug "Impact: #{impact.to_yaml}"
- Rails.logger.debug "Impact Metrics: #{impact.impact_metrics.to_yaml}"
- Rails.logger.debug "First Impact Metric: #{impact.impact_metrics.first.to_yaml}"
- Rails.logger.debug "Metric: #{impact.impact_metrics.first.metric.to_yaml}"
- unless impact.user == current_user
- link_to('I did this too »', facebook_action_url(impact.impact_metrics.first.metric, :inspiration_id => impact.id))
- end
- end
- The log output:
- Facebook_inspiration_link
- Impact: --- !ruby/object:Impact
- attributes:
- created_at: 2008-11-11 19:38:47
- impacted_type:
- updated_at: 2008-11-11 19:38:47
- impacted_id:
- story:
- kudos_count: "0"
- headline: I saved a paper cup today by bringing a refillable one
- id: "1777"
- user_id: "11593"
- date_accomplished: 2008-11-11 19:38:47
- facebook: "1"
- inspiration_id:
- attributes_cache: {}
- impact_metrics:
- - !ruby/object:ImpactMetric
- attributes:
- impact_id: "1777"
- quantity: "6.00"
- id: "1612"
- user_id: "11593"
- metric_id: 809
- attributes_cache: {}
- changed_attributes:
- metric_id: 404 <-----here's the wackiness, the metric_id has changed
- user: !ruby/object:User
- attributes:
- salt:
- city: ""
- newsfeed_id: "12208"
- big_blue_color: main
- imported_id:
- facebook_id: "1632912393"
- created_at: 2008-11-11 17:13:48
- zip: ""
- latitude:
- image_file_name:
- crypted_password:
- remember_token_expires_at:
- is_email_notifiable: "1"
- country: ""
- private_last_name_setting: "0"
- last_activity:
- image_file_size:
- session_key: 2e56da614ca2ada819f19366-1632912393
- updated_at: 2008-11-12 11:45:41
- username: ""
- role: "0"
- image_content_type:
- id: "11593"
- long_description:
- reset_email: "0"
- private_location_setting: "0"
- last_name: ""
- is_verified: "0"
- remember_token:
- parent_id:
- imported_from:
- date_of_birth:
- description: ""
- longitude:
- private_profile_setting: "0"
- facebook_points: "75"
- first_name: ""
- email: ""
- email_validation_key:
- state: ""
- affiliated_org_id:
- attributes_cache: {}
- Impact Metrics: ---
- - !ruby/object:ImpactMetric
- attributes:
- impact_id: "1777"
- quantity: "6.00"
- id: "1612"
- user_id: "11593"
- metric_id: 809
- attributes_cache: {}
- changed_attributes:
- metric_id: 404
- First Impact Metric: --- !ruby/object:ImpactMetric
- attributes:
- impact_id: "1777"
- quantity: "6.00"
- id: "1612"
- user_id: "11593"
- metric_id: 809
- attributes_cache: {}
- changed_attributes:
- metric_id: 404
- Metric Load (0.000179) SELECT * FROM `metrics` WHERE (`metrics`.`id` = 809)
- Metric: --- <--- And so not metric is found, even though in script/console there is a metric, and in the DB directly too
Add Comment
Please, Sign In to add comment